[SCM] Polkit Qt 1 packaging branch, experimental, updated. debian/0.95.1-1-63-g70a4b59
Maximiliano Curia
maxy at moszumanska.debian.org
Sun Jan 25 17:53:36 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-req/polkit-qt-1.git;a=commitdiff;h=9bca3fb
The following commit has been merged in the experimental branch:
commit 9bca3fb2337580ec5b7b85efaf529fe24c340571
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date: Sun Jan 25 17:58:08 2015 +0100
Import patches from kubuntu
---
debian/patches/series | 2 +
.../upstream_Do_not_use_static_instancebus.patch | 79 ++++++++++++++++++++++
...ith-Qt4-which-doesn-t-have-QStringLiteral.patch | 26 +++++++
3 files changed, 107 insertions(+)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..50c08b1
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+upstream_Do_not_use_static_instancebus.patch
+upstream_fix-build-with-Qt4-which-doesn-t-have-QStringLiteral.patch
diff --git a/debian/patches/upstream_Do_not_use_static_instancebus.patch b/debian/patches/upstream_Do_not_use_static_instancebus.patch
new file mode 100644
index 0000000..9464487
--- /dev/null
+++ b/debian/patches/upstream_Do_not_use_static_instancebus.patch
@@ -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,
++ QStringLiteral("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)
diff --git a/debian/patches/upstream_fix-build-with-Qt4-which-doesn-t-have-QStringLiteral.patch b/debian/patches/upstream_fix-build-with-Qt4-which-doesn-t-have-QStringLiteral.patch
new file mode 100644
index 0000000..4f8521d
--- /dev/null
+++ b/debian/patches/upstream_fix-build-with-Qt4-which-doesn-t-have-QStringLiteral.patch
@@ -0,0 +1,26 @@
+From 3882e11e29f5d56b03d7b84dc14a358ad2477e8d Mon Sep 17 00:00:00 2001
+From: Allen Winter <winter at kde.org>
+Date: Sat, 2 Aug 2014 10:32:53 -0400
+Subject: [PATCH] fix build with Qt4, which doesn't have QStringLiteral. so use
+ QString instead.
+
+---
+ core/polkitqt1-authority.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/core/polkitqt1-authority.cpp b/core/polkitqt1-authority.cpp
+index f25354d..155493e 100644
+--- a/core/polkitqt1-authority.cpp
++++ b/core/polkitqt1-authority.cpp
+@@ -182,7 +182,7 @@ void Authority::Private::init()
+ g_type_init();
+
+ m_systemBus = new QDBusConnection(QDBusConnection::connectToBus(QDBusConnection::SystemBus,
+- QStringLiteral("polkit_qt_system_bus")));
++ QString("polkit_qt_system_bus")));
+
+ m_checkAuthorizationCancellable = g_cancellable_new();
+ m_enumerateActionsCancellable = g_cancellable_new();
+--
+2.0.1
+
--
Polkit Qt 1 packaging
More information about the pkg-kde-commits
mailing list