[arch-commits] Commit in polkit-qt/repos (8 files)

Evangelos Foutras foutrelis at archlinux.org
Sun Dec 6 12:51:24 UTC 2015


    Date: Sunday, December 6, 2015 @ 13:51:24
  Author: foutrelis
Revision: 252815

archrelease: copy trunk to staging-i686, staging-x86_64

Added:
  polkit-qt/repos/staging-i686/PKGBUILD
    (from rev 252814, polkit-qt/trunk/PKGBUILD)
  polkit-qt/repos/staging-i686/systembus-usage.patch
    (from rev 252814, polkit-qt/trunk/systembus-usage.patch)
  polkit-qt/repos/staging-x86_64/PKGBUILD
    (from rev 252814, polkit-qt/trunk/PKGBUILD)
  polkit-qt/repos/staging-x86_64/systembus-usage.patch
    (from rev 252814, polkit-qt/trunk/systembus-usage.patch)
Deleted:
  polkit-qt/repos/staging-i686/PKGBUILD
  polkit-qt/repos/staging-i686/systembus-usage.patch
  polkit-qt/repos/staging-x86_64/PKGBUILD
  polkit-qt/repos/staging-x86_64/systembus-usage.patch

--------------------------------------+
 /PKGBUILD                            |  116 ++++++++++++++++++++++++
 /systembus-usage.patch               |  158 +++++++++++++++++++++++++++++++++
 staging-i686/PKGBUILD                |   58 ------------
 staging-i686/systembus-usage.patch   |   79 ----------------
 staging-x86_64/PKGBUILD              |   58 ------------
 staging-x86_64/systembus-usage.patch |   79 ----------------
 6 files changed, 274 insertions(+), 274 deletions(-)

Deleted: staging-i686/PKGBUILD
===================================================================
--- staging-i686/PKGBUILD	2015-12-06 12:51:15 UTC (rev 252814)
+++ staging-i686/PKGBUILD	2015-12-06 12:51:24 UTC (rev 252815)
@@ -1,58 +0,0 @@
-# $Id: PKGBUILD 102633 2010-12-09 08:40:59Z andrea $
-# Maintainer: Andrea Scarpino <andrea at archlinux.org>
-# Contributor: Pierre Schmitz <pierre at archlinux.de>
-
-pkgbase=polkit-qt
-pkgname=('polkit-qt4' 'polkit-qt5')
-pkgver=0.112.0
-pkgrel=2
-pkgdesc='A library that allows developers to access PolicyKit API with a nice Qt-style API'
-arch=('i686' 'x86_64')
-url='https://projects.kde.org/projects/kdesupport/polkit-qt-1'
-license=('LGPL')
-makedepends=('cmake' 'automoc4' 'polkit' 'qt4' 'qt5-base')
-source=("http://download.kde.org/stable/apps/KDE4.x/admin/${pkgbase}-1-${pkgver}.tar.bz2"
-        'systembus-usage.patch')
-md5sums=('bee71b71c12797e6fc498540a06c829b'
-         '067355984adf2cd87e2fac715bd025f3')
-
-prepare() {
-  mkdir build{,-qt5}
-
-  cd ${pkgbase}-1-${pkgver}
-  patch -p1 -i "${srcdir}"/systembus-usage.patch
-}
-
-build() {
-  cd build
-  cmake ../${pkgbase}-1-${pkgver} \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DLIB_DESTINATION=/usr/lib \
-    -DUSE_QT4=ON
-  make
-
-  cd ../build-qt5
-  cmake ../${pkgbase}-1-${pkgver} \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DLIB_DESTINATION=/usr/lib
-  make
-}
-
-package_polkit-qt4() {
-  depends=('polkit' 'qt4')
-  replaces=('polkit-qt')
-  provides=('polkit-qt')
-  conflicts=('polkit-qt')
-
-  cd build
-  make DESTDIR="${pkgdir}" install
-}
-
-package_polkit-qt5() {
-  depends=('polkit' 'qt5-base')
-
-  cd build-qt5
-  make DESTDIR="${pkgdir}" install
-}

Copied: polkit-qt/repos/staging-i686/PKGBUILD (from rev 252814, polkit-qt/trunk/PKGBUILD)
===================================================================
--- staging-i686/PKGBUILD	                        (rev 0)
+++ staging-i686/PKGBUILD	2015-12-06 12:51:24 UTC (rev 252815)
@@ -0,0 +1,58 @@
+# $Id: PKGBUILD 102633 2010-12-09 08:40:59Z andrea $
+# Maintainer: Andrea Scarpino <andrea at archlinux.org>
+# Contributor: Pierre Schmitz <pierre at archlinux.de>
+
+pkgbase=polkit-qt
+pkgname=('polkit-qt4' 'polkit-qt5')
+pkgver=0.112.0
+pkgrel=3
+pkgdesc='A library that allows developers to access PolicyKit API with a nice Qt-style API'
+arch=('i686' 'x86_64')
+url='https://projects.kde.org/projects/kdesupport/polkit-qt-1'
+license=('LGPL')
+makedepends=('cmake' 'automoc4' 'polkit' 'qt4' 'qt5-base')
+source=("http://download.kde.org/stable/apps/KDE4.x/admin/${pkgbase}-1-${pkgver}.tar.bz2"
+        'systembus-usage.patch')
+md5sums=('bee71b71c12797e6fc498540a06c829b'
+         '067355984adf2cd87e2fac715bd025f3')
+
+prepare() {
+  mkdir build{,-qt5}
+
+  cd ${pkgbase}-1-${pkgver}
+  patch -p1 -i "${srcdir}"/systembus-usage.patch
+}
+
+build() {
+  cd build
+  cmake ../${pkgbase}-1-${pkgver} \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DLIB_DESTINATION=/usr/lib \
+    -DUSE_QT4=ON
+  make
+
+  cd ../build-qt5
+  cmake ../${pkgbase}-1-${pkgver} \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DLIB_DESTINATION=/usr/lib
+  make
+}
+
+package_polkit-qt4() {
+  depends=('polkit' 'qt4')
+  replaces=('polkit-qt')
+  provides=('polkit-qt')
+  conflicts=('polkit-qt')
+
+  cd build
+  make DESTDIR="${pkgdir}" install
+}
+
+package_polkit-qt5() {
+  depends=('polkit' 'qt5-base')
+
+  cd build-qt5
+  make DESTDIR="${pkgdir}" install
+}

Deleted: staging-i686/systembus-usage.patch
===================================================================
--- staging-i686/systembus-usage.patch	2015-12-06 12:51:15 UTC (rev 252814)
+++ staging-i686/systembus-usage.patch	2015-12-06 12:51:24 UTC (rev 252815)
@@ -1,79 +0,0 @@
-commit 88c6e9334c8440721189ef7d020fa94d47f30f8b
-Author: Harald Sitter <sitter at kde.org>
-Date:   Fri Aug 1 16:34:03 2014 +0200
-
-    do not use global static systembus instance
-    
-    global static destruction order cannot be controlled and we need our bus
-    to disconnect from the consolekit signals, so use our own bus instance
-    to connect to systembus signals
-    
-    REVIEW: 119545
-
-diff --git a/core/polkitqt1-authority.cpp b/core/polkitqt1-authority.cpp
-index dd014cf..f25354d 100644
---- a/core/polkitqt1-authority.cpp
-+++ b/core/polkitqt1-authority.cpp
-@@ -83,7 +83,10 @@ public:
-     // Polkit will return NULL on failures, hence we use it instead of 0
-     Private(Authority *qq) : q(qq)
-             , pkAuthority(NULL)
--            , m_hasError(false) {}
-+            , m_hasError(false)
-+            , m_systemBus(0)
-+    {
-+    }
- 
-     ~Private();
- 
-@@ -103,6 +106,13 @@ public:
-     bool m_hasError;
-     Authority::ErrorCode m_lastError;
-     QString m_errorDetails;
-+    // Local system bus. QDBusConnection::systemBus() may only be savely used
-+    // inside a QCoreApplication scope as for example destruction of connected
-+    // objects need to happen before the bus disappears. Since this class however
-+    // is a global static and systemBus() internally is a global static we
-+    // cannot assure destruction order. Instead we create a local copy of the
-+    // global systemBus instance so we can make life time to our needs.
-+    // This prevents crashes when cleaning up the global statics.
-     QDBusConnection *m_systemBus;
-     GCancellable *m_checkAuthorizationCancellable,
-     *m_enumerateActionsCancellable,
-@@ -127,6 +137,7 @@ public:
- 
- Authority::Private::~Private()
- {
-+    delete m_systemBus;
-     g_object_unref(m_checkAuthorizationCancellable);
-     g_object_unref(m_enumerateActionsCancellable);
-     g_object_unref(m_registerAuthenticationAgentCancellable);
-@@ -170,6 +181,9 @@ void Authority::Private::init()
- 
-     g_type_init();
- 
-+    m_systemBus = new QDBusConnection(QDBusConnection::connectToBus(QDBusConnection::SystemBus,
-+                                                                    QString("polkit_qt_system_bus")));
-+
-     m_checkAuthorizationCancellable = g_cancellable_new();
-     m_enumerateActionsCancellable = g_cancellable_new();
-     m_registerAuthenticationAgentCancellable = g_cancellable_new();
-@@ -219,7 +233,7 @@ void Authority::Private::init()
- 
-     // then we need to extract all seats from ConsoleKit
-     QDBusMessage msg = QDBusMessage::createMethodCall(consoleKitService, consoleKitManagerPath, consoleKitManagerInterface, "GetSeats");
--    msg = QDBusConnection::systemBus().call(msg);
-+    msg = m_systemBus->call(msg);
-     if (!msg.arguments().isEmpty()) {
-         // this method returns a list with present seats
-         QList<QString> seats;
-@@ -256,8 +270,7 @@ void Authority::Private::seatSignalsConnect(const QString &seat)
- void Authority::Private::dbusSignalAdd(const QString &service, const QString &path, const QString &interface, const QString &name)
- {
-     // FIXME: This code seems to be nonfunctional - it needs to be fixed somewhere (is it Qt BUG?)
--    QDBusConnection::systemBus().connect(service, path, interface, name,
--                                         q, SLOT(dbusFilter(QDBusMessage)));
-+    m_systemBus->connect(service, path, interface, name, q, SLOT(dbusFilter(QDBusMessage)));
- }
- 
- void Authority::Private::dbusFilter(const QDBusMessage &message)

Copied: polkit-qt/repos/staging-i686/systembus-usage.patch (from rev 252814, polkit-qt/trunk/systembus-usage.patch)
===================================================================
--- staging-i686/systembus-usage.patch	                        (rev 0)
+++ staging-i686/systembus-usage.patch	2015-12-06 12:51:24 UTC (rev 252815)
@@ -0,0 +1,79 @@
+commit 88c6e9334c8440721189ef7d020fa94d47f30f8b
+Author: Harald Sitter <sitter at kde.org>
+Date:   Fri Aug 1 16:34:03 2014 +0200
+
+    do not use global static systembus instance
+    
+    global static destruction order cannot be controlled and we need our bus
+    to disconnect from the consolekit signals, so use our own bus instance
+    to connect to systembus signals
+    
+    REVIEW: 119545
+
+diff --git a/core/polkitqt1-authority.cpp b/core/polkitqt1-authority.cpp
+index dd014cf..f25354d 100644
+--- a/core/polkitqt1-authority.cpp
++++ b/core/polkitqt1-authority.cpp
+@@ -83,7 +83,10 @@ public:
+     // Polkit will return NULL on failures, hence we use it instead of 0
+     Private(Authority *qq) : q(qq)
+             , pkAuthority(NULL)
+-            , m_hasError(false) {}
++            , m_hasError(false)
++            , m_systemBus(0)
++    {
++    }
+ 
+     ~Private();
+ 
+@@ -103,6 +106,13 @@ public:
+     bool m_hasError;
+     Authority::ErrorCode m_lastError;
+     QString m_errorDetails;
++    // Local system bus. QDBusConnection::systemBus() may only be savely used
++    // inside a QCoreApplication scope as for example destruction of connected
++    // objects need to happen before the bus disappears. Since this class however
++    // is a global static and systemBus() internally is a global static we
++    // cannot assure destruction order. Instead we create a local copy of the
++    // global systemBus instance so we can make life time to our needs.
++    // This prevents crashes when cleaning up the global statics.
+     QDBusConnection *m_systemBus;
+     GCancellable *m_checkAuthorizationCancellable,
+     *m_enumerateActionsCancellable,
+@@ -127,6 +137,7 @@ public:
+ 
+ Authority::Private::~Private()
+ {
++    delete m_systemBus;
+     g_object_unref(m_checkAuthorizationCancellable);
+     g_object_unref(m_enumerateActionsCancellable);
+     g_object_unref(m_registerAuthenticationAgentCancellable);
+@@ -170,6 +181,9 @@ void Authority::Private::init()
+ 
+     g_type_init();
+ 
++    m_systemBus = new QDBusConnection(QDBusConnection::connectToBus(QDBusConnection::SystemBus,
++                                                                    QString("polkit_qt_system_bus")));
++
+     m_checkAuthorizationCancellable = g_cancellable_new();
+     m_enumerateActionsCancellable = g_cancellable_new();
+     m_registerAuthenticationAgentCancellable = g_cancellable_new();
+@@ -219,7 +233,7 @@ void Authority::Private::init()
+ 
+     // then we need to extract all seats from ConsoleKit
+     QDBusMessage msg = QDBusMessage::createMethodCall(consoleKitService, consoleKitManagerPath, consoleKitManagerInterface, "GetSeats");
+-    msg = QDBusConnection::systemBus().call(msg);
++    msg = m_systemBus->call(msg);
+     if (!msg.arguments().isEmpty()) {
+         // this method returns a list with present seats
+         QList<QString> seats;
+@@ -256,8 +270,7 @@ void Authority::Private::seatSignalsConnect(const QString &seat)
+ void Authority::Private::dbusSignalAdd(const QString &service, const QString &path, const QString &interface, const QString &name)
+ {
+     // FIXME: This code seems to be nonfunctional - it needs to be fixed somewhere (is it Qt BUG?)
+-    QDBusConnection::systemBus().connect(service, path, interface, name,
+-                                         q, SLOT(dbusFilter(QDBusMessage)));
++    m_systemBus->connect(service, path, interface, name, q, SLOT(dbusFilter(QDBusMessage)));
+ }
+ 
+ void Authority::Private::dbusFilter(const QDBusMessage &message)

Deleted: staging-x86_64/PKGBUILD
===================================================================
--- staging-x86_64/PKGBUILD	2015-12-06 12:51:15 UTC (rev 252814)
+++ staging-x86_64/PKGBUILD	2015-12-06 12:51:24 UTC (rev 252815)
@@ -1,58 +0,0 @@
-# $Id: PKGBUILD 102633 2010-12-09 08:40:59Z andrea $
-# Maintainer: Andrea Scarpino <andrea at archlinux.org>
-# Contributor: Pierre Schmitz <pierre at archlinux.de>
-
-pkgbase=polkit-qt
-pkgname=('polkit-qt4' 'polkit-qt5')
-pkgver=0.112.0
-pkgrel=2
-pkgdesc='A library that allows developers to access PolicyKit API with a nice Qt-style API'
-arch=('i686' 'x86_64')
-url='https://projects.kde.org/projects/kdesupport/polkit-qt-1'
-license=('LGPL')
-makedepends=('cmake' 'automoc4' 'polkit' 'qt4' 'qt5-base')
-source=("http://download.kde.org/stable/apps/KDE4.x/admin/${pkgbase}-1-${pkgver}.tar.bz2"
-        'systembus-usage.patch')
-md5sums=('bee71b71c12797e6fc498540a06c829b'
-         '067355984adf2cd87e2fac715bd025f3')
-
-prepare() {
-  mkdir build{,-qt5}
-
-  cd ${pkgbase}-1-${pkgver}
-  patch -p1 -i "${srcdir}"/systembus-usage.patch
-}
-
-build() {
-  cd build
-  cmake ../${pkgbase}-1-${pkgver} \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DLIB_DESTINATION=/usr/lib \
-    -DUSE_QT4=ON
-  make
-
-  cd ../build-qt5
-  cmake ../${pkgbase}-1-${pkgver} \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DLIB_DESTINATION=/usr/lib
-  make
-}
-
-package_polkit-qt4() {
-  depends=('polkit' 'qt4')
-  replaces=('polkit-qt')
-  provides=('polkit-qt')
-  conflicts=('polkit-qt')
-
-  cd build
-  make DESTDIR="${pkgdir}" install
-}
-
-package_polkit-qt5() {
-  depends=('polkit' 'qt5-base')
-
-  cd build-qt5
-  make DESTDIR="${pkgdir}" install
-}

Copied: polkit-qt/repos/staging-x86_64/PKGBUILD (from rev 252814, polkit-qt/trunk/PKGBUILD)
===================================================================
--- staging-x86_64/PKGBUILD	                        (rev 0)
+++ staging-x86_64/PKGBUILD	2015-12-06 12:51:24 UTC (rev 252815)
@@ -0,0 +1,58 @@
+# $Id: PKGBUILD 102633 2010-12-09 08:40:59Z andrea $
+# Maintainer: Andrea Scarpino <andrea at archlinux.org>
+# Contributor: Pierre Schmitz <pierre at archlinux.de>
+
+pkgbase=polkit-qt
+pkgname=('polkit-qt4' 'polkit-qt5')
+pkgver=0.112.0
+pkgrel=3
+pkgdesc='A library that allows developers to access PolicyKit API with a nice Qt-style API'
+arch=('i686' 'x86_64')
+url='https://projects.kde.org/projects/kdesupport/polkit-qt-1'
+license=('LGPL')
+makedepends=('cmake' 'automoc4' 'polkit' 'qt4' 'qt5-base')
+source=("http://download.kde.org/stable/apps/KDE4.x/admin/${pkgbase}-1-${pkgver}.tar.bz2"
+        'systembus-usage.patch')
+md5sums=('bee71b71c12797e6fc498540a06c829b'
+         '067355984adf2cd87e2fac715bd025f3')
+
+prepare() {
+  mkdir build{,-qt5}
+
+  cd ${pkgbase}-1-${pkgver}
+  patch -p1 -i "${srcdir}"/systembus-usage.patch
+}
+
+build() {
+  cd build
+  cmake ../${pkgbase}-1-${pkgver} \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DLIB_DESTINATION=/usr/lib \
+    -DUSE_QT4=ON
+  make
+
+  cd ../build-qt5
+  cmake ../${pkgbase}-1-${pkgver} \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DLIB_DESTINATION=/usr/lib
+  make
+}
+
+package_polkit-qt4() {
+  depends=('polkit' 'qt4')
+  replaces=('polkit-qt')
+  provides=('polkit-qt')
+  conflicts=('polkit-qt')
+
+  cd build
+  make DESTDIR="${pkgdir}" install
+}
+
+package_polkit-qt5() {
+  depends=('polkit' 'qt5-base')
+
+  cd build-qt5
+  make DESTDIR="${pkgdir}" install
+}

Deleted: staging-x86_64/systembus-usage.patch
===================================================================
--- staging-x86_64/systembus-usage.patch	2015-12-06 12:51:15 UTC (rev 252814)
+++ staging-x86_64/systembus-usage.patch	2015-12-06 12:51:24 UTC (rev 252815)
@@ -1,79 +0,0 @@
-commit 88c6e9334c8440721189ef7d020fa94d47f30f8b
-Author: Harald Sitter <sitter at kde.org>
-Date:   Fri Aug 1 16:34:03 2014 +0200
-
-    do not use global static systembus instance
-    
-    global static destruction order cannot be controlled and we need our bus
-    to disconnect from the consolekit signals, so use our own bus instance
-    to connect to systembus signals
-    
-    REVIEW: 119545
-
-diff --git a/core/polkitqt1-authority.cpp b/core/polkitqt1-authority.cpp
-index dd014cf..f25354d 100644
---- a/core/polkitqt1-authority.cpp
-+++ b/core/polkitqt1-authority.cpp
-@@ -83,7 +83,10 @@ public:
-     // Polkit will return NULL on failures, hence we use it instead of 0
-     Private(Authority *qq) : q(qq)
-             , pkAuthority(NULL)
--            , m_hasError(false) {}
-+            , m_hasError(false)
-+            , m_systemBus(0)
-+    {
-+    }
- 
-     ~Private();
- 
-@@ -103,6 +106,13 @@ public:
-     bool m_hasError;
-     Authority::ErrorCode m_lastError;
-     QString m_errorDetails;
-+    // Local system bus. QDBusConnection::systemBus() may only be savely used
-+    // inside a QCoreApplication scope as for example destruction of connected
-+    // objects need to happen before the bus disappears. Since this class however
-+    // is a global static and systemBus() internally is a global static we
-+    // cannot assure destruction order. Instead we create a local copy of the
-+    // global systemBus instance so we can make life time to our needs.
-+    // This prevents crashes when cleaning up the global statics.
-     QDBusConnection *m_systemBus;
-     GCancellable *m_checkAuthorizationCancellable,
-     *m_enumerateActionsCancellable,
-@@ -127,6 +137,7 @@ public:
- 
- Authority::Private::~Private()
- {
-+    delete m_systemBus;
-     g_object_unref(m_checkAuthorizationCancellable);
-     g_object_unref(m_enumerateActionsCancellable);
-     g_object_unref(m_registerAuthenticationAgentCancellable);
-@@ -170,6 +181,9 @@ void Authority::Private::init()
- 
-     g_type_init();
- 
-+    m_systemBus = new QDBusConnection(QDBusConnection::connectToBus(QDBusConnection::SystemBus,
-+                                                                    QString("polkit_qt_system_bus")));
-+
-     m_checkAuthorizationCancellable = g_cancellable_new();
-     m_enumerateActionsCancellable = g_cancellable_new();
-     m_registerAuthenticationAgentCancellable = g_cancellable_new();
-@@ -219,7 +233,7 @@ void Authority::Private::init()
- 
-     // then we need to extract all seats from ConsoleKit
-     QDBusMessage msg = QDBusMessage::createMethodCall(consoleKitService, consoleKitManagerPath, consoleKitManagerInterface, "GetSeats");
--    msg = QDBusConnection::systemBus().call(msg);
-+    msg = m_systemBus->call(msg);
-     if (!msg.arguments().isEmpty()) {
-         // this method returns a list with present seats
-         QList<QString> seats;
-@@ -256,8 +270,7 @@ void Authority::Private::seatSignalsConnect(const QString &seat)
- void Authority::Private::dbusSignalAdd(const QString &service, const QString &path, const QString &interface, const QString &name)
- {
-     // FIXME: This code seems to be nonfunctional - it needs to be fixed somewhere (is it Qt BUG?)
--    QDBusConnection::systemBus().connect(service, path, interface, name,
--                                         q, SLOT(dbusFilter(QDBusMessage)));
-+    m_systemBus->connect(service, path, interface, name, q, SLOT(dbusFilter(QDBusMessage)));
- }
- 
- void Authority::Private::dbusFilter(const QDBusMessage &message)

Copied: polkit-qt/repos/staging-x86_64/systembus-usage.patch (from rev 252814, polkit-qt/trunk/systembus-usage.patch)
===================================================================
--- staging-x86_64/systembus-usage.patch	                        (rev 0)
+++ staging-x86_64/systembus-usage.patch	2015-12-06 12:51:24 UTC (rev 252815)
@@ -0,0 +1,79 @@
+commit 88c6e9334c8440721189ef7d020fa94d47f30f8b
+Author: Harald Sitter <sitter at kde.org>
+Date:   Fri Aug 1 16:34:03 2014 +0200
+
+    do not use global static systembus instance
+    
+    global static destruction order cannot be controlled and we need our bus
+    to disconnect from the consolekit signals, so use our own bus instance
+    to connect to systembus signals
+    
+    REVIEW: 119545
+
+diff --git a/core/polkitqt1-authority.cpp b/core/polkitqt1-authority.cpp
+index dd014cf..f25354d 100644
+--- a/core/polkitqt1-authority.cpp
++++ b/core/polkitqt1-authority.cpp
+@@ -83,7 +83,10 @@ public:
+     // Polkit will return NULL on failures, hence we use it instead of 0
+     Private(Authority *qq) : q(qq)
+             , pkAuthority(NULL)
+-            , m_hasError(false) {}
++            , m_hasError(false)
++            , m_systemBus(0)
++    {
++    }
+ 
+     ~Private();
+ 
+@@ -103,6 +106,13 @@ public:
+     bool m_hasError;
+     Authority::ErrorCode m_lastError;
+     QString m_errorDetails;
++    // Local system bus. QDBusConnection::systemBus() may only be savely used
++    // inside a QCoreApplication scope as for example destruction of connected
++    // objects need to happen before the bus disappears. Since this class however
++    // is a global static and systemBus() internally is a global static we
++    // cannot assure destruction order. Instead we create a local copy of the
++    // global systemBus instance so we can make life time to our needs.
++    // This prevents crashes when cleaning up the global statics.
+     QDBusConnection *m_systemBus;
+     GCancellable *m_checkAuthorizationCancellable,
+     *m_enumerateActionsCancellable,
+@@ -127,6 +137,7 @@ public:
+ 
+ Authority::Private::~Private()
+ {
++    delete m_systemBus;
+     g_object_unref(m_checkAuthorizationCancellable);
+     g_object_unref(m_enumerateActionsCancellable);
+     g_object_unref(m_registerAuthenticationAgentCancellable);
+@@ -170,6 +181,9 @@ void Authority::Private::init()
+ 
+     g_type_init();
+ 
++    m_systemBus = new QDBusConnection(QDBusConnection::connectToBus(QDBusConnection::SystemBus,
++                                                                    QString("polkit_qt_system_bus")));
++
+     m_checkAuthorizationCancellable = g_cancellable_new();
+     m_enumerateActionsCancellable = g_cancellable_new();
+     m_registerAuthenticationAgentCancellable = g_cancellable_new();
+@@ -219,7 +233,7 @@ void Authority::Private::init()
+ 
+     // then we need to extract all seats from ConsoleKit
+     QDBusMessage msg = QDBusMessage::createMethodCall(consoleKitService, consoleKitManagerPath, consoleKitManagerInterface, "GetSeats");
+-    msg = QDBusConnection::systemBus().call(msg);
++    msg = m_systemBus->call(msg);
+     if (!msg.arguments().isEmpty()) {
+         // this method returns a list with present seats
+         QList<QString> seats;
+@@ -256,8 +270,7 @@ void Authority::Private::seatSignalsConnect(const QString &seat)
+ void Authority::Private::dbusSignalAdd(const QString &service, const QString &path, const QString &interface, const QString &name)
+ {
+     // FIXME: This code seems to be nonfunctional - it needs to be fixed somewhere (is it Qt BUG?)
+-    QDBusConnection::systemBus().connect(service, path, interface, name,
+-                                         q, SLOT(dbusFilter(QDBusMessage)));
++    m_systemBus->connect(service, path, interface, name, q, SLOT(dbusFilter(QDBusMessage)));
+ }
+ 
+ void Authority::Private::dbusFilter(const QDBusMessage &message)



More information about the arch-commits mailing list