You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.6 KiB
41 lines
1.6 KiB
9 years ago
|
From fb1667ac9a5437b4784d2806a3e816cbdbe404a5 Mon Sep 17 00:00:00 2001
|
||
|
From: Alex Richardson <arichardson.kde@gmail.com>
|
||
|
Date: Thu, 7 Jan 2016 13:37:42 +0000
|
||
|
Subject: [PATCH 3/8] Fix QDBusArgument assertion
|
||
|
|
||
|
On my system kded5 crashes with the assertion
|
||
|
"QDBusArgument: read from a write-only object" otherwise
|
||
|
---
|
||
|
core/polkitqt1-authority.cpp | 14 ++++++++++----
|
||
|
1 file changed, 10 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/core/polkitqt1-authority.cpp b/core/polkitqt1-authority.cpp
|
||
|
index 155493e..efa8271 100644
|
||
|
--- a/core/polkitqt1-authority.cpp
|
||
|
+++ b/core/polkitqt1-authority.cpp
|
||
|
@@ -233,11 +233,17 @@ void Authority::Private::init()
|
||
|
|
||
|
// then we need to extract all seats from ConsoleKit
|
||
|
QDBusMessage msg = QDBusMessage::createMethodCall(consoleKitService, consoleKitManagerPath, consoleKitManagerInterface, "GetSeats");
|
||
|
- msg = m_systemBus->call(msg);
|
||
|
- if (!msg.arguments().isEmpty()) {
|
||
|
+ const QDBusMessage reply = m_systemBus->call(msg);
|
||
|
+
|
||
|
+ if (reply.type() != QDBusMessage::ErrorMessage && !reply.arguments().isEmpty()) {
|
||
|
// this method returns a list with present seats
|
||
|
- QList<QString> seats;
|
||
|
- qVariantValue<QDBusArgument> (msg.arguments()[0]) >> seats;
|
||
|
+ QStringList seats;
|
||
|
+ QVariant arg = reply.arguments()[0];
|
||
|
+ if (arg.type() == qMetaTypeId<QDBusArgument>()) {
|
||
|
+ arg.value<QDBusArgument>() >> seats;
|
||
|
+ } else {
|
||
|
+ seats = arg.toStringList();
|
||
|
+ }
|
||
|
// it can be multiple seats present so connect all their signals
|
||
|
Q_FOREACH(const QString &seat, seats) {
|
||
|
seatSignalsConnect(seat);
|
||
|
--
|
||
|
2.5.0
|
||
|
|