@@ -92,7 +92,15 @@ QDBusPendingReply<> Offline::trigger(Action action)
9292 };
9393 Q_ASSERT (!actionStr.isEmpty ());
9494
95- return d->iface .Trigger (actionStr);
95+ // Manually invoke dbus because the qdbusxml2cpp does not allow
96+ // setting the ALLOW_INTERACTIVE_AUTHORIZATION flag
97+ auto msg = QDBusMessage::createMethodCall (PK_NAME,
98+ PK_PATH,
99+ PK_OFFLINE_INTERFACE,
100+ QStringLiteral (" Trigger" ));
101+ msg << actionStr;
102+ msg.setInteractiveAuthorizationAllowed (true );
103+ return QDBusConnection::systemBus ().asyncCall (msg);
96104}
97105
98106QDBusPendingReply<> Offline::triggerUpgrade (Action action)
@@ -112,19 +120,39 @@ QDBusPendingReply<> Offline::triggerUpgrade(Action action)
112120 };
113121 Q_ASSERT (!actionStr.isEmpty ());
114122
115- return d->iface .TriggerUpgrade (actionStr);
123+ // Manually invoke dbus because the qdbusxml2cpp does not allow
124+ // setting the ALLOW_INTERACTIVE_AUTHORIZATION flag
125+ auto msg = QDBusMessage::createMethodCall (PK_NAME,
126+ PK_PATH,
127+ PK_OFFLINE_INTERFACE,
128+ QStringLiteral (" TriggerUpgrade" ));
129+ msg << actionStr;
130+ msg.setInteractiveAuthorizationAllowed (true );
131+ return QDBusConnection::systemBus ().asyncCall (msg, 24 * 60 * 1000 * 1000 );
116132}
117133
118134QDBusPendingReply<> Offline::cancel ()
119135{
120- Q_D (Offline);
121- return d->iface .Cancel ();
136+ // Manually invoke dbus because the qdbusxml2cpp does not allow
137+ // setting the ALLOW_INTERACTIVE_AUTHORIZATION flag
138+ auto msg = QDBusMessage::createMethodCall (PK_NAME,
139+ PK_PATH,
140+ PK_OFFLINE_INTERFACE,
141+ QStringLiteral (" Cancel" ));
142+ msg.setInteractiveAuthorizationAllowed (true );
143+ return QDBusConnection::systemBus ().asyncCall (msg);
122144}
123145
124146QDBusPendingReply<> Offline::clearResults ()
125147{
126- Q_D (Offline);
127- return d->iface .ClearResults ();
148+ // Manually invoke dbus because the qdbusxml2cpp does not allow
149+ // setting the ALLOW_INTERACTIVE_AUTHORIZATION flag
150+ auto msg = QDBusMessage::createMethodCall (PK_NAME,
151+ PK_PATH,
152+ PK_OFFLINE_INTERFACE,
153+ QStringLiteral (" ClearResults" ));
154+ msg.setInteractiveAuthorizationAllowed (true );
155+ return QDBusConnection::systemBus ().asyncCall (msg);
128156}
129157
130158void Offline::getPrepared ()
0 commit comments