summaryrefslogtreecommitdiff
path: root/noncore/todayplugins/weather
Side-by-side diff
Diffstat (limited to 'noncore/todayplugins/weather') (more/less context) (show whitespace changes)
-rw-r--r--noncore/todayplugins/weather/weatherpluginwidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/todayplugins/weather/weatherpluginwidget.cpp b/noncore/todayplugins/weather/weatherpluginwidget.cpp
index 6444ebf..f4ea0f2 100644
--- a/noncore/todayplugins/weather/weatherpluginwidget.cpp
+++ b/noncore/todayplugins/weather/weatherpluginwidget.cpp
@@ -58,57 +58,57 @@ WeatherPluginWidget::WeatherPluginWidget( QWidget *parent, const char* name )
weatherLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
startTimer(1000);
}
WeatherPluginWidget::~WeatherPluginWidget()
{
QFile file( localFile );
if ( file.exists() )
{
file.remove();
}
}
void WeatherPluginWidget::timerEvent( QTimerEvent *e )
{
killTimer( e->timerId() );
retreiveData();
}
void WeatherPluginWidget::retreiveData()
{
- startTimer( frequency * 60000 );
-
Config config( "todayweatherplugin");
config.setGroup( "Config" );
location = config.readEntry( "Location", "" );
useMetric = config.readBoolEntry( "Metric", TRUE );
frequency = config.readNumEntry( "Frequency", 5 );
+ startTimer( frequency * 60000 );
+
localFile = "/tmp/";
localFile.append( location );
localFile.append( ".TXT" );
remoteFile = "http://weather.noaa.gov/pub/data/observations/metar/stations/";
remoteFile.append( location );
remoteFile.append( ".TXT" );
QFile file( localFile );
if ( file.exists() )
{
file.remove();
}
OProcess *proc = new OProcess;
*proc << "wget" << "-q" << remoteFile << "-O" << localFile;
connect( proc, SIGNAL( processExited( OProcess * ) ), this, SLOT( dataRetrieved( OProcess * ) ) );
proc->start();
}
void WeatherPluginWidget::displayWeather()
{
weatherData = QString::null;