summaryrefslogtreecommitdiff
path: root/noncore/todayplugins/weather/weatherpluginwidget.cpp
Side-by-side diff
Diffstat (limited to 'noncore/todayplugins/weather/weatherpluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/weather/weatherpluginwidget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/todayplugins/weather/weatherpluginwidget.cpp b/noncore/todayplugins/weather/weatherpluginwidget.cpp
index 15d1c6e..ad99a43 100644
--- a/noncore/todayplugins/weather/weatherpluginwidget.cpp
+++ b/noncore/todayplugins/weather/weatherpluginwidget.cpp
@@ -24,25 +24,25 @@
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qfile.h>
#include <qimage.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpixmap.h>
#include <qtextstream.h>
-#include <opie/oprocess.h>
+#include <opie2/oprocess.h>
#include <qpe/config.h>
#include <qpe/resource.h>
#include "weatherpluginwidget.h"
WeatherPluginWidget::WeatherPluginWidget( QWidget *parent, const char* name )
: QWidget( parent, name )
{
QHBoxLayout *layout = new QHBoxLayout( this );
layout->setAutoAdd( TRUE );
layout->setSpacing( 2 );
@@ -76,25 +76,25 @@ void WeatherPluginWidget::timerEvent( QTimerEvent *e )
}
void WeatherPluginWidget::retreiveData()
{
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() )
@@ -105,25 +105,25 @@ void WeatherPluginWidget::retreiveData()
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;
QFile file( localFile );
-
+
if ( file.size() > 0 && file.open( IO_ReadOnly ) )
{
QTextStream data( &file );
while ( !data.eof() )
{
weatherData.append( data.readLine() );
}
file.close();
weatherData = weatherData.simplifyWhiteSpace();
QString tmpstr;