summaryrefslogtreecommitdiffstats
path: root/kweather
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2021-08-29 09:59:59 +0000
committerMavridis Philippe <mavridisf@gmail.com>2021-08-29 10:19:05 +0000
commit1d50e6fa93cf2f8ea01115641c20d64fc2224690 (patch)
tree65e5651cef4db8be49ae18f48c867809198cf390 /kweather
parent8d99f539b8a8b43877973c8cabb9c44d9da01e36 (diff)
downloadtdetoys-1d50e6fa93cf2f8ea01115641c20d64fc2224690.tar.gz
tdetoys-1d50e6fa93cf2f8ea01115641c20d64fc2224690.zip
KWeather Sidebar: timer fixes
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com> (cherry picked from commit 47ea2b84cdae64f9569cf961d0b46d50ff9eadb2)
Diffstat (limited to 'kweather')
-rw-r--r--kweather/weatherbar.cpp16
-rw-r--r--kweather/weatherbar.h2
2 files changed, 8 insertions, 10 deletions
diff --git a/kweather/weatherbar.cpp b/kweather/weatherbar.cpp
index b06bbd8..f191358 100644
--- a/kweather/weatherbar.cpp
+++ b/kweather/weatherbar.cpp
@@ -63,7 +63,9 @@ KonqSidebarWeather::KonqSidebarWeather(TDEInstance* inst, TQObject* parent,
kdDebug() << "attached dcop signals..." << endl;
timeOut = new TQTimer(this, "timeOut" );
- updateWidgets(true);
+ connect(timeOut, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateWidgets()));
+
+ updateWidgets();
}
@@ -114,10 +116,12 @@ void KonqSidebarWeather::handlePreviewOnMouseOver(const KFileItem& item)
{
}
-void KonqSidebarWeather::updateWidgets( bool firstTime )
+void KonqSidebarWeather::updateWidgets()
{
kdDebug() << "updating station widgets" << endl;
+
timeOut->stop();
+
DCOPRef dcopCall( "KWeatherService", "WeatherService" );
DCOPReply reply = dcopCall.call("listStations()", true );
@@ -173,13 +177,7 @@ void KonqSidebarWeather::updateWidgets( bool firstTime )
KMessageBox::sorry(0, i18n("The weather service is unreachable!"));
}
- if( firstTime )
- timeOut->start(15*60000);
- else
- {
- timeOut->changeInterval(15*60000);
- connect(timeOut, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateWidgets()));
- }
+ timeOut->start(15*60000);
}
bool KonqSidebarWeather::startWeatherService()
diff --git a/kweather/weatherbar.h b/kweather/weatherbar.h
index 8607d59..eca74d6 100644
--- a/kweather/weatherbar.h
+++ b/kweather/weatherbar.h
@@ -53,7 +53,7 @@ public:
virtual void refresh(TQString);
public slots:
- virtual void updateWidgets( bool firstTime = false );
+ virtual void updateWidgets();
protected:
virtual void handleURL(const KURL &url);