Fix DBus communication in order to re-use app instances

This commit is contained in:
jfmcarreira committed 2017-09-11 01:08:00 +01:00
1 parent 261cee821f
commit 1833ca12ec
3 files changed
+6 -5

No files matched your search

+3 -1
View File
@@ -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()
+2 -2
View File
@@ -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
View File
@@ -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;