summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2005-02-06 04:30:34 (UTC)
committer llornkcor <llornkcor>2005-02-06 04:30:34 (UTC)
commit60a856903eb688b56c61fa787ac26b6be9f6d6c4 (patch) (unidiff)
tree81848a11c6b006ed4b6ac5a036de8402dde8e25d
parente23dd592fc71aa22c449363231eac2f8ebd2a45b (diff)
downloadopie-60a856903eb688b56c61fa787ac26b6be9f6d6c4.zip
opie-60a856903eb688b56c61fa787ac26b6be9f6d6c4.tar.gz
opie-60a856903eb688b56c61fa787ac26b6be9f6d6c4.tar.bz2
fix #1494 - download of file when search is canceled
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/LibraryDialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
index 3c096ed..7426e80 100644
--- a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
@@ -587,32 +587,35 @@ bool LibraryDialog::setTitle()
587 int test = 0; 587 int test = 0;
588 QString ramble, temp; 588 QString ramble, temp;
589 config.setGroup("Files"); 589 config.setGroup("Files");
590 QString s_numofFiles = config.readEntry("NumberOfFiles", "0" ); 590 QString s_numofFiles = config.readEntry("NumberOfFiles", "0" );
591 int i_numofFiles = s_numofFiles.toInt(); 591 int i_numofFiles = s_numofFiles.toInt();
592 for ( int i = 0; i <= i_numofFiles; i++){ 592 for ( int i = 0; i <= i_numofFiles; i++){
593 temp.setNum( i); 593 temp.setNum( i);
594 ramble = config.readEntry( temp, "" ); 594 ramble = config.readEntry( temp, "" );
595 if( strcmp( ramble, File_Name) == 0){ 595 if( strcmp( ramble, File_Name) == 0){
596 test = 1; 596 test = 1;
597 } 597 }
598 } 598 }
599
600 if(test == 0 ) {
601
599 config.setGroup("Files"); 602 config.setGroup("Files");
600 config.writeEntry( "NumberOfFiles", i_numofFiles +1 ); 603 config.writeEntry( "NumberOfFiles", i_numofFiles +1 );
601 QString interger; 604 QString interger;
602 interger.setNum( i_numofFiles +1); 605 interger.setNum( i_numofFiles +1);
603 config.writeEntry( interger, File_Name); 606 config.writeEntry( interger, File_Name);
604 config.setGroup( "Titles" ); 607 config.setGroup( "Titles" );
605 config.writeEntry( File_Name, DlglistItemTitle); 608 config.writeEntry( File_Name, DlglistItemTitle);
606 609 }
607 test = 0; 610 test = 0;
608 return true; 611 return true;
609} 612}
610 613
611 614
612void LibraryDialog::saveConfig() 615void LibraryDialog::saveConfig()
613{ 616{
614 Config config("Gutenbrowser"); 617 Config config("Gutenbrowser");
615 if( httpBox->isChecked() == TRUE) { 618 if( httpBox->isChecked() == TRUE) {
616 checked = 1; 619 checked = 1;
617 config.setGroup( "Proxy" ); 620 config.setGroup( "Proxy" );
618 config.writeEntry("IsChecked", "TRUE"); 621 config.writeEntry("IsChecked", "TRUE");
@@ -738,24 +741,26 @@ void LibraryDialog::onButtonSearch()
738 tabWidget->setCurrentPage( curTab); 741 tabWidget->setCurrentPage( curTab);
739 742
740 Searchlist.sort(); 743 Searchlist.sort();
741 SearchResultsDlg* SearchResultsDialog; 744 SearchResultsDlg* SearchResultsDialog;
742 SearchResultsDialog = new SearchResultsDlg( searchDlg, "Results Dialog", true, 0 , Searchlist); 745 SearchResultsDialog = new SearchResultsDlg( searchDlg, "Results Dialog", true, 0 , Searchlist);
743 746
744 SearchResultsDialog->showMaximized(); 747 SearchResultsDialog->showMaximized();
745 if( SearchResultsDialog->exec() != 0) { 748 if( SearchResultsDialog->exec() != 0) {
746 texter = SearchResultsDialog->selText; 749 texter = SearchResultsDialog->selText;
747 // odebug << texter << oendl; 750 // odebug << texter << oendl;
748 resultLs= SearchResultsDialog->resultsList; 751 resultLs= SearchResultsDialog->resultsList;
749 i_berger = 1; 752 i_berger = 1;
753 } else {
754 resultLs.clear();
750 } 755 }
751 Searchlist.clear(); 756 Searchlist.clear();
752 757
753 // if(SearchResultsDialog) 758 // if(SearchResultsDialog)
754 // delete SearchResultsDialog; 759 // delete SearchResultsDialog;
755 QString tester; 760 QString tester;
756 for ( QStringList::Iterator it = resultLs.begin(); it != resultLs.end(); ++it ) { 761 for ( QStringList::Iterator it = resultLs.begin(); it != resultLs.end(); ++it ) {
757 texter.sprintf("%s \n",(*it).latin1()); 762 texter.sprintf("%s \n",(*it).latin1());
758 // odebug << texter << oendl; 763 // odebug << texter << oendl;
759 if( tester!=texter) 764 if( tester!=texter)
760 parseSearchResults( texter); 765 parseSearchResults( texter);
761 tester = texter; 766 tester = texter;