summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser
Unidiff
Diffstat (limited to 'noncore/apps/opie-gutenbrowser') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/gutenbrowser.cpp26
-rw-r--r--noncore/apps/opie-gutenbrowser/helpwindow.cpp64
2 files changed, 41 insertions, 49 deletions
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,18 +847,12 @@ bool Gutenbrowser::load( const char *fileName) {
847void Gutenbrowser::Search() { 847void Gutenbrowser::Search() {
848 848 odebug << "Starting search dialog" << oendl;
849 // if( searchDlg->isHidden()) 849 searchDlg = new SearchDialog( this, "Etext Search", true);
850 { 850 searchDlg->setCaption( tr( "Etext Search" ));
851 odebug << "Starting search dialog" << oendl; 851 connect( searchDlg,SIGNAL( search_signal()),this,SLOT( search_slot()));
852 searchDlg = new SearchDialog( this, "Etext Search", true); 852 connect( searchDlg,SIGNAL( search_done_signal()),this,SLOT( searchdone_slot()));
853 searchDlg->setCaption( tr( "Etext Search" )); 853
854 // searchDlg->setLabel( "- searches etext"); 854 QString resultString;
855 connect( searchDlg,SIGNAL( search_signal()),this,SLOT( search_slot())); 855 QString string = searchDlg->searchString;
856 connect( searchDlg,SIGNAL( search_done_signal()),this,SLOT( searchdone_slot())); 856 Lview->deselect();
857 857 searchDlg->show();
858 QString resultString;
859 QString string = searchDlg->searchString;
860 Lview->deselect();
861 searchDlg->show();
862 searchDlg->result();
863 }
864} 858}
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
@@ -195,9 +195,10 @@ HelpWindow::~HelpWindow()
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
@@ -206,6 +207,8 @@ HelpWindow::~HelpWindow()
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 );
@@ -215,12 +218,2 @@ HelpWindow::~HelpWindow()
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()
@@ -294,11 +287,14 @@ void HelpWindow::readHistory()
294{ 287{
295 if ( QFile::exists( QDir::currentDirPath() + "/.history" ) ) { 288 if ( !QFile::exists( QDir::currentDirPath() + "/.history" ) )
296 QFile f( QDir::currentDirPath() + "/.history" ); 289 return;
297 f.open( IO_ReadOnly ); 290
298 QDataStream s( &f ); 291 QFile f( QDir::currentDirPath() + "/.history" );
299 s >> history; 292 if ( !f.open( IO_ReadOnly ) )
300 f.close(); 293 return;
301 while ( history.count() > 20 ) 294
302 history.remove( history.begin() ); 295 QDataStream s( &f );
303 } 296 s >> history;
297 f.close();
298 while ( history.count() > 20 )
299 history.remove( history.begin() );
304} 300}
@@ -307,9 +303,11 @@ void HelpWindow::readBookmarks()
307{ 303{
308 if ( QFile::exists( QDir::currentDirPath() + "/.bookmarks" ) ) { 304 if ( !QFile::exists( QDir::currentDirPath() + "/.bookmarks" ) )
309 QFile f( QDir::currentDirPath() + "/.bookmarks" ); 305 return;
310 f.open( IO_ReadOnly ); 306
311 QDataStream s( &f ); 307 QFile f( QDir::currentDirPath() + "/.bookmarks" );
312 s >> bookmarks; 308 if ( !f.open( IO_ReadOnly ) )
313 f.close(); 309 return;
314 } 310 QDataStream s( &f );
311 s >> bookmarks;
312 f.close();
315} 313}