From 3edb2cc35679a5c3fa45cd6af521d79e20dc077a Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 12 Jul 2023 12:42:53 +0300 Subject: [PATCH] kdeplasma-addons: fix plasmaweather busy timer races Signed-off-by: Ivailo Monev --- .../libs/plasmaweather/weatherpopupapplet.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kdeplasma-addons/libs/plasmaweather/weatherpopupapplet.cpp b/kdeplasma-addons/libs/plasmaweather/weatherpopupapplet.cpp index ea01ebf6..f10c6387 100644 --- a/kdeplasma-addons/libs/plasmaweather/weatherpopupapplet.cpp +++ b/kdeplasma-addons/libs/plasmaweather/weatherpopupapplet.cpp @@ -78,8 +78,8 @@ public: q->setConfigurationRequired(false); } else { busyTimer->stop(); - q->showMessage(QIcon(), QString(), Plasma::ButtonNone); q->setBusy(false); + q->showMessage(QIcon(), QString(), Plasma::ButtonNone); q->setConfigurationRequired(true); } @@ -205,15 +205,16 @@ void WeatherPopupApplet::connectToEngine() connect(d->location, SIGNAL(finished(QString)), this, SLOT(locationReady(QString))); } + d->busyTimer->stop(); + setBusy(false); d->location->setDataEngines(dataEngine(QLatin1String( "geolocation" )), d->weatherEngine); d->location->getDefault(); - setBusy(false); } else { delete d->location; d->location = 0; - d->weatherEngine->connectSource(d->source, this, d->updateInterval * 60 * 1000); - setBusy(true); d->busyTimer->start(); + setBusy(true); + d->weatherEngine->connectSource(d->source, this, d->updateInterval * 60 * 1000); } } @@ -303,8 +304,8 @@ void WeatherPopupApplet::dataUpdated(const QString& source, setAssociatedApplicationUrls(KUrl(data.value(QLatin1String( "Credit Url" )).toString())); d->busyTimer->stop(); - showMessage(QIcon(), QString(), Plasma::ButtonNone); setBusy(false); + showMessage(QIcon(), QString(), Plasma::ButtonNone); } QString WeatherPopupApplet::pressureUnit()