summaryrefslogtreecommitdiff
path: root/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/todayplugins/stockticker/stockticker/helpwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stockticker/helpwindow.cpp12
1 files changed, 8 insertions, 4 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,24 +179,26 @@ HelpWindow::~HelpWindow()
history.clear();
QMap<int, QString>::Iterator it = mHistory.begin();
for ( ; it != mHistory.end(); ++it )
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();
for ( ; it2 != mBookmarks.end(); ++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();
}
void HelpWindow::openFile()
@@ -229,26 +231,28 @@ void HelpWindow::pathSelected( const QString &_path )
}
void HelpWindow::readHistory()
{
if ( QFile::exists( QDir::currentDirPath() + "/.history" ) ) {
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" ) ) {
QFile f( QDir::currentDirPath() + "/.bookmarks" );
- f.open( IO_ReadOnly );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
QDataStream s( &f );
s >> bookmarks;
f.close();
}
}