summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-gutenbrowser/LibraryDialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/LibraryDialog.cpp92
1 files changed, 48 insertions, 44 deletions
diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
index 5b22b00..270a4cf 100644
--- a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
@@ -15,2 +15,6 @@
15 15
16#include "LibraryDialog.h"
17#include "output.h"
18
19/* OPIE */
16#include <qpe/applnk.h> 20#include <qpe/applnk.h>
@@ -18,6 +22,5 @@
18#include <qpe/qpedialog.h> 22#include <qpe/qpedialog.h>
23#include <opie2/odebug.h>
19 24
20#include "LibraryDialog.h" 25/* QT */
21#include "output.h"
22
23#include <qpushbutton.h> 26#include <qpushbutton.h>
@@ -26,2 +29,3 @@
26 29
30/* STD */
27#include <unistd.h> 31#include <unistd.h>
@@ -66,3 +70,3 @@ LibraryDialog::LibraryDialog( QWidget* parent, const char* name , bool modal, W
66 ftp_host=config.readEntry("SiteName", "sailor.gutenberg.org"); 70 ftp_host=config.readEntry("SiteName", "sailor.gutenberg.org");
67 qDebug("Library Dialog: ftp_host is "+ftp_host); 71 odebug << "Library Dialog: ftp_host is "+ftp_host << oendl;
68 // ftp_host=ftp_host.right(ftp_host.length()-(ftp_host.find(") ",0,TRUE)+1) ); 72 // ftp_host=ftp_host.right(ftp_host.length()-(ftp_host.find(") ",0,TRUE)+1) );
@@ -79,3 +83,3 @@ LibraryDialog::LibraryDialog( QWidget* parent, const char* name , bool modal, W
79 downDir =config.readEntry( "DownloadDirectory",local_library); 83 downDir =config.readEntry( "DownloadDirectory",local_library);
80 qDebug("downDir is "+downDir); 84 odebug << "downDir is "+downDir << oendl;
81 newindexLib.setName( old_index); 85 newindexLib.setName( old_index);
@@ -101,3 +105,3 @@ void LibraryDialog::Newlibrary()
101#ifndef Q_WS_QWS //sorry embedded gutenbrowser cant use zip files 105#ifndef Q_WS_QWS //sorry embedded gutenbrowser cant use zip files
102 //qDebug("Opening new library index %s",newindexLib); 106 //odebug << "Opening new library index " << newindexLib << "" << oendl;
103 if ( newindexLib.open( IO_ReadOnly) ) { 107 if ( newindexLib.open( IO_ReadOnly) ) {
@@ -123,3 +127,3 @@ void LibraryDialog::Newlibrary()
123 if (authBox->isChecked()) { // this reverses the first name and last name of the author 127 if (authBox->isChecked()) { // this reverses the first name and last name of the author
124 // qDebug("Sorting last name first"); 128 // odebug << "Sorting last name first" << oendl;
125 QString lastName, firstName=""; 129 QString lastName, firstName="";
@@ -182,3 +186,3 @@ void LibraryDialog::Library()
182 186
183 qDebug("opening GUTINDEX.ALL file"); 187 odebug << "opening GUTINDEX.ALL file" << oendl;
184 IDontKnowWhy = ""; 188 IDontKnowWhy = "";
@@ -202,3 +206,3 @@ void LibraryDialog::Library()
202 file = file.left( file.find("]",0,TRUE)); 206 file = file.left( file.find("]",0,TRUE));
203 //qDebug("file is "+file); 207 //odebug << "file is "+file << oendl;
204 /// number = indexLine.mid( indexLine.find( "]", 0, TRUE ) +1, indexLine.find( " ", 0, TRUE )+1 ); 208 /// number = indexLine.mid( indexLine.find( "]", 0, TRUE ) +1, indexLine.find( " ", 0, TRUE )+1 );
@@ -209,6 +213,6 @@ void LibraryDialog::Library()
209 title = title.stripWhiteSpace(); 213 title = title.stripWhiteSpace();
210 //qDebug("title is "+title); 214 //odebug << "title is "+title << oendl;
211 getAuthor(); // grok author 215 getAuthor(); // grok author
212 author = author.stripWhiteSpace(); 216 author = author.stripWhiteSpace();
213 //qDebug("author is "+author); 217 //odebug << "author is "+author << oendl;
214 if (authBox->isChecked() == TRUE) { // this reverses the first name and last name of the author 218 if (authBox->isChecked() == TRUE) { // this reverses the first name and last name of the author
@@ -399,4 +403,4 @@ void LibraryDialog::select_title( QListViewItem * item)
399 item = 0; 403 item = 0;
400 qDebug( "string from librarydialog is:%s %s %s", DlglistItemYear.latin1(),DlglistItemFile.latin1(),DlglistItemNumber.latin1()); 404 odebug << "string from librarydialog is:" << DlglistItemYear << " " << DlglistItemFile << " " << DlglistItemNumber << "" << oendl;
401 qDebug("Title is "+DlglistItemTitle); 405 odebug << "Title is "+DlglistItemTitle << oendl;
402 406
@@ -406,3 +410,3 @@ void LibraryDialog::select_title( QListViewItem * item)
406 if(download_Etext()) { 410 if(download_Etext()) {
407 // qDebug("get here 2"); 411 // odebug << "get here 2" << oendl;
408 if(i_binary == 1) { 412 if(i_binary == 1) {
@@ -425,3 +429,3 @@ bool LibraryDialog::download_Etext()
425 429
426 qDebug("about to network dialog"); 430 odebug << "about to network dialog" << oendl;
427 QString NewlistItemNumber, NewlistItemYear, ls_result, result_line, s, dir, networkUrl, outputFile; 431 QString NewlistItemNumber, NewlistItemYear, ls_result, result_line, s, dir, networkUrl, outputFile;
@@ -433,3 +437,3 @@ bool LibraryDialog::download_Etext()
433 NewlistItemFile.replace( 0,4, DlglistItemFile.left(4)); 437 NewlistItemFile.replace( 0,4, DlglistItemFile.left(4));
434 qDebug("NewlistItemFile is now "+NewlistItemFile); 438 odebug << "NewlistItemFile is now "+NewlistItemFile << oendl;
435 } 439 }
@@ -437,3 +441,3 @@ bool LibraryDialog::download_Etext()
437 int NewlistItemYear_Int = NewlistItemYear.toInt(0, 10); 441 int NewlistItemYear_Int = NewlistItemYear.toInt(0, 10);
438 qDebug(NewlistItemYear); 442 odebug << NewlistItemYear << oendl;
439 if (NewlistItemYear_Int < 91 && NewlistItemYear_Int > 70) { 443 if (NewlistItemYear_Int < 91 && NewlistItemYear_Int > 70) {
@@ -449,4 +453,4 @@ bool LibraryDialog::download_Etext()
449 outputFile=local_library+".guten_temp"; 453 outputFile=local_library+".guten_temp";
450 //qDebug("Download file:%s",NewlistItemFile.latin1() ); 454 //odebug << "Download file:" << NewlistItemFile << "" << oendl;
451 qDebug("Checking: "+ftp_host+" "+dir+" "+outputFile+" "+NewlistItemFile); 455 odebug << "Checking: "+ftp_host+" "+dir+" "+outputFile+" "+NewlistItemFile << oendl;
452 QStringList networkList; 456 QStringList networkList;
@@ -464,4 +468,4 @@ bool LibraryDialog::download_Etext()
464 File_Name= NetworkDlg->localFileName; 468 File_Name= NetworkDlg->localFileName;
465 qDebug("back to Library from Network Dialog"); 469 odebug << "back to Library from Network Dialog" << oendl;
466 qDebug("Just downloaded "+NetworkDlg->localFileName); 470 odebug << "Just downloaded "+NetworkDlg->localFileName << oendl;
467 471
@@ -470,3 +474,3 @@ bool LibraryDialog::download_Etext()
470 // File_Name.replace(0,local_library.length(),downDir); 474 // File_Name.replace(0,local_library.length(),downDir);
471 // qDebug("File_Name now is "+File_Name); 475 // odebug << "File_Name now is "+File_Name << oendl;
472 476
@@ -475,3 +479,3 @@ bool LibraryDialog::download_Etext()
475 if(NetworkDlg->successDownload) { 479 if(NetworkDlg->successDownload) {
476 qDebug("Filename is "+File_Name); 480 odebug << "Filename is "+File_Name << oendl;
477 if(File_Name.right(4)==".txt") { 481 if(File_Name.right(4)==".txt") {
@@ -483,3 +487,3 @@ bool LibraryDialog::download_Etext()
483 487
484 qDebug("Filename is now "+File_Name); 488 odebug << "Filename is now "+File_Name << oendl;
485 489
@@ -492,10 +496,10 @@ bool LibraryDialog::download_Etext()
492 496
493 qDebug("Setting doclink"); 497 odebug << "Setting doclink" << oendl;
494 DocLnk lnk; 498 DocLnk lnk;
495 qDebug("name is "+name_file); 499 odebug << "name is "+name_file << oendl;
496 lnk.setName(name_file); //sets file name 500 lnk.setName(name_file); //sets file name
497 qDebug("Title is "+DlglistItemTitle); 501 odebug << "Title is "+DlglistItemTitle << oendl;
498 lnk.setComment(DlglistItemTitle); 502 lnk.setComment(DlglistItemTitle);
499 503
500 qDebug("Filename is "+File_Name); 504 odebug << "Filename is "+File_Name << oendl;
501 lnk.setFile(File_Name); //sets File property 505 lnk.setFile(File_Name); //sets File property
@@ -505,3 +509,3 @@ bool LibraryDialog::download_Etext()
505 if(!lnk.writeLink()) { 509 if(!lnk.writeLink()) {
506 qDebug("Writing doclink did not work"); 510 odebug << "Writing doclink did not work" << oendl;
507 } else { 511 } else {
@@ -572,4 +576,4 @@ bool LibraryDialog::setTitle()
572 Config config("Gutenbrowser"); 576 Config config("Gutenbrowser");
573 qDebug("setting title"); 577 odebug << "setting title" << oendl;
574 qDebug(DlglistItemTitle); 578 odebug << DlglistItemTitle << oendl;
575 579
@@ -579,3 +583,3 @@ bool LibraryDialog::setTitle()
579 DlglistItemTitle.replace(DlglistItemTitle.find("]",0,TRUE),1, ")" ); 583 DlglistItemTitle.replace(DlglistItemTitle.find("]",0,TRUE),1, ")" );
580 qDebug("Title being set is "+DlglistItemTitle); 584 odebug << "Title being set is "+DlglistItemTitle << oendl;
581 int test = 0; 585 int test = 0;
@@ -740,3 +744,3 @@ void LibraryDialog::onButtonSearch()
740 texter = SearchResultsDialog->selText; 744 texter = SearchResultsDialog->selText;
741 // qDebug(texter); 745 // odebug << texter << oendl;
742 resultLs= SearchResultsDialog->resultsList; 746 resultLs= SearchResultsDialog->resultsList;
@@ -751,3 +755,3 @@ void LibraryDialog::onButtonSearch()
751 texter.sprintf("%s \n",(*it).latin1()); 755 texter.sprintf("%s \n",(*it).latin1());
752 // qDebug(texter); 756 // odebug << texter << oendl;
753 if( tester!=texter) 757 if( tester!=texter)
@@ -808,3 +812,3 @@ void LibraryDialog::parseSearchResults( QString resultStr)
808 // if (exit==QMessageBox::Yes) { 812 // if (exit==QMessageBox::Yes) {
809 // qDebug("Issuing the command "+cmd); 813 // odebug << "Issuing the command "+cmd << oendl;
810 // #if defined(_WS_WIN_) 814 // #if defined(_WS_WIN_)
@@ -842,3 +846,3 @@ bool LibraryDialog::getItem(QListViewItem *it)
842{ 846{
843 // qDebug("selected getItem"); 847 // odebug << "selected getItem" << oendl;
844 848
@@ -860,3 +864,3 @@ bool LibraryDialog::onButtonDownload()
860{ 864{
861 // qDebug("selected onButtonDownloadz"); 865 // odebug << "selected onButtonDownloadz" << oendl;
862 866
@@ -902,3 +906,3 @@ void LibraryDialog::comboSelect(int index)
902{ 906{
903 // qDebug("we are sorting"); 907 // odebug << "we are sorting" << oendl;
904 ListView1->setSorting( index, TRUE); 908 ListView1->setSorting( index, TRUE);
@@ -932,3 +936,3 @@ void LibraryDialog::newList()
932 if( chdir(QPEApplication::qpeDir()+"etc/gutenbrowser") == 0) { 936 if( chdir(QPEApplication::qpeDir()+"etc/gutenbrowser") == 0) {
933 qDebug("changing dir "+QPEApplication::qpeDir()+"etc/gutenbrowser"); 937 odebug << "changing dir "+QPEApplication::qpeDir()+"etc/gutenbrowser" << oendl;
934 QString gutenindex1 = QPEApplication::qpeDir()+"etc/gutenbrowser/GUTINDEX.ALL"; 938 QString gutenindex1 = QPEApplication::qpeDir()+"etc/gutenbrowser/GUTINDEX.ALL";
@@ -953,3 +957,3 @@ void LibraryDialog::newList()
953 } else { 957 } else {
954 qDebug("Issuing the command\n"+cmd); 958 odebug << "Issuing the command\n"+cmd << oendl;
955 // system(cmd); 959 // system(cmd);
@@ -967,3 +971,3 @@ void LibraryDialog::newList()
967 // if( rename(gutenindex1.latin1(),gutenindex.latin1()) !=0) 971 // if( rename(gutenindex1.latin1(),gutenindex.latin1()) !=0)
968 // qDebug("renaming error"); 972 // odebug << "renaming error" << oendl;
969 // } 973 // }
@@ -1026,3 +1030,3 @@ bool LibraryDialog::moreInfo()
1026 if(titleString.length()>2) { 1030 if(titleString.length()>2) {
1027 qDebug( "Title is "+titleString ); 1031 odebug << "Title is "+titleString << oendl;
1028 titleString.replace( QRegExp("\\s"), "%20"); 1032 titleString.replace( QRegExp("\\s"), "%20");
@@ -1050,3 +1054,3 @@ void LibraryDialog::FindLibrary()
1050 indexLib.setName( new_index); 1054 indexLib.setName( new_index);
1051 qDebug("index file is "+ new_index); 1055 odebug << "index file is "+ new_index << oendl;
1052 Newlibrary(); 1056 Newlibrary();
@@ -1055,3 +1059,3 @@ void LibraryDialog::FindLibrary()
1055 indexLib.setName( old_index); 1059 indexLib.setName( old_index);
1056 qDebug("new index nameis "+ old_index); 1060 odebug << "new index nameis "+ old_index << oendl;
1057 Library(); 1061 Library();