Fix DBus communication in order to re-use app instances
This commit is contained in:
3 files changed
+6
-5
No files matched your search
@@ -30,8 +30,10 @@ PlaYUVerAppAdaptor::PlaYUVerAppAdaptor( PlaYUVerApp* app )
|
||||
: QDBusAbstractAdaptor( app ), m_app( app )
|
||||
{
|
||||
// application dbus interface
|
||||
QDBusConnection::sessionBus().registerObject( QStringLiteral( PLAYUVER_DBUS_PATH ), this,
|
||||
Bool isRegistered = QDBusConnection::sessionBus().registerObject( QStringLiteral( PLAYUVER_DBUS_PATH ), this,
|
||||
QDBusConnection::ExportAllSlots );
|
||||
|
||||
Q_ASSERT( isRegistered == true );
|
||||
}
|
||||
|
||||
PlaYUVerAppAdaptor::~PlaYUVerAppAdaptor()
|
||||
|
||||
@@ -33,14 +33,14 @@
|
||||
#include <QtDBus>
|
||||
|
||||
#define PLAYUVER_DBUS_SESSION_NAME "org.pixlra.PlaYUVer.application"
|
||||
#define PLAYUVER_DBUS_PATH "/MainApplication"
|
||||
#define PLAYUVER_DBUS_PATH "/"
|
||||
|
||||
class PlaYUVerApp;
|
||||
|
||||
class PlaYUVerAppAdaptor : public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO( "D-Bus Interface", "org.pixlra.PlaYUVer.application" )
|
||||
Q_CLASSINFO( "D-Bus Interface", PLAYUVER_DBUS_SESSION_NAME )
|
||||
Q_PROPERTY( QString activeSession READ activeSession )
|
||||
public:
|
||||
PlaYUVerAppAdaptor( PlaYUVerApp* app );
|
||||
|
||||
+1
-2
@@ -56,8 +56,7 @@ int main( int argc, char* argv[] )
|
||||
* use dbus, if available
|
||||
* allows for resuse of running Kate instances
|
||||
*/
|
||||
QDBusConnectionInterface* const sessionBusInterface = QDBusConnection::sessionBus().interface();
|
||||
if( sessionBusInterface )
|
||||
if (QDBusConnectionInterface * const sessionBusInterface = QDBusConnection::sessionBus().interface())
|
||||
{
|
||||
Bool force_new = false;
|
||||
QStringList filenameList;
|
||||
|
||||
Reference in new issue
Block a user