OSDN Git Service

kdeplasma-addons: fix plasmaweather busy timer races
authorIvailo Monev <xakepa10@gmail.com>
Wed, 12 Jul 2023 09:42:53 +0000 (12:42 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 12 Jul 2023 09:42:53 +0000 (12:42 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
kdeplasma-addons/libs/plasmaweather/weatherpopupapplet.cpp

index ea01ebf..f10c638 100644 (file)
@@ -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()