diff --git a/src/gui/updater/sparkleupdater.h b/src/gui/updater/sparkleupdater.h index c736763e0a..c5d6ea9111 100644 --- a/src/gui/updater/sparkleupdater.h +++ b/src/gui/updater/sparkleupdater.h @@ -45,6 +45,8 @@ signals: private: std::unique_ptr _interface; + QString _statusString; + friend class SparkleInterface; }; } // namespace OCC diff --git a/src/gui/updater/sparkleupdater_mac.mm b/src/gui/updater/sparkleupdater_mac.mm index 61380974e0..c02397f650 100644 --- a/src/gui/updater/sparkleupdater_mac.mm +++ b/src/gui/updater/sparkleupdater_mac.mm @@ -38,8 +38,9 @@ public: [delegate release]; } - void statusChanged() + void statusChanged(const QString &statusString) { + q->_statusString = statusString; emit q->statusChanged(); } @@ -78,9 +79,10 @@ private: return YES; } -- (void)notifyChange +- (void)notifyChange:(const QString&)statusString { - _owner->statusChanged(); + qCDebug(OCC::lcUpdater) << statusString; + _owner->statusChanged(statusString); } // Sent when a valid update is found by the update driver. @@ -88,16 +90,14 @@ private: { Q_UNUSED(updater) Q_UNUSED(update) - qCDebug(OCC::lcUpdater) << "Found a valid update."; - [self notifyChange]; + [self notifyChange:QStringLiteral("Found a valid update.")]; } // Sent when a valid update is not found. - (void)updaterDidNotFindUpdate:(SUUpdater *)update { Q_UNUSED(update) - qCDebug(OCC::lcUpdater) << "No valid update found."; - [self notifyChange]; + [self notifyChange:QStringLiteral("No valid update found.")]; } // Sent immediately before installing the specified update. @@ -105,24 +105,21 @@ private: { Q_UNUSED(updater) Q_UNUSED(update) - qCDebug(OCC::lcUpdater) << "About to install update."; - [self notifyChange]; + [self notifyChange:QStringLiteral("About to install update.")]; } - (void)updater:(SUUpdater *)updater didAbortWithError:(NSError *)error { Q_UNUSED(updater) - qCDebug(OCC::lcUpdater) << error.description; - [self notifyChange]; + const QString message(QStringLiteral("Aborted with error: ") + QString::fromNSString(error.description)); + [self notifyChange:message]; } - (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast { Q_UNUSED(updater) Q_UNUSED(appcast) - - qCDebug(OCC::lcUpdater) << "Finished loading appcast."; - [self notifyChange]; + [self notifyChange:QStringLiteral("Finished loading appcast.")]; } @@ -200,8 +197,7 @@ void SparkleUpdater::backgroundCheckForUpdate() QString SparkleUpdater::statusString() { - // FIXME Show the real state depending on the callbacks - return QString(); + return _statusString; } } // namespace OCC