summaryrefslogtreecommitdiff
path: root/noncore/todayplugins
authorerik <erik>2007-01-22 22:56:12 (UTC)
committer erik <erik>2007-01-22 22:56:12 (UTC)
commit9b4871054d01a47b4c546952a0948553413840d6 (patch) (side-by-side diff)
tree4e0248489c2790cf4225a116cfb903b637d4cdf0 /noncore/todayplugins
parentf60301bab1f8aa3693089036a3791a01ae6f9db8 (diff)
downloadopie-9b4871054d01a47b4c546952a0948553413840d6.zip
opie-9b4871054d01a47b4c546952a0948553413840d6.tar.gz
opie-9b4871054d01a47b4c546952a0948553413840d6.tar.bz2
Every file in this commit makes a call to a function which returns a value.
Each file also didn't check the return value. This commit changes it so that every single non-checked call in these files is checked.
Diffstat (limited to 'noncore/todayplugins') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stockticker/helpwindow.cpp42
-rw-r--r--noncore/todayplugins/weather/weatherpluginwidget.cpp5
2 files changed, 26 insertions, 21 deletions
diff --git a/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp b/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp
index 410d642..2498bf9 100644
--- a/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp
+++ b/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp
@@ -179,21 +179,23 @@ HelpWindow::~HelpWindow()
history.clear();
QMap<int, QString>::Iterator it = mHistory.begin();
for ( ; it != mHistory.end(); ++it )
- history.append( *it );
+ history.append( *it );
QFile f( QDir::currentDirPath() + "/.history" );
- f.open( IO_WriteOnly );
- QDataStream s( &f );
- s << history;
- f.close();
+ if ( f.open( IO_WriteOnly ) ) {
+ QDataStream s( &f );
+ s << history;
+ f.close();
+ }
bookmarks.clear();
QMap<int, QString>::Iterator it2 = mBookmarks.begin();
for ( ; it2 != mBookmarks.end(); ++it2 )
- bookmarks.append( *it2 );
+ bookmarks.append( *it2 );
QFile f2( QDir::currentDirPath() + "/.bookmarks" );
- f2.open( IO_WriteOnly );
+ if ( !f2.open( IO_WriteOnly ) )
+ return;
QDataStream s2( &f2 );
s2 << bookmarks;
f2.close();
@@ -231,24 +233,26 @@ void HelpWindow::pathSelected( const QString &_path )
void HelpWindow::readHistory()
{
if ( QFile::exists( QDir::currentDirPath() + "/.history" ) ) {
- QFile f( QDir::currentDirPath() + "/.history" );
- f.open( IO_ReadOnly );
- QDataStream s( &f );
- s >> history;
- f.close();
- while ( history.count() > 20 )
- history.remove( history.begin() );
+ QFile f( QDir::currentDirPath() + "/.history" );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ QDataStream s( &f );
+ s >> history;
+ f.close();
+ while ( history.count() > 20 )
+ history.remove( history.begin() );
}
}
void HelpWindow::readBookmarks()
{
if ( QFile::exists( QDir::currentDirPath() + "/.bookmarks" ) ) {
- QFile f( QDir::currentDirPath() + "/.bookmarks" );
- f.open( IO_ReadOnly );
- QDataStream s( &f );
- s >> bookmarks;
- f.close();
+ QFile f( QDir::currentDirPath() + "/.bookmarks" );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ QDataStream s( &f );
+ s >> bookmarks;
+ f.close();
}
}
diff --git a/noncore/todayplugins/weather/weatherpluginwidget.cpp b/noncore/todayplugins/weather/weatherpluginwidget.cpp
index fe54051..27624c5 100644
--- a/noncore/todayplugins/weather/weatherpluginwidget.cpp
+++ b/noncore/todayplugins/weather/weatherpluginwidget.cpp
@@ -104,7 +104,8 @@ void WeatherPluginWidget::retreiveData()
*proc << "wget" << "-q" << remoteFile << "-O" << localFile;
connect( proc, SIGNAL( processExited(Opie::Core::OProcess*) ), this, SLOT( dataRetrieved(Opie::Core::OProcess*) ) );
- proc->start();
+ if ( !proc->start() )
+ weatherLabel->setText( tr( "Could not start wget process." ) );
}
void WeatherPluginWidget::displayWeather()
@@ -142,7 +143,7 @@ void WeatherPluginWidget::displayWeather()
tmpstr = "todayweatherplugin/";
getIcon( weatherData );
tmpstr.append( dataStr );
- weatherIcon->setPixmap( Opie::Core::OResource::loadPixmap( tmpstr, Opie::Core::OResource::SmallIcon ) );
+ weatherIcon->setPixmap( Opie::Core::OResource::loadPixmap( tmpstr, Opie::Core::OResource::SmallIcon ) );
}
else
{