summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-gutenbrowser/gutenbrowser.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/gutenbrowser.cpp153
1 files changed, 79 insertions, 74 deletions
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp
index 2a9a71e..be2b897 100644
--- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp
+++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp
@@ -15,11 +15,5 @@
15// ftp://ibiblio.org/pub/docs/books/gutenberg/GUTINDEX.ALL 15// ftp://ibiblio.org/pub/docs/books/gutenberg/GUTINDEX.ALL
16// donate@gutenberg.net 16// donate@gutenberg.net
17#include <qpe/qpeapplication.h> 17
18#include <qpe/fontdatabase.h>
19#include <qpe/config.h>
20#include <qpe/qcopenvelope_qws.h>
21#include <qpe/mimetype.h>
22#include <qpe/resource.h>
23#include <qpe/applnk.h>
24 18
25#include "editTitle.h" 19#include "editTitle.h"
@@ -34,5 +28,15 @@
34#include "output.h" 28#include "output.h"
35 29
30/* OPIE */
31#include <opie2/odebug.h>
32#include <qpe/qpeapplication.h>
33#include <qpe/fontdatabase.h>
34#include <qpe/config.h>
35#include <qpe/qcopenvelope_qws.h>
36#include <qpe/mimetype.h>
37#include <qpe/resource.h>
38#include <qpe/applnk.h>
36 39
40/* QT */
37#include <qregexp.h> 41#include <qregexp.h>
38#include <qregion.h> 42#include <qregion.h>
@@ -52,4 +56,5 @@
52#include <qpoint.h> 56#include <qpoint.h>
53 57
58/* STD */
54#include <stdio.h> 59#include <stdio.h>
55#include <stdlib.h> 60#include <stdlib.h>
@@ -132,5 +137,5 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags )
132 int index=config.readNumEntry( "LineNumber", -1 ); 137 int index=config.readNumEntry( "LineNumber", -1 );
133 if( index != -1) { 138 if( index != -1) {
134 // qDebug( tempTitle); 139 // odebug << tempTitle << oendl;
135 bookmarksMenu->insertItem( tempTitle); 140 bookmarksMenu->insertItem( tempTitle);
136 } 141 }
@@ -155,5 +160,5 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags )
155 // Bookmark(); 160 // Bookmark();
156 for (int i=1;i< qApp->argc();i++) { 161 for (int i=1;i< qApp->argc();i++) {
157 qDebug("Suppose we open somethin"); 162 odebug << "Suppose we open somethin" << oendl;
158 load(qApp->argv()[i]); 163 load(qApp->argv()[i]);
159 } 164 }
@@ -170,5 +175,5 @@ Gutenbrowser::~Gutenbrowser() {
170 // QPEApplication::grabKeyboard(); 175 // QPEApplication::grabKeyboard();
171 // QPEApplication::ungrabKeyboard(); 176 // QPEApplication::ungrabKeyboard();
172 qDebug("Exit"); 177 odebug << "Exit" << oendl;
173} 178}
174 179
@@ -200,5 +205,5 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) {
200 else 205 else
201 filename+="etc/gutenbrowser/"; 206 filename+="etc/gutenbrowser/";
202 qDebug("filename "+filename); 207 odebug << "filename "+filename << oendl;
203 // QString filename = QDir::homeDirPath()+"/Applications/gutenbrowser/"; 208 // QString filename = QDir::homeDirPath()+"/Applications/gutenbrowser/";
204 209
@@ -208,9 +213,9 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) {
208 config.setGroup( "Browser" ); 213 config.setGroup( "Browser" );
209 QString brow = config.readEntry("Preferred", "Opera"); 214 QString brow = config.readEntry("Preferred", "Opera");
210 qDebug("Preferred browser is "+brow); 215 odebug << "Preferred browser is "+brow << oendl;
211 if(!showMsg) { //if we just get the gutenindex.all 216 if(!showMsg) { //if we just get the gutenindex.all
212 cmd="wget -O " + filename +" " + url+" 2>&1" ; 217 cmd="wget -O " + filename +" " + url+" 2>&1" ;
213 chdir(local_library); 218 chdir(local_library);
214 qDebug("Issuing the system command: %s", cmd.latin1()); 219 odebug << "Issuing the system command: " << cmd << "" << oendl;
215 220
216 Output *outDlg; 221 Output *outDlg;
@@ -224,5 +229,5 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) {
224 sleep(1); 229 sleep(1);
225 fp = popen( (const char *) cmd, "r"); 230 fp = popen( (const char *) cmd, "r");
226 // qDebug("Issuing the command\n"+cmd); 231 // odebug << "Issuing the command\n"+cmd << oendl;
227 // system(cmd); 232 // system(cmd);
228 while ( fgets( line, sizeof line, fp)) { 233 while ( fgets( line, sizeof line, fp)) {
@@ -257,5 +262,5 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) {
257 262
258 chdir(local_library); 263 chdir(local_library);
259 qDebug("Issuing the sys command: %s", cmd.latin1()); 264 odebug << "Issuing the sys command: " << cmd << "" << oendl;
260 system(cmd); 265 system(cmd);
261 } 266 }
@@ -267,5 +272,5 @@ void Gutenbrowser::toggleButtonIcons( bool useEm) {
267 useEm=TRUE; 272 useEm=TRUE;
268 pixDir=QPEApplication::qpeDir()+"pics/gutenbrowser"; 273 pixDir=QPEApplication::qpeDir()+"pics/gutenbrowser";
269 qDebug("Docdir is "+QPEApplication::documentDir()); 274 odebug << "Docdir is "+QPEApplication::documentDir() << oendl;
270 275
271 if( useIcons && QDir( pixDir).exists() ) { 276 if( useIcons && QDir( pixDir).exists() ) {
@@ -382,5 +387,5 @@ void Gutenbrowser::PrintBtn() {
382void Gutenbrowser::SearchBtn() { 387void Gutenbrowser::SearchBtn() {
383 if( loadCheck) { 388 if( loadCheck) {
384 qDebug("loadCheck: we have a loaded doc"); 389 odebug << "loadCheck: we have a loaded doc" << oendl;
385 Search(); 390 Search();
386 } 391 }
@@ -405,5 +410,5 @@ void Gutenbrowser::ForwardBtn() {
405 insertString+=s; 410 insertString+=s;
406 Lview->insertLine( s, -1); 411 Lview->insertLine( s, -1);
407 // qDebug(s); 412 // odebug << s << oendl;
408 currentLine++; 413 currentLine++;
409 } 414 }
@@ -424,5 +429,5 @@ void Gutenbrowser::ForwardBtn() {
424 429
425 } else { 430 } else {
426 // qDebug("bal"); 431 // odebug << "bal" << oendl;
427 // if( i_pageNum != pages) { 432 // if( i_pageNum != pages) {
428 433
@@ -439,5 +444,5 @@ void Gutenbrowser::ForwardBtn() {
439 Lview->setFocus(); 444 Lview->setFocus();
440 445
441 // qDebug("page number %d line number %d", i_pageNum, currentLine); 446 // odebug << "page number " << i_pageNum << " line number " << currentLine << "" << oendl;
442} 447}
443 448
@@ -458,5 +463,5 @@ void Gutenbrowser::BackBtn() {
458 } else { 463 } else {
459 if(!f.at( pageStopArray[i_pageNum - 1] )) 464 if(!f.at( pageStopArray[i_pageNum - 1] ))
460 qDebug("File positioned backward did not work"); 465 odebug << "File positioned backward did not work" << oendl;
461 } 466 }
462 QString s; 467 QString s;
@@ -514,5 +519,5 @@ void Gutenbrowser::TopBtn() {
514 if(loadCheck) { 519 if(loadCheck) {
515 if( i_pageNum != 0) { 520 if( i_pageNum != 0) {
516 qDebug("top"); 521 odebug << "top" << oendl;
517 qApp->processEvents(); 522 qApp->processEvents();
518 currentLine = 0; 523 currentLine = 0;
@@ -572,9 +577,9 @@ void Gutenbrowser::BeginBtn() {
572 pageStopArray.resize(i_pageNum + 1); 577 pageStopArray.resize(i_pageNum + 1);
573 pageStopArray[i_pageNum ] = currentFilePos; 578 pageStopArray[i_pageNum ] = currentFilePos;
574 // qDebug("new page number %d, found at %d", i_pageNum, currentFilePos); 579 // odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl;
575 } 580 }
576 // lastPage = i_pageNum; 581 // lastPage = i_pageNum;
577 if( LeftText.find( s_pattern, 0 , TRUE) != -1 || LeftText.find( sPattern2, 0 , TRUE) != -1 ) { 582 if( LeftText.find( s_pattern, 0 , TRUE) != -1 || LeftText.find( sPattern2, 0 , TRUE) != -1 ) {
578 qDebug("<<<<<< FOUND IT!! new page number %d, found at %d", i_pageNum, currentFilePos); 583 odebug << "<<<<<< FOUND IT!! new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl;
579 break; 584 break;
580 } 585 }
@@ -622,9 +627,9 @@ void Gutenbrowser::setBookmark() {
622 file_name=cfg.readEntry("Current",""); 627 file_name=cfg.readEntry("Current","");
623 qApp->processEvents(); 628 qApp->processEvents();
624 qDebug("Settingbook mark "+file_name); 629 odebug << "Settingbook mark "+file_name << oendl;
625 630
626 cfg.setGroup("Titles"); 631 cfg.setGroup("Titles");
627 title=cfg.readEntry(file_name,""); 632 title=cfg.readEntry(file_name,"");
628 qDebug("title is "+ title); 633 odebug << "title is "+ title << oendl;
629 634
630 cfg.setGroup( "Bookmarks" ); 635 cfg.setGroup( "Bookmarks" );
@@ -655,9 +660,9 @@ void Gutenbrowser::Bookmark( int itemId) {
655 config.setGroup( "Bookmarks" ); 660 config.setGroup( "Bookmarks" );
656 661
657 // qDebug("<<<<<< %d, %d", Lview->PageSize(), Lview->lastRow() - Lview->topRow() ); 662 // odebug << "<<<<<< " << Lview->PageSize() << ", " << Lview->lastRow() - Lview->topRow() << "" << oendl;
658 663
659 QString itemString; 664 QString itemString;
660 665
661 qDebug("menu item %d", itemId); 666 odebug << "menu item " << itemId << "" << oendl;
662 QString tempTitle; 667 QString tempTitle;
663 QString s_Bmrkrow; 668 QString s_Bmrkrow;
@@ -701,5 +706,5 @@ void Gutenbrowser::Bookmark( int itemId) {
701 pageStopArray.resize(i_pageNum + 1); 706 pageStopArray.resize(i_pageNum + 1);
702 pageStopArray[i_pageNum ] = currentFilePos; 707 pageStopArray[i_pageNum ] = currentFilePos;
703 // qDebug("new page number %d, found at %d", i_pageNum, currentFilePos); 708 // odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl;
704 } 709 }
705 if(currentFilePos == bookmarkPosition) 710 if(currentFilePos == bookmarkPosition)
@@ -730,5 +735,5 @@ void Gutenbrowser::Bookmark( int itemId) {
730 } 735 }
731 736
732 qDebug("bookmark loaded"); 737 odebug << "bookmark loaded" << oendl;
733 setCaption(title); 738 setCaption(title);
734} 739}
@@ -738,6 +743,6 @@ bool Gutenbrowser::load( const char *fileName) {
738 743
739 // QCopEnvelope ( "QPE/System", "busy()" ); 744 // QCopEnvelope ( "QPE/System", "busy()" );
740 // qDebug("Title is already set as "+title); 745 // odebug << "Title is already set as "+title << oendl;
741 qDebug("sizeHint %d pageSize %d", sizeHint().height(),Lview->PageSize() ); 746 odebug << "sizeHint " << sizeHint().height() << " pageSize " << Lview->PageSize() << "" << oendl;
742 if( Lview->PageSize() < 4) { 747 if( Lview->PageSize() < 4) {
743 748
@@ -745,5 +750,5 @@ bool Gutenbrowser::load( const char *fileName) {
745 Lview->setMinimumHeight( sizeHint().height() ); 750 Lview->setMinimumHeight( sizeHint().height() );
746 pointSize = Lview->fontInfo().pointSize(); 751 pointSize = Lview->fontInfo().pointSize();
747 qDebug("sizeHint %d point size %d", sizeHint().height(), pointSize); 752 odebug << "sizeHint " << sizeHint().height() << " point size " << pointSize << "" << oendl;
748 if(pointSize < 10) 753 if(pointSize < 10)
749 Lview->setFixedVisibleLines(19); 754 Lview->setFixedVisibleLines(19);
@@ -763,5 +768,5 @@ bool Gutenbrowser::load( const char *fileName) {
763 i_pageNum = 1; 768 i_pageNum = 1;
764 // } 769 // }
765 qDebug("ready to open "+o_file); 770 odebug << "ready to open "+o_file << oendl;
766 771
767 if(f.isOpen()) f.close(); 772 if(f.isOpen()) f.close();
@@ -799,5 +804,5 @@ bool Gutenbrowser::load( const char *fileName) {
799 804
800 Lview->setMaxLines(Lview->PageSize()*2); 805 Lview->setMaxLines(Lview->PageSize()*2);
801 qDebug("Gulped %d", currentLine); 806 odebug << "Gulped " << currentLine << "" << oendl;
802 setCaption(title); 807 setCaption(title);
803 Lview->setAutoUpdate( TRUE); 808 Lview->setAutoUpdate( TRUE);
@@ -806,5 +811,5 @@ bool Gutenbrowser::load( const char *fileName) {
806 811
807 // pages = (int)(( Lview->numLines() / Lview->editSize() ) / 2 ) +1; 812 // pages = (int)(( Lview->numLines() / Lview->editSize() ) / 2 ) +1;
808 //qDebug("number of pages %d", pages); 813 //odebug << "number of pages " << pages << "" << oendl;
809 814
810 loadCheck = true; 815 loadCheck = true;
@@ -823,5 +828,5 @@ void Gutenbrowser::Search() {
823 // if( searchDlg->isHidden()) 828 // if( searchDlg->isHidden())
824 { 829 {
825 qDebug("Starting search dialog"); 830 odebug << "Starting search dialog" << oendl;
826 searchDlg = new SearchDialog( this, "Etext Search", true); 831 searchDlg = new SearchDialog( this, "Etext Search", true);
827 searchDlg->setCaption( tr( "Etext Search" )); 832 searchDlg->setCaption( tr( "Etext Search" ));
@@ -959,7 +964,7 @@ void Gutenbrowser::LibraryBtn() {
959 QString newestLibraryFile ="pgwhole.zip"; 964 QString newestLibraryFile ="pgwhole.zip";
960 QString zipFile; 965 QString zipFile;
961 // qDebug("Local Library is %s ", local_library.latin1()); 966 // odebug << "Local Library is " << local_library << " " << oendl;
962 zipFile="/usr/bin/unzip"; 967 zipFile="/usr/bin/unzip";
963 // qDebug("newestLibraryFile is %s ", newestLibraryFile.latin1()); 968 // odebug << "newestLibraryFile is " << newestLibraryFile << " " << oendl;
964 if( QFile::exists( local_library+newestLibraryFile)) { 969 if( QFile::exists( local_library+newestLibraryFile)) {
965 if( QFile::exists(zipFile) ) { 970 if( QFile::exists(zipFile) ) {
@@ -990,5 +995,5 @@ void Gutenbrowser::LibraryBtn() {
990 listItemTitle = LibraryDlg->DlglistItemTitle; 995 listItemTitle = LibraryDlg->DlglistItemTitle;
991 file_name = LibraryDlg->File_Name; 996 file_name = LibraryDlg->File_Name;
992 // qDebug("title is being set as "+title); 997 // odebug << "title is being set as "+title << oendl;
993 title = listItemTitle; 998 title = listItemTitle;
994 999
@@ -1012,5 +1017,5 @@ void Gutenbrowser::LibraryBtn() {
1012 if( file_name.find(".zip")) 1017 if( file_name.find(".zip"))
1013 { 1018 {
1014 qDebug("Found zip file\n"); 1019 odebug << "Found zip file\n" << oendl;
1015 // QStringList args; 1020 // QStringList args;
1016 // args="unzip"; 1021 // args="unzip";
@@ -1020,5 +1025,5 @@ void Gutenbrowser::LibraryBtn() {
1020 // args+=local_library; 1025 // args+=local_library;
1021 QString cmd = "/usr/bin/unzip -o " + local_library+file_name + " -d " + local_library; 1026 QString cmd = "/usr/bin/unzip -o " + local_library+file_name + " -d " + local_library;
1022 qDebug("Issuing the command "+ cmd); 1027 odebug << "Issuing the command "+ cmd << oendl;
1023 // unzipProc=new QProcess( this, "unzipProc" ); /// fark that idea! 1028 // unzipProc=new QProcess( this, "unzipProc" ); /// fark that idea!
1024 // unzipProc->start(); 1029 // unzipProc->start();
@@ -1063,5 +1068,5 @@ void Gutenbrowser::OpenBtn() {
1063 if( OpenDlg->exec() != 0) { 1068 if( OpenDlg->exec() != 0) {
1064 title = OpenDlg->openFileTitle; 1069 title = OpenDlg->openFileTitle;
1065 qDebug("title open as "+title); 1070 odebug << "title open as "+title << oendl;
1066 file_name = OpenDlg->file; 1071 file_name = OpenDlg->file;
1067 i_pageNum = 1; 1072 i_pageNum = 1;
@@ -1070,5 +1075,5 @@ void Gutenbrowser::OpenBtn() {
1070 if(showMainList) { 1075 if(showMainList) {
1071 showMainList=FALSE; 1076 showMainList=FALSE;
1072 qDebug("ShowMainList is now false"); 1077 odebug << "ShowMainList is now false" << oendl;
1073 mainList->hide(); 1078 mainList->hide();
1074 Lview->show(); 1079 Lview->show();
@@ -1079,5 +1084,5 @@ void Gutenbrowser::OpenBtn() {
1079 load(file_name); 1084 load(file_name);
1080 } else { 1085 } else {
1081 qDebug("file_name is empty!"); 1086 odebug << "file_name is empty!" << oendl;
1082 if(showMainList) { 1087 if(showMainList) {
1083 if(!Lview->isHidden()) 1088 if(!Lview->isHidden())
@@ -1245,5 +1250,5 @@ bool Gutenbrowser::getTitle( const char *file ) {
1245 config.setGroup( "Titles" ); 1250 config.setGroup( "Titles" );
1246 title = config.readEntry(ramble, ""); 1251 title = config.readEntry(ramble, "");
1247 // qDebug("(getTitle)title is being set as "+title); 1252 // odebug << "(getTitle)title is being set as "+title << oendl;
1248 } 1253 }
1249 } 1254 }
@@ -1447,5 +1452,5 @@ void Gutenbrowser::keyPressEvent( QKeyEvent *e) {
1447 1452
1448void Gutenbrowser::resizeEvent( QResizeEvent *ev) { 1453void Gutenbrowser::resizeEvent( QResizeEvent *ev) {
1449 // qDebug("resize: %d,%d\n",ev->size().width(),ev->size().height()); 1454 // odebug << "resize: " << ev->size().width() << "," << ev->size().height() << "\n" << oendl;
1450 1455
1451 if( !LibraryDlg->isHidden()) 1456 if( !LibraryDlg->isHidden())
@@ -1477,5 +1482,5 @@ void Gutenbrowser::doOptions() {
1477 Ddir=optDlg->downloadDirEdit->text(); 1482 Ddir=optDlg->downloadDirEdit->text();
1478 1483
1479 qDebug("writing library config"); 1484 odebug << "writing library config" << oendl;
1480 Config config("Gutenbrowser"); 1485 Config config("Gutenbrowser");
1481 config.setGroup("General"); 1486 config.setGroup("General");
@@ -1494,5 +1499,5 @@ void Gutenbrowser::doOptions() {
1494 cmd+=Ddir.latin1(); 1499 cmd+=Ddir.latin1();
1495 system(cmd); 1500 system(cmd);
1496 qDebug("Making new dir "+cmd); 1501 odebug << "Making new dir "+cmd << oendl;
1497 if(Ddir.right(1)!="/") { 1502 if(Ddir.right(1)!="/") {
1498 Ddir+="/"; 1503 Ddir+="/";
@@ -1510,5 +1515,5 @@ void Gutenbrowser::doOptions() {
1510 1515
1511 if(optDlg->fontDlg-> changedFonts) { 1516 if(optDlg->fontDlg-> changedFonts) {
1512 qDebug("Setting font"); 1517 odebug << "Setting font" << oendl;
1513 myFont=optDlg->fontDlg->selectedFont; 1518 myFont=optDlg->fontDlg->selectedFont;
1514 Lview->setFont( myFont); 1519 Lview->setFont( myFont);
@@ -1516,9 +1521,9 @@ void Gutenbrowser::doOptions() {
1516 1521
1517 if(optDlg->useWordWrap_CheckBox->isChecked() ) { 1522 if(optDlg->useWordWrap_CheckBox->isChecked() ) {
1518 qDebug("WORD WRAP is set"); 1523 odebug << "WORD WRAP is set" << oendl;
1519 Lview->setWordWrap(QMultiLineEdit::WidgetWidth); 1524 Lview->setWordWrap(QMultiLineEdit::WidgetWidth);
1520 useWrap=true; 1525 useWrap=true;
1521 } else { 1526 } else {
1522 qDebug("Word wrap is NOT set"); 1527 odebug << "Word wrap is NOT set" << oendl;
1523 Lview->setWordWrap(QMultiLineEdit::NoWrap); 1528 Lview->setWordWrap(QMultiLineEdit::NoWrap);
1524 useWrap=false; 1529 useWrap=false;
@@ -1579,6 +1584,6 @@ bool Gutenbrowser::setTitle() {
1579void Gutenbrowser::OnNetworkDialog( const QString &/*networkUrl*/, const QString &/*output*/) 1584void Gutenbrowser::OnNetworkDialog( const QString &/*networkUrl*/, const QString &/*output*/)
1580{ 1585{
1581 // qDebug(networkUrl); 1586 // odebug << networkUrl << oendl;
1582 // qDebug(output); 1587 // odebug << output << oendl;
1583 // #ifndef Q_WS_QWS 1588 // #ifndef Q_WS_QWS
1584 // NetworkDialog *NetworkDlg; 1589 // NetworkDialog *NetworkDlg;
@@ -1713,5 +1718,5 @@ void Gutenbrowser::cleanUp( )
1713 1718
1714 QPEApplication::ungrabKeyboard(); 1719 QPEApplication::ungrabKeyboard();
1715 // qDebug("Cleanup"); 1720 // odebug << "Cleanup" << oendl;
1716 if(f.isOpen()) f.close(); 1721 if(f.isOpen()) f.close();
1717} 1722}
@@ -1719,5 +1724,5 @@ void Gutenbrowser::cleanUp( )
1719void Gutenbrowser::fixKeys() 1724void Gutenbrowser::fixKeys()
1720{ 1725{
1721 qDebug("Attempting to fix keys"); 1726 odebug << "Attempting to fix keys" << oendl;
1722 1727
1723} 1728}
@@ -1773,5 +1778,5 @@ void Gutenbrowser::listClickedSlot( QListBoxItem * index) {
1773 config.setGroup( "Files" ); 1778 config.setGroup( "Files" );
1774 QString file = config.readEntry(temp, ""); 1779 QString file = config.readEntry(temp, "");
1775 qDebug("About to load"); 1780 odebug << "About to load" << oendl;
1776 if( Lview->isVisible()) 1781 if( Lview->isVisible())
1777 load(file); 1782 load(file);
@@ -1814,9 +1819,9 @@ void Gutenbrowser::setDocument(const QString & frozenBoogers) {
1814 DocLnk lnk; 1819 DocLnk lnk;
1815 lnk = DocLnk(frozenBoogers); 1820 lnk = DocLnk(frozenBoogers);
1816 // qDebug(lnk.file() ); 1821 // odebug << lnk.file() << oendl;
1817 title=lnk.comment(); 1822 title=lnk.comment();
1818 load( lnk.file()); 1823 load( lnk.file());
1819 this->show(); 1824 this->show();
1820 // qDebug(title); 1825 // odebug << title << oendl;
1821 // qApp->processEvents(); 1826 // qApp->processEvents();
1822 // repaint(); 1827 // repaint();
@@ -1874,5 +1879,5 @@ void Gutenbrowser::menuEditTitle()
1874 int currentItem = mainList->currentItem(); 1879 int currentItem = mainList->currentItem();
1875 QString title_text = mainList->text( currentItem); 1880 QString title_text = mainList->text( currentItem);
1876 //qDebug("Selected "+title_text); 1881 //odebug << "Selected "+title_text << oendl;
1877 1882
1878 Config config("Gutenbrowser"); 1883 Config config("Gutenbrowser");
@@ -1888,13 +1893,13 @@ void Gutenbrowser::menuEditTitle()
1888 config.setGroup( "Titles" ); 1893 config.setGroup( "Titles" );
1889 QString file_title = config.readEntry( s_filename, ""); 1894 QString file_title = config.readEntry( s_filename, "");
1890 //qDebug("file_title is "+file_title); 1895 //odebug << "file_title is "+file_title << oendl;
1891 if(title_text == file_title ) { 1896 if(title_text == file_title ) {
1892 // selFile = s_filename; 1897 // selFile = s_filename;
1893 //qDebug("Edit: "+ file_title ); 1898 //odebug << "Edit: "+ file_title << oendl;
1894 i=i_numofFiles+1; 1899 i=i_numofFiles+1;
1895 Edit_Title *titleEdit; 1900 Edit_Title *titleEdit;
1896 titleEdit = new Edit_Title(this,file_title ,TRUE); 1901 titleEdit = new Edit_Title(this,file_title ,TRUE);
1897 if(titleEdit->exec() !=0) { 1902 if(titleEdit->exec() !=0) {
1898 //qDebug(titleEdit->newTitle); 1903 //odebug << titleEdit->newTitle << oendl;
1899 config.writeEntry( s_filename, titleEdit->newTitle); 1904 config.writeEntry( s_filename, titleEdit->newTitle);
1900 mainList->removeItem(currentItem); 1905 mainList->removeItem(currentItem);
@@ -1912,5 +1917,5 @@ void Gutenbrowser::menuEditTitle()
1912 1917
1913bool Gutenbrowser::UnZipIt(const QString &zipFile) { 1918bool Gutenbrowser::UnZipIt(const QString &zipFile) {
1914 qDebug(zipFile); 1919 odebug << zipFile << oendl;
1915#ifndef Q_WS_QWS 1920#ifndef Q_WS_QWS
1916 if( QFile::exists( zipFile)) { // TODO findsome other way of dealingwithzip files. 1921 if( QFile::exists( zipFile)) { // TODO findsome other way of dealingwithzip files.
@@ -1924,9 +1929,9 @@ bool Gutenbrowser::UnZipIt(const QString &zipFile) {
1924 // thatFile=zipFile.left(4); 1929 // thatFile=zipFile.left(4);
1925 // } 1930 // }
1926 // qDebug((const char*)local_library.latin1()); 1931 // odebug << (const char*)local_library.latin1() << oendl;
1927 QString cmd; 1932 QString cmd;
1928#if defined(_WS_X11_) 1933#if defined(_WS_X11_)
1929 if( chdir((const char*)local_library.latin1())!=0) 1934 if( chdir((const char*)local_library.latin1())!=0)
1930 qDebug("chdir failed."); 1935 odebug << "chdir failed." << oendl;
1931 cmd = "gunzip -S .zip " + local_library+zipFile; 1936 cmd = "gunzip -S .zip " + local_library+zipFile;
1932 //cmd = "gunzip -d " + zipFile /*newestLibraryFile */+" -d " + local_library; 1937 //cmd = "gunzip -d " + zipFile /*newestLibraryFile */+" -d " + local_library;
@@ -1934,5 +1939,5 @@ bool Gutenbrowser::UnZipIt(const QString &zipFile) {
1934#ifdef Q_WS_QWS 1939#ifdef Q_WS_QWS
1935 if( chdir((const char*)local_library.latin1())!=0) 1940 if( chdir((const char*)local_library.latin1())!=0)
1936 qDebug("chdir failed."); 1941 odebug << "chdir failed." << oendl;
1937 cmd = "unzip " + local_library+zipFile; 1942 cmd = "unzip " + local_library+zipFile;
1938 // cmd = "/usr/bin/unzip -o " + local_library+zipFile +" -d /usr/share/doc/gutenbrowser" ;//+ local_library; 1943 // cmd = "/usr/bin/unzip -o " + local_library+zipFile +" -d /usr/share/doc/gutenbrowser" ;//+ local_library;
@@ -1943,5 +1948,5 @@ bool Gutenbrowser::UnZipIt(const QString &zipFile) {
1943 if (exit==QMessageBox::Yes) { 1948 if (exit==QMessageBox::Yes) {
1944#if defined(_WS_X11_)// 1949#if defined(_WS_X11_)//
1945 qDebug("Issuing the command "+cmd); 1950 odebug << "Issuing the command "+cmd << oendl;
1946 system( cmd); 1951 system( cmd);
1947 if( QFile::exists(thatFile)) 1952 if( QFile::exists(thatFile))
@@ -1949,12 +1954,12 @@ bool Gutenbrowser::UnZipIt(const QString &zipFile) {
1949 if(isPgWhole) { 1954 if(isPgWhole) {
1950 if( rename("pgwhole","PGWHOLE.TXT") !=0) 1955 if( rename("pgwhole","PGWHOLE.TXT") !=0)
1951 qDebug("rename failed"); 1956 odebug << "rename failed" << oendl;
1952 } else { 1957 } else {
1953 if( rename(thatFile.left(4),thatFile.left(4)+".txt") !=0) 1958 if( rename(thatFile.left(4),thatFile.left(4)+".txt") !=0)
1954 qDebug("rename failed"); 1959 odebug << "rename failed" << oendl;
1955 } 1960 }
1956#endif 1961#endif
1957#ifdef Q_WS_QWS 1962#ifdef Q_WS_QWS
1958 qDebug("Issuing the command "+cmd); 1963 odebug << "Issuing the command "+cmd << oendl;
1959 system( cmd); 1964 system( cmd);
1960 if( QFile::exists(thatFile)) 1965 if( QFile::exists(thatFile))
@@ -1962,8 +1967,8 @@ bool Gutenbrowser::UnZipIt(const QString &zipFile) {
1962 if(isPgWhole) { 1967 if(isPgWhole) {
1963 if( rename("pgwhole","PGWHOLE.TXT") !=0) 1968 if( rename("pgwhole","PGWHOLE.TXT") !=0)
1964 qDebug("rename failed"); 1969 odebug << "rename failed" << oendl;
1965 } else { 1970 } else {
1966 if( rename(thatFile.left(4),thatFile.left(4)+".txt") !=0) 1971 if( rename(thatFile.left(4),thatFile.left(4)+".txt") !=0)
1967 qDebug("rename failed"); 1972 odebug << "rename failed" << oendl;
1968 } 1973 }
1969#endif 1974#endif
@@ -1972,5 +1977,5 @@ bool Gutenbrowser::UnZipIt(const QString &zipFile) {
1972 } 1977 }
1973 else if(exit==QMessageBox::No) { 1978 else if(exit==QMessageBox::No) {
1974 // qDebug("unzip"); 1979 // odebug << "unzip" << oendl;
1975 return false; 1980 return false;
1976 } 1981 }