summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/om3u.cpp3
-rw-r--r--libopie2/opiemm/opieexif.cpp8
-rw-r--r--noncore/apps/opie-console/filereceive.cpp4
-rw-r--r--noncore/apps/opie-console/filetransfer.cpp4
-rw-r--r--noncore/apps/opie-console/logger.cpp4
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp3
-rw-r--r--noncore/apps/opie-console/script.cpp6
-rw-r--r--noncore/apps/opie-gutenbrowser/gutenbrowser.cpp6
-rw-r--r--noncore/apps/opie-gutenbrowser/helpwindow.cpp34
-rw-r--r--noncore/graphics/opie-eye/slave/bmp_slave.cpp4
-rw-r--r--noncore/net/ftplib/ftplib.c8
-rw-r--r--noncore/todayplugins/stockticker/stockticker/helpwindow.cpp12
-rw-r--r--noncore/todayplugins/weather/weatherpluginwidget.cpp3
-rw-r--r--noncore/tools/opie-sh/inputdialog.cpp8
14 files changed, 62 insertions, 45 deletions
diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp
index 48aa47e..68ea015 100644
--- a/core/multimedia/opieplayer/om3u.cpp
+++ b/core/multimedia/opieplayer/om3u.cpp
@@ -48,5 +48,6 @@ Om3u::Om3u( const QString &filePath, int mode)
48//odebug << "<<<<<<<new m3u "+filePath << oendl; 48//odebug << "<<<<<<<new m3u "+filePath << oendl;
49 f.setName(filePath); 49 f.setName(filePath);
50 f.open(mode); 50 if ( !f.open(mode) )
51 owarn << "Failed to open file " << f.name() << oendl;
51} 52}
52 53
diff --git a/libopie2/opiemm/opieexif.cpp b/libopie2/opiemm/opieexif.cpp
index de49937..653216c 100644
--- a/libopie2/opiemm/opieexif.cpp
+++ b/libopie2/opiemm/opieexif.cpp
@@ -206,5 +206,5 @@ int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode)
206 unsigned long size; 206 unsigned long size;
207 207
208 size = QMAX( 0ul, infile.size()-infile.at() ); 208 size = infile.size()-infile.at();
209 Data = (uchar *)malloc(size); 209 Data = (uchar *)malloc(size);
210 if (Data == NULL){ 210 if (Data == NULL){
@@ -810,5 +810,9 @@ bool ExifData::scan(const QString & path)
810 810
811 QFile f(path); 811 QFile f(path);
812 f.open(IO_ReadOnly); 812 if ( !f.open(IO_ReadOnly) ) {
813 owarn << "Unable to open file " << f.name() << " readonly" << oendl;
814 DiscardData();
815 return false;
816 }
813 817
814 // Scan the JPEG headers. 818 // Scan the JPEG headers.
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
@@ -4,4 +4,5 @@
4#include <errno.h> 4#include <errno.h>
5 5
6#include <opie2/odebug.h>
6#include <qsocketnotifier.h> 7#include <qsocketnotifier.h>
7 8
@@ -149,5 +150,6 @@ void FileReceive::slotRead() {
149void FileReceive::slotExec() { 150void FileReceive::slotExec() {
150 char buf[2]; 151 char buf[2];
151 ::read(m_term[0], buf, 1 ); 152 if (::read(m_term[0], buf, 1 ) == -1)
153 owarn << "read of m_term[0] failed" << oendl;
152 delete m_proc; 154 delete m_proc;
153 delete m_not; 155 delete m_not;
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
@@ -5,4 +5,5 @@
5#include <unistd.h> 5#include <unistd.h>
6 6
7#include <opie2/odebug.h>
7#include <qsocketnotifier.h> 8#include <qsocketnotifier.h>
8 9
@@ -235,5 +236,6 @@ void FileTransfer::cancel() {
235void FileTransfer::slotExec() { 236void FileTransfer::slotExec() {
236 char buf[2]; 237 char buf[2];
237 ::read(m_term[0], buf, 1 ); 238 if (::read(m_term[0], buf, 1 ) == -1)
239 owarn << "read of m_term[0] failed" << oendl;
238 delete m_proc; 240 delete m_proc;
239 delete m_not; 241 delete m_not;
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
@@ -1,4 +1,5 @@
1#include <qfile.h> 1#include <qfile.h>
2#include <qtextstream.h> 2#include <qtextstream.h>
3#include <opie2/odebug.h>
3 4
4#include "logger.h" 5#include "logger.h"
@@ -9,5 +10,6 @@ Logger::Logger() {}
9Logger::Logger(const QString fileName) { 10Logger::Logger(const QString fileName) {
10 m_file.setName(fileName); 11 m_file.setName(fileName);
11 m_file.open(IO_ReadWrite); 12 if ( !m_file.open(IO_ReadWrite) )
13 owarn << "failed to open " << m_file.name() << oendl;
12} 14}
13 15
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
@@ -825,5 +825,6 @@ void MainWindow::slotSaveHistory() {
825 825
826 QFile file(filename); 826 QFile file(filename);
827 file.open(IO_WriteOnly ); 827 if ( !file.open(IO_WriteOnly ) ) return;
828
828 QTextStream str(&file ); 829 QTextStream str(&file );
829 if ( currentSession() ) 830 if ( currentSession() )
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
@@ -7,5 +7,6 @@ Script::Script() {
7Script::Script(const QString fileName) { 7Script::Script(const QString fileName) {
8 QFile file(fileName); 8 QFile file(fileName);
9 file.open(IO_ReadOnly ); 9 if ( !file.open(IO_ReadOnly ) )
10 return;
10 m_script = file.readAll(); 11 m_script = file.readAll();
11} 12}
@@ -13,5 +14,6 @@ Script::Script(const QString fileName) {
13void Script::saveTo(const QString fileName) const { 14void Script::saveTo(const QString fileName) const {
14 QFile file(fileName); 15 QFile file(fileName);
15 file.open(IO_WriteOnly); 16 if ( !file.open(IO_WriteOnly) )
17 return;
16 file.writeBlock(m_script); 18 file.writeBlock(m_script);
17 file.close(); 19 file.close();
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
@@ -846,11 +846,7 @@ bool Gutenbrowser::load( const char *fileName) {
846 846
847void Gutenbrowser::Search() { 847void Gutenbrowser::Search() {
848
849 // if( searchDlg->isHidden())
850 {
851 odebug << "Starting search dialog" << oendl; 848 odebug << "Starting search dialog" << oendl;
852 searchDlg = new SearchDialog( this, "Etext Search", true); 849 searchDlg = new SearchDialog( this, "Etext Search", true);
853 searchDlg->setCaption( tr( "Etext Search" )); 850 searchDlg->setCaption( tr( "Etext Search" ));
854 // searchDlg->setLabel( "- searches etext");
855 connect( searchDlg,SIGNAL( search_signal()),this,SLOT( search_slot())); 851 connect( searchDlg,SIGNAL( search_signal()),this,SLOT( search_slot()));
856 connect( searchDlg,SIGNAL( search_done_signal()),this,SLOT( searchdone_slot())); 852 connect( searchDlg,SIGNAL( search_done_signal()),this,SLOT( searchdone_slot()));
@@ -860,6 +856,4 @@ void Gutenbrowser::Search() {
860 Lview->deselect(); 856 Lview->deselect();
861 searchDlg->show(); 857 searchDlg->show();
862 searchDlg->result();
863 }
864} 858}
865 859
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
@@ -197,8 +197,9 @@ HelpWindow::~HelpWindow()
197 197
198 QFile f( QDir::currentDirPath() + "/.history" ); 198 QFile f( QDir::currentDirPath() + "/.history" );
199 f.open( IO_WriteOnly ); 199 if ( f.open( IO_WriteOnly ) ) {
200 QDataStream s( &f ); 200 QDataStream s( &f );
201 s << history; 201 s << history;
202 f.close(); 202 f.close();
203 }
203 204
204 bookmarks.clear(); 205 bookmarks.clear();
@@ -208,5 +209,7 @@ HelpWindow::~HelpWindow()
208 209
209 QFile f2( QDir::currentDirPath() + "/.bookmarks" ); 210 QFile f2( QDir::currentDirPath() + "/.bookmarks" );
210 f2.open( IO_WriteOnly ); 211 if ( !f2.open( IO_WriteOnly ) )
212 return;
213
211 QDataStream s2( &f2 ); 214 QDataStream s2( &f2 );
212 s2 << bookmarks; 215 s2 << bookmarks;
@@ -214,14 +217,4 @@ HelpWindow::~HelpWindow()
214} 217}
215 218
216// void HelpWindow::about()
217// {
218// QMessageBox::about( this, "Gutenbrowser", "<p>Thanks to Trolltech for this</p>" );
219// }
220
221// void HelpWindow::aboutQt()
222// {
223// QMessageBox::aboutQt( this, "QBrowser" );
224// }
225
226void HelpWindow::openFile() 219void HelpWindow::openFile()
227{ 220{
@@ -293,7 +286,11 @@ void HelpWindow::pathSelected( const QString &_path )
293void HelpWindow::readHistory() 286void HelpWindow::readHistory()
294{ 287{
295 if ( QFile::exists( QDir::currentDirPath() + "/.history" ) ) { 288 if ( !QFile::exists( QDir::currentDirPath() + "/.history" ) )
289 return;
290
296 QFile f( QDir::currentDirPath() + "/.history" ); 291 QFile f( QDir::currentDirPath() + "/.history" );
297 f.open( IO_ReadOnly ); 292 if ( !f.open( IO_ReadOnly ) )
293 return;
294
298 QDataStream s( &f ); 295 QDataStream s( &f );
299 s >> history; 296 s >> history;
@@ -302,16 +299,17 @@ void HelpWindow::readHistory()
302 history.remove( history.begin() ); 299 history.remove( history.begin() );
303 } 300 }
304}
305 301
306void HelpWindow::readBookmarks() 302void HelpWindow::readBookmarks()
307{ 303{
308 if ( QFile::exists( QDir::currentDirPath() + "/.bookmarks" ) ) { 304 if ( !QFile::exists( QDir::currentDirPath() + "/.bookmarks" ) )
305 return;
306
309 QFile f( QDir::currentDirPath() + "/.bookmarks" ); 307 QFile f( QDir::currentDirPath() + "/.bookmarks" );
310 f.open( IO_ReadOnly ); 308 if ( !f.open( IO_ReadOnly ) )
309 return;
311 QDataStream s( &f ); 310 QDataStream s( &f );
312 s >> bookmarks; 311 s >> bookmarks;
313 f.close(); 312 f.close();
314 } 313 }
315}
316 314
317void HelpWindow::histChosen( int i ) 315void HelpWindow::histChosen( int i )
diff --git a/noncore/graphics/opie-eye/slave/bmp_slave.cpp b/noncore/graphics/opie-eye/slave/bmp_slave.cpp
index 2fa825f..0efadac 100644
--- a/noncore/graphics/opie-eye/slave/bmp_slave.cpp
+++ b/noncore/graphics/opie-eye/slave/bmp_slave.cpp
@@ -83,8 +83,6 @@ namespace {
83 void BmpHeader::read_data() { 83 void BmpHeader::read_data() {
84 memset(&m_Header,0,sizeof(pBmpHeader)); 84 memset(&m_Header,0,sizeof(pBmpHeader));
85 _inputfile.open(IO_Raw|IO_ReadOnly); 85 if (!_inputfile.open(IO_Raw|IO_ReadOnly))
86 if (!_inputfile.isOpen()) {
87 return; 86 return;
88 }
89 QDataStream s(&_inputfile); 87 QDataStream s(&_inputfile);
90 s.setByteOrder( QDataStream::LittleEndian ); 88 s.setByteOrder( QDataStream::LittleEndian );
diff --git a/noncore/net/ftplib/ftplib.c b/noncore/net/ftplib/ftplib.c
index 421f855..efcd6f0 100644
--- a/noncore/net/ftplib/ftplib.c
+++ b/noncore/net/ftplib/ftplib.c
@@ -959,5 +959,6 @@ GLOBALDEF int FtpWrite(void *buf, int len, netbuf *nData)
959 else 959 else
960 { 960 {
961 socket_wait(nData); 961 if (socket_wait(nData) < 0)
962 fprintf(stderr, "FtpWrite: socket_wait failed with %s\n", nData->ctrl->response);
962 i = net_write(nData->handle, buf, len); 963 i = net_write(nData->handle, buf, len);
963 } 964 }
@@ -1340,5 +1341,8 @@ GLOBALDEF void FtpQuit(netbuf *nControl)
1340 if (nControl->dir != FTPLIB_CONTROL) 1341 if (nControl->dir != FTPLIB_CONTROL)
1341 return; 1342 return;
1342 FtpSendCmd("QUIT",'2',nControl); 1343 if (FtpSendCmd("QUIT",'2',nControl) == 1) {
1344 if (ftplib_debug > 2)
1345 fprintf(stderr, "FtpQuit: FtpSendCmd(QUIT) failed\n");
1346 }
1343 net_close(nControl->handle); 1347 net_close(nControl->handle);
1344 free(nControl->buf); 1348 free(nControl->buf);
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
@@ -183,8 +183,9 @@ HelpWindow::~HelpWindow()
183 183
184 QFile f( QDir::currentDirPath() + "/.history" ); 184 QFile f( QDir::currentDirPath() + "/.history" );
185 f.open( IO_WriteOnly ); 185 if ( f.open( IO_WriteOnly ) ) {
186 QDataStream s( &f ); 186 QDataStream s( &f );
187 s << history; 187 s << history;
188 f.close(); 188 f.close();
189 }
189 190
190 bookmarks.clear(); 191 bookmarks.clear();
@@ -194,5 +195,6 @@ HelpWindow::~HelpWindow()
194 195
195 QFile f2( QDir::currentDirPath() + "/.bookmarks" ); 196 QFile f2( QDir::currentDirPath() + "/.bookmarks" );
196 f2.open( IO_WriteOnly ); 197 if ( !f2.open( IO_WriteOnly ) )
198 return;
197 QDataStream s2( &f2 ); 199 QDataStream s2( &f2 );
198 s2 << bookmarks; 200 s2 << bookmarks;
@@ -233,5 +235,6 @@ void HelpWindow::readHistory()
233 if ( QFile::exists( QDir::currentDirPath() + "/.history" ) ) { 235 if ( QFile::exists( QDir::currentDirPath() + "/.history" ) ) {
234 QFile f( QDir::currentDirPath() + "/.history" ); 236 QFile f( QDir::currentDirPath() + "/.history" );
235 f.open( IO_ReadOnly ); 237 if ( !f.open( IO_ReadOnly ) )
238 return;
236 QDataStream s( &f ); 239 QDataStream s( &f );
237 s >> history; 240 s >> history;
@@ -246,5 +249,6 @@ void HelpWindow::readBookmarks()
246 if ( QFile::exists( QDir::currentDirPath() + "/.bookmarks" ) ) { 249 if ( QFile::exists( QDir::currentDirPath() + "/.bookmarks" ) ) {
247 QFile f( QDir::currentDirPath() + "/.bookmarks" ); 250 QFile f( QDir::currentDirPath() + "/.bookmarks" );
248 f.open( IO_ReadOnly ); 251 if ( !f.open( IO_ReadOnly ) )
252 return;
249 QDataStream s( &f ); 253 QDataStream s( &f );
250 s >> bookmarks; 254 s >> bookmarks;
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
@@ -105,5 +105,6 @@ void WeatherPluginWidget::retreiveData()
105 *proc << "wget" << "-q" << remoteFile << "-O" << localFile; 105 *proc << "wget" << "-q" << remoteFile << "-O" << localFile;
106 connect( proc, SIGNAL( processExited(Opie::Core::OProcess*) ), this, SLOT( dataRetrieved(Opie::Core::OProcess*) ) ); 106 connect( proc, SIGNAL( processExited(Opie::Core::OProcess*) ), this, SLOT( dataRetrieved(Opie::Core::OProcess*) ) );
107 proc->start(); 107 if ( !proc->start() )
108 weatherLabel->setText( tr( "Could not start wget process." ) );
108} 109}
109 110
diff --git a/noncore/tools/opie-sh/inputdialog.cpp b/noncore/tools/opie-sh/inputdialog.cpp
index 8046795..1dd8bf7 100644
--- a/noncore/tools/opie-sh/inputdialog.cpp
+++ b/noncore/tools/opie-sh/inputdialog.cpp
@@ -41,5 +41,6 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString
41 { 41 {
42 QFile file(filename); 42 QFile file(filename);
43 file.open(IO_ReadOnly); 43 if (file.open(IO_ReadOnly))
44 {
44 QTextStream stream(&file); 45 QTextStream stream(&file);
45 QString string = stream.read(); 46 QString string = stream.read();
@@ -47,4 +48,5 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString
47 comboBox->insertStringList(QStringList::split('\n', string)); 48 comboBox->insertStringList(QStringList::split('\n', string));
48 } 49 }
50 }
49 else 51 else
50 { 52 {
@@ -64,5 +66,6 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString
64 { 66 {
65 QFile file(filename); 67 QFile file(filename);
66 file.open(IO_ReadOnly); 68 if (file.open(IO_ReadOnly))
69 {
67 QTextStream stream(&file); 70 QTextStream stream(&file);
68 QString string = stream.read(); 71 QString string = stream.read();
@@ -70,4 +73,5 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString
70 listBox->insertStringList(QStringList::split('\n', string)); 73 listBox->insertStringList(QStringList::split('\n', string));
71 } 74 }
75 }
72 else 76 else
73 { 77 {