summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/helpwindow.cpp
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/apps/opie-gutenbrowser/helpwindow.cpp
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/apps/opie-gutenbrowser/helpwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/helpwindow.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/noncore/apps/opie-gutenbrowser/helpwindow.cpp b/noncore/apps/opie-gutenbrowser/helpwindow.cpp
index 4bdac02..f444a2e 100644
--- a/noncore/apps/opie-gutenbrowser/helpwindow.cpp
+++ b/noncore/apps/opie-gutenbrowser/helpwindow.cpp
@@ -196,10 +196,11 @@ HelpWindow::~HelpWindow()
history.append( *it );
QFile f( QDir::currentDirPath() + "/.history" );
- f.open( IO_WriteOnly );
+ if ( f.open( IO_WriteOnly ) ) {
QDataStream s( &f );
s << history;
f.close();
+ }
bookmarks.clear();
QMap<int, QString>::Iterator it2 = mBookmarks.begin();
@@ -207,22 +208,14 @@ HelpWindow::~HelpWindow()
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();
}
-// void HelpWindow::about()
-// {
-// QMessageBox::about( this, "Gutenbrowser", "<p>Thanks to Trolltech for this</p>" );
-// }
-
-// void HelpWindow::aboutQt()
-// {
-// QMessageBox::aboutQt( this, "QBrowser" );
-// }
-
void HelpWindow::openFile()
{
#ifndef QT_NO_FILEDIALOG
@@ -292,27 +285,32 @@ void HelpWindow::pathSelected( const QString &_path )
void HelpWindow::readHistory()
{
- if ( QFile::exists( QDir::currentDirPath() + "/.history" ) ) {
+ if ( !QFile::exists( QDir::currentDirPath() + "/.history" ) )
+ return;
+
QFile f( QDir::currentDirPath() + "/.history" );
- f.open( IO_ReadOnly );
+ 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" ) ) {
+ if ( !QFile::exists( QDir::currentDirPath() + "/.bookmarks" ) )
+ return;
+
QFile f( QDir::currentDirPath() + "/.bookmarks" );
- f.open( IO_ReadOnly );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
QDataStream s( &f );
s >> bookmarks;
f.close();
}
-}
void HelpWindow::histChosen( int i )
{