Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
206 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "dbusadaptor.h" | ||
|
||
#include <QtQuick> | ||
|
||
DBusAdaptor::DBusAdaptor(QQuickView *view) | ||
: QDBusAbstractAdaptor(view) | ||
, _view(view) | ||
{ | ||
} | ||
|
||
DBusAdaptor::~DBusAdaptor() | ||
{ | ||
} | ||
|
||
void DBusAdaptor::Open(const QStringList &uris, const QVariantMap &) | ||
{ | ||
if (!uris.isEmpty()) { | ||
QMetaObject::invokeMethod(_view->rootObject(), "openFile", Q_ARG(QVariant, uris.at(0))); | ||
} | ||
QMetaObject::invokeMethod(_view->rootObject(), "activate"); | ||
} | ||
|
||
void DBusAdaptor::Activate(const QVariantMap&) | ||
{ | ||
QMetaObject::invokeMethod(_view->rootObject(), "activate"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef DBUSADAPTOR_H | ||
#define DBUSADAPTOR_H | ||
|
||
#include <QObject> | ||
#include <QtDBus/QDBusAbstractAdaptor> | ||
#include <QQuickView> | ||
|
||
class DBusAdaptor : public QDBusAbstractAdaptor | ||
{ | ||
Q_OBJECT | ||
Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Application") | ||
|
||
public: | ||
DBusAdaptor(QQuickView *view); | ||
~DBusAdaptor(); | ||
|
||
public Q_SLOTS: | ||
Q_NOREPLY void Open(const QStringList &uris, const QVariantMap &platformData); | ||
Q_NOREPLY void Activate(const QVariantMap &platformData); | ||
|
||
private: | ||
QQuickView* _view; | ||
|
||
}; | ||
|
||
#endif // DBUSADAPTOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.