添加dbus功能

This commit is contained in:
2022-12-11 01:19:59 +08:00
parent ae1c50893d
commit 8a54dd92a3
5 changed files with 65 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
#include "dbussparkstoreservice.h"
#include <QDebug>
DBusSparkStoreService::DBusSparkStoreService(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
}
void DBusSparkStoreService::activeWindow(const QString & arg)
{
emit sigOpenUrl(arg);
}

View File

@@ -0,0 +1,24 @@
#ifndef DBUSSPARKSTORESERVICE_H
#define DBUSSPARKSTORESERVICE_H
#include <QObject>
#include <QUrl>
#include <QtDBus/QtDBus>
class Wallpaper;
class DBusSparkStoreService : public QDBusAbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "com.gitee.spark.store")
public:
explicit DBusSparkStoreService(QObject *parent);
signals :
void sigOpenUrl(const QString &url);
public Q_SLOTS:
void activeWindow(const QString &arg);
};
#endif // DBUSSPARKSTORESERVICE_H