@@ -99,25 +99,25 @@ Offline::Action Offline::triggerAction() const
9999bool Offline::updatePrepared () const
100100{
101101 Q_D (const Offline);
102- return d->updatePrepared ;
102+ return d->m_properties [ QLatin1StringView ( " UpdatePrepared " )] ;
103103}
104104
105105bool Offline::updateTriggered () const
106106{
107107 Q_D (const Offline);
108- return d->updateTriggered ;
108+ return d->m_properties [ QLatin1StringView ( " UpdateTriggered " )] ;
109109}
110110
111111bool Offline::upgradePrepared () const
112112{
113113 Q_D (const Offline);
114- return d->upgradePrepared ;
114+ return d->m_properties [ QLatin1StringView ( " UpgradePrepared " )] ;
115115}
116116
117117bool Offline::upgradeTriggered () const
118118{
119119 Q_D (const Offline);
120- return d->upgradeTriggered ;
120+ return d->m_properties [ QLatin1StringView ( " UpgradeTriggered " )] ;
121121}
122122
123123QDBusPendingReply<> Offline::trigger (Action action)
@@ -249,24 +249,12 @@ void OfflinePrivate::initializeProperties(const QVariantMap &properties)
249249 } else {
250250 triggerAction = Offline::ActionUnset;
251251 }
252- } else if (property == QLatin1String (" UpdatePrepared" )) {
253- updatePrepared = value.toBool ();
254- } else if (property == QLatin1String (" UpdateTriggered" )) {
255- updateTriggered = value.toBool ();
256- } else if (property == QLatin1String (" UpgradePrepared" )) {
257- upgradePrepared = value.toBool ();
258- } else if (property == QLatin1String (" UpgradeTriggered" )) {
259- upgradeTriggered = value.toBool ();
260252 } else {
261- qCWarning (PACKAGEKITQT_OFFLINE) << " Unknown property: " << property << value;
253+ m_properties[ property] = value. toBool () ;
262254 }
263255
264256 ++it;
265257 }
266-
267- if (!properties.isEmpty ()) {
268- q->changed ();
269- }
270258}
271259
272260void OfflinePrivate::updateProperties (const QString &interface, const QVariantMap &properties, const QStringList &invalidate)
@@ -276,11 +264,25 @@ void OfflinePrivate::updateProperties(const QString &interface, const QVariantMa
276264 return ;
277265 }
278266
279- if (!invalidate.isEmpty ()) {
280- qCWarning (PACKAGEKITQT_OFFLINE) << " Properties could not be invalidated" << interface << invalidate;
267+ bool invalidations = false ;
268+ for (const QString &property : invalidate) {
269+ invalidations = true ;
270+
271+ if (property == QLatin1String (" PreparedUpgrade" )) {
272+ preparedUpgrade.clear ();
273+ } else if (property == QLatin1String (" TriggerAction" )) {
274+ triggerAction = Offline::ActionUnset;
275+ } else {
276+ m_properties.remove (property);
277+ }
281278 }
282279
283280 initializeProperties (properties);
281+
282+ if (invalidations || !properties.isEmpty ()) {
283+ Q_Q (Offline);
284+ q->changed ();
285+ }
284286}
285287
286288#include " moc_offline.cpp"
0 commit comments