summaryrefslogtreecommitdiff
path: root/noncore/apps
Unidiff
Diffstat (limited to 'noncore/apps') (more/less context) (show whitespace changes)
-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
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
@@ -1,11 +1,12 @@
1#include <unistd.h> 1#include <unistd.h>
2#include <fcntl.h> 2#include <fcntl.h>
3#include <signal.h> 3#include <signal.h>
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
8#include "io_layer.h" 9#include "io_layer.h"
9#include "procctl.h" 10#include "procctl.h"
10#include "filereceive.h" 11#include "filereceive.h"
11 12
@@ -145,13 +146,14 @@ void FileReceive::slotRead() {
145 } 146 }
146 ar.resize( len ); 147 ar.resize( len );
147 QString str( ar ); 148 QString str( ar );
148} 149}
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;
154 m_not = m_proc = 0l; 156 m_not = m_proc = 0l;
155 close( m_term[0] ); 157 close( m_term[0] );
156 close( m_term[1] ); 158 close( m_term[1] );
157 close( m_comm[0] ); 159 close( m_comm[0] );
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
@@ -1,12 +1,13 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <stdlib.h> 2#include <stdlib.h>
3#include <errno.h> 3#include <errno.h>
4#include <fcntl.h> 4#include <fcntl.h>
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
9#include "procctl.h" 10#include "procctl.h"
10#include "filetransfer.h" 11#include "filetransfer.h"
11 12
12 13
@@ -231,13 +232,14 @@ void FileTransfer::slotProgress( const QStringList& list ) {
231void FileTransfer::cancel() { 232void FileTransfer::cancel() {
232 if(m_pid > 0) ::kill(m_pid,9 ); 233 if(m_pid > 0) ::kill(m_pid,9 );
233 234
234} 235}
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;
240 m_proc = m_not = 0l; 242 m_proc = m_not = 0l;
241 close( m_term[0] ); 243 close( m_term[0] );
242 close( m_term[1] ); 244 close( m_term[1] );
243 close( m_comm[0] ); 245 close( m_comm[0] );
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,17 +1,19 @@
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"
5 6
6 7
7Logger::Logger() {} 8Logger::Logger() {}
8 9
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
14Logger::~Logger() { 16Logger::~Logger() {
15 m_file.close(); 17 m_file.close();
16} 18}
17 19
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
@@ -821,13 +821,14 @@ void MainWindow::slotSaveHistory() {
821 nf.setType("text/plain"); 821 nf.setType("text/plain");
822 nf.setFile(filename); 822 nf.setFile(filename);
823 nf.setName(info.fileName()); 823 nf.setName(info.fileName());
824 824
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() )
830 currentSession()->emulationHandler()->emulation()->streamHistory(&str); 831 currentSession()->emulationHandler()->emulation()->streamHistory(&str);
831 832
832 file.close(); 833 file.close();
833 nf.writeLink(); 834 nf.writeLink();
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
@@ -3,19 +3,21 @@
3 3
4Script::Script() { 4Script::Script() {
5} 5}
6 6
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}
12 13
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();
18} 20}
19 21
20 22
21void Script::append(const QByteArray &data) { 23void Script::append(const QByteArray &data) {
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
@@ -842,28 +842,22 @@ bool Gutenbrowser::load( const char *fileName) {
842 842
843 // QCopEnvelope("QPE/System", "notBusy()" ); 843 // QCopEnvelope("QPE/System", "notBusy()" );
844 return true; 844 return true;
845} // end load 845} // end load
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()));
857 853
858 QString resultString; 854 QString resultString;
859 QString string = searchDlg->searchString; 855 QString string = searchDlg->searchString;
860 Lview->deselect(); 856 Lview->deselect();
861 searchDlg->show(); 857 searchDlg->show();
862 searchDlg->result();
863 }
864} 858}
865 859
866void Gutenbrowser::search_slot( ) { 860void Gutenbrowser::search_slot( ) {
867 int line, col; 861 int line, col;
868 if (!searchDlg /*&& !loadCheck */) 862 if (!searchDlg /*&& !loadCheck */)
869 return; 863 return;
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
@@ -193,39 +193,32 @@ HelpWindow::~HelpWindow()
193 history.clear(); 193 history.clear();
194 QMap<int, QString>::Iterator it = mHistory.begin(); 194 QMap<int, QString>::Iterator it = mHistory.begin();
195 for ( ; it != mHistory.end(); ++it ) 195 for ( ; it != mHistory.end(); ++it )
196 history.append( *it ); 196 history.append( *it );
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();
205 QMap<int, QString>::Iterator it2 = mBookmarks.begin(); 206 QMap<int, QString>::Iterator it2 = mBookmarks.begin();
206 for ( ; it2 != mBookmarks.end(); ++it2 ) 207 for ( ; it2 != mBookmarks.end(); ++it2 )
207 bookmarks.append( *it2 ); 208 bookmarks.append( *it2 );
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;
213 f2.close(); 216 f2.close();
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{
228#ifndef QT_NO_FILEDIALOG 221#ifndef QT_NO_FILEDIALOG
229 QString fn = QFileDialog::getOpenFileName( QString::null, QString::null, this ); 222 QString fn = QFileDialog::getOpenFileName( QString::null, QString::null, this );
230 if ( !fn.isEmpty() ) 223 if ( !fn.isEmpty() )
231 browser->setSource( fn ); 224 browser->setSource( fn );
@@ -289,33 +282,38 @@ void HelpWindow::pathSelected( const QString &_path )
289 if ( !exists ) 282 if ( !exists )
290 mHistory[ hist->insertItem( _path ) ] = _path; 283 mHistory[ hist->insertItem( _path ) ] = _path;
291} 284}
292 285
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;
300 f.close(); 297 f.close();
301 while ( history.count() > 20 ) 298 while ( history.count() > 20 )
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 )
318{ 316{
319 if ( mHistory.contains( i ) ) 317 if ( mHistory.contains( i ) )
320 browser->setSource( mHistory[ i ] ); 318 browser->setSource( mHistory[ i ] );
321} 319}