-rw-r--r-- | noncore/apps/opie-console/filereceive.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/filetransfer.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/logger.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/script.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-gutenbrowser/helpwindow.cpp | 34 |
7 files changed, 31 insertions, 30 deletions
diff --git a/noncore/apps/opie-console/filereceive.cpp b/noncore/apps/opie-console/filereceive.cpp index 452be60..41e6888 100644 --- a/noncore/apps/opie-console/filereceive.cpp +++ b/noncore/apps/opie-console/filereceive.cpp @@ -5,2 +5,3 @@ +#include <opie2/odebug.h> #include <qsocketnotifier.h> @@ -150,3 +151,4 @@ void FileReceive::slotExec() { char buf[2]; - ::read(m_term[0], buf, 1 ); + if (::read(m_term[0], buf, 1 ) == -1) + owarn << "read of m_term[0] failed" << oendl; delete m_proc; diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp index 7eebc65..6e2d2d5 100644 --- a/noncore/apps/opie-console/filetransfer.cpp +++ b/noncore/apps/opie-console/filetransfer.cpp @@ -6,2 +6,3 @@ +#include <opie2/odebug.h> #include <qsocketnotifier.h> @@ -236,3 +237,4 @@ void FileTransfer::slotExec() { char buf[2]; - ::read(m_term[0], buf, 1 ); + if (::read(m_term[0], buf, 1 ) == -1) + owarn << "read of m_term[0] failed" << oendl; delete m_proc; diff --git a/noncore/apps/opie-console/logger.cpp b/noncore/apps/opie-console/logger.cpp index 6620faf..0fdeca0 100644 --- a/noncore/apps/opie-console/logger.cpp +++ b/noncore/apps/opie-console/logger.cpp @@ -2,2 +2,3 @@ #include <qtextstream.h> +#include <opie2/odebug.h> @@ -10,3 +11,4 @@ Logger::Logger(const QString fileName) { m_file.setName(fileName); - m_file.open(IO_ReadWrite); + if ( !m_file.open(IO_ReadWrite) ) + owarn << "failed to open " << m_file.name() << oendl; } diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 18c0434..aba7244 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -826,3 +826,4 @@ void MainWindow::slotSaveHistory() { QFile file(filename); - file.open(IO_WriteOnly ); + if ( !file.open(IO_WriteOnly ) ) return; + QTextStream str(&file ); diff --git a/noncore/apps/opie-console/script.cpp b/noncore/apps/opie-console/script.cpp index faea412..8d35776 100644 --- a/noncore/apps/opie-console/script.cpp +++ b/noncore/apps/opie-console/script.cpp @@ -8,3 +8,4 @@ Script::Script(const QString fileName) { QFile file(fileName); - file.open(IO_ReadOnly ); + if ( !file.open(IO_ReadOnly ) ) + return; m_script = file.readAll(); @@ -14,3 +15,4 @@ void Script::saveTo(const QString fileName) const { QFile file(fileName); - file.open(IO_WriteOnly); + if ( !file.open(IO_WriteOnly) ) + return; file.writeBlock(m_script); diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp index 733db17..8b02f9f 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp +++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp @@ -847,5 +847,2 @@ bool Gutenbrowser::load( const char *fileName) { void Gutenbrowser::Search() { - - // if( searchDlg->isHidden()) - { odebug << "Starting search dialog" << oendl; @@ -853,3 +850,2 @@ void Gutenbrowser::Search() { searchDlg->setCaption( tr( "Etext Search" )); - // searchDlg->setLabel( "- searches etext"); connect( searchDlg,SIGNAL( search_signal()),this,SLOT( search_slot())); @@ -861,4 +857,2 @@ void Gutenbrowser::Search() { searchDlg->show(); - searchDlg->result(); - } } 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 @@ -198,3 +198,3 @@ HelpWindow::~HelpWindow() QFile f( QDir::currentDirPath() + "/.history" ); - f.open( IO_WriteOnly ); + if ( f.open( IO_WriteOnly ) ) { QDataStream s( &f ); @@ -202,2 +202,3 @@ HelpWindow::~HelpWindow() f.close(); + } @@ -209,3 +210,5 @@ HelpWindow::~HelpWindow() QFile f2( QDir::currentDirPath() + "/.bookmarks" ); - f2.open( IO_WriteOnly ); + if ( !f2.open( IO_WriteOnly ) ) + return; + QDataStream s2( &f2 ); @@ -215,12 +218,2 @@ HelpWindow::~HelpWindow() -// void HelpWindow::about() -// { -// QMessageBox::about( this, "Gutenbrowser", "<p>Thanks to Trolltech for this</p>" ); -// } - -// void HelpWindow::aboutQt() -// { -// QMessageBox::aboutQt( this, "QBrowser" ); -// } - void HelpWindow::openFile() @@ -294,5 +287,9 @@ 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 ); @@ -303,3 +300,2 @@ void HelpWindow::readHistory() } -} @@ -307,5 +303,8 @@ 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 ); @@ -314,3 +313,2 @@ void HelpWindow::readBookmarks() } -} |