diff options
author | Stanislav Ionascu <stanislav.ionascu@nokia.com> | 2010-12-23 09:45:37 +0200 |
---|---|---|
committer | Stanislav Ionascu <stanislav.ionascu@nokia.com> | 2010-12-23 12:23:47 +0200 |
commit | 203388631e15ab65fc5127ee4ad3e090cc5fd449 (patch) | |
tree | fa37824e0e5df23dd50d0512b0f1d2e1a12001e5 | |
parent | 7f919f7da79d82ac29527d524777c10edb61d98d (diff) |
Changes: Provide base DBus interface without blocking introspection.
RevBy: Dominik Kapusta, Pekka Vuorela
Details: QDBusInterface blocks application flow due to introspection,
so we are providing a subclass of QDBusAbstractInterface, which does
not do any kind of blocking introspection.
Credits to Kuisma Salonen for original merge request and idea.
-rw-r--r-- | src/corelib/core/core.pri | 2 | ||||
-rw-r--r-- | src/corelib/core/mdbusinterface.cpp | 30 | ||||
-rw-r--r-- | src/corelib/core/mdbusinterface.h | 44 | ||||
-rw-r--r-- | src/include/mdbusinterface.h | 20 |
4 files changed, 96 insertions, 0 deletions
diff --git a/src/corelib/core/core.pri b/src/corelib/core/core.pri index 4b217ae2..bf502615 100644 --- a/src/corelib/core/core.pri +++ b/src/corelib/core/core.pri @@ -52,6 +52,7 @@ contains(DEFINES, HAVE_DBUS) { PRIVATE_HEADERS += \ $$CORE_SRC_DIR/mapplicationservice_p.h \ $$CORE_SRC_DIR/mdbusservicewaiter_p.h \ + $$CORE_SRC_DIR/mdbusinterface.h \ } @@ -88,6 +89,7 @@ contains(DEFINES, HAVE_DBUS) { $$CORE_SRC_DIR/mapplicationifproxy.cpp \ $$CORE_SRC_DIR/mremoteaction.cpp \ $$CORE_SRC_DIR/mdbusservicewaiter.cpp \ + $$CORE_SRC_DIR/mdbusinterface.cpp \ } contains(DEFINES, HAVE_GCONF) { diff --git a/src/corelib/core/mdbusinterface.cpp b/src/corelib/core/mdbusinterface.cpp new file mode 100644 index 00000000..6cfc31dc --- /dev/null +++ b/src/corelib/core/mdbusinterface.cpp @@ -0,0 +1,30 @@ +/*************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of libmeegotouch. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + +#include "mdbusinterface.h" + +MDBusInteface::MDBusInteface(const QString &service, const QString &path, const char *interface, + const QDBusConnection &connection, QObject *parent) : + QDBusAbstractInterface(service, path, interface, connection, parent) +{ +} + +MDBusInteface::~MDBusInteface() +{ +} diff --git a/src/corelib/core/mdbusinterface.h b/src/corelib/core/mdbusinterface.h new file mode 100644 index 00000000..0d758497 --- /dev/null +++ b/src/corelib/core/mdbusinterface.h @@ -0,0 +1,44 @@ +/*************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of libmeegotouch. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + + +#ifndef MDBUSINTEFACE_H +#define MDBUSINTEFACE_H + +#include "mexport.h" +#include <QDBusAbstractInterface> + +/*! \internal */ + +/*! + \brief This class is a subclass QDBusAbstractInterface, which allows making asynchronous calls to + DBus without any type of blocking introspection. +*/ + +class M_CORE_EXPORT MDBusInteface : public QDBusAbstractInterface +{ +public: + MDBusInteface(const QString &service, const QString &path, const char *interface, + const QDBusConnection &connection = QDBusConnection::sessionBus() , QObject *parent = 0); + virtual ~MDBusInteface(); +}; + +/*! \internal_end */ + +#endif // MDBUSINTEFACE_H diff --git a/src/include/mdbusinterface.h b/src/include/mdbusinterface.h new file mode 100644 index 00000000..e83891d8 --- /dev/null +++ b/src/include/mdbusinterface.h @@ -0,0 +1,20 @@ +/*************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of libmeegotouch. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + +#include "../corelib/core/mdbusinterface.h" |