author | llornkcor <llornkcor> | 2005-02-28 09:24:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-02-28 09:24:10 (UTC) |
commit | 61fa699140c5efbb6ba0bf2a62f7e8fbf62976be (patch) (unidiff) | |
tree | 7b3695c8a13d694487011526e3ae052b69b6d5fb /noncore | |
parent | 7d4beaf7922f15451da6ba65c2e21fb569887b52 (diff) | |
download | opie-61fa699140c5efbb6ba0bf2a62f7e8fbf62976be.zip opie-61fa699140c5efbb6ba0bf2a62f7e8fbf62976be.tar.gz opie-61fa699140c5efbb6ba0bf2a62f7e8fbf62976be.tar.bz2 |
fix index dl from main view, user 8 bit files by default, do not show audio files
-rw-r--r-- | noncore/apps/opie-gutenbrowser/LibraryDialog.cpp | 27 | ||||
-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | 17 |
2 files changed, 31 insertions, 13 deletions
diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp index 7426e80..549c1d2 100644 --- a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp +++ b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp | |||
@@ -138,9 +138,12 @@ void LibraryDialog::Newlibrary() | |||
138 | if( lastName.find( firstName, 0, true) == -1) // this avoids dup names | 138 | if( lastName.find( firstName, 0, true) == -1) // this avoids dup names |
139 | author=lastName+", "+firstName; | 139 | author=lastName+", "+firstName; |
140 | } | 140 | } |
141 | 141 | ||
142 | if( !number.isEmpty() && (title.find( "reserved",0, FALSE) == -1) && (file.find( "]",0, TRUE) == -1) ) { | 142 | if( !number.isEmpty() |
143 | && (title.find( "reserved",0, FALSE) == -1) | ||
144 | && (file.find( "]",0, TRUE) == -1) | ||
145 | && (title.find( "Audio",0, FALSE) == -1)) { | ||
143 | 146 | ||
144 | // fill string list or something to be able to resort the whole library | 147 | // fill string list or something to be able to resort the whole library |
145 | if( author.isEmpty() ) | 148 | if( author.isEmpty() ) |
146 | QList_Item5 = new QListViewItem( ListView5, /* number,*/ title, author, year, file ); | 149 | QList_Item5 = new QListViewItem( ListView5, /* number,*/ title, author, year, file ); |
@@ -205,10 +208,17 @@ void LibraryDialog::Library() | |||
205 | if(file.left(1).find("[",0,TRUE) != -1) | 208 | if(file.left(1).find("[",0,TRUE) != -1) |
206 | file.remove(1,1); | 209 | file.remove(1,1); |
207 | if( file.find("]",0,TRUE) != -1) | 210 | if( file.find("]",0,TRUE) != -1) |
208 | file = file.left( file.find("]",0,TRUE)); | 211 | file = file.left( file.find("]",0,TRUE)); |
209 | //odebug << "file is "+file << oendl; | 212 | |
210 | /// number = indexLine.mid( indexLine.find( "]", 0, TRUE ) +1, indexLine.find( " ", 0, TRUE )+1 ); | 213 | |
214 | if(file.find("?", 0, false) != -1 ) { | ||
215 | QString tmpfile = file.replace(QRegExp("[?]"), "8"); | ||
216 | // qDebug( "file is now " + tmpfile ); | ||
217 | file = tmpfile; | ||
218 | } | ||
219 | |||
220 | // number = indexLine.mid( indexLine.find( "]", 0, TRUE ) +1, indexLine.find( " ", 0, TRUE )+1 ); | ||
211 | number = indexLine.mid(55,5); | 221 | number = indexLine.mid(55,5); |
212 | number = number.stripWhiteSpace(); | 222 | number = number.stripWhiteSpace(); |
213 | // title = indexLine.mid( indexLine.find(" ", 26, TRUE), indexLine.length() ); | 223 | // title = indexLine.mid( indexLine.find(" ", 26, TRUE), indexLine.length() ); |
214 | title = indexLine.mid( 9, 50 ); | 224 | title = indexLine.mid( 9, 50 ); |
@@ -228,9 +238,11 @@ void LibraryDialog::Library() | |||
228 | if( lastName.find( firstName, 0, true) == -1) // this avoids dup names | 238 | if( lastName.find( firstName, 0, true) == -1) // this avoids dup names |
229 | author=lastName+", "+firstName; | 239 | author=lastName+", "+firstName; |
230 | } | 240 | } |
231 | 241 | ||
232 | if( !number.isEmpty() && (title.find( "reserved",0, FALSE) == -1) /*&& (file.find( "]",0, TRUE))*/ ) { | 242 | if( !number.isEmpty() |
243 | && (title.find( "reserved",0, FALSE) == -1) | ||
244 | &&(title.find( "Audio",0, FALSE) == -1)) { | ||
233 | // fill string list or something to be able to sort by Author | 245 | // fill string list or something to be able to sort by Author |
234 | if( author.isEmpty() ) | 246 | if( author.isEmpty() ) |
235 | QList_Item5 = new QListViewItem( ListView5, /*number, */title, author, year, file ); | 247 | QList_Item5 = new QListViewItem( ListView5, /*number, */title, author, year, file ); |
236 | else { | 248 | else { |
@@ -595,19 +607,16 @@ bool LibraryDialog::setTitle() | |||
595 | if( strcmp( ramble, File_Name) == 0){ | 607 | if( strcmp( ramble, File_Name) == 0){ |
596 | test = 1; | 608 | test = 1; |
597 | } | 609 | } |
598 | } | 610 | } |
599 | |||
600 | if(test == 0 ) { | ||
601 | |||
602 | config.setGroup("Files"); | 611 | config.setGroup("Files"); |
603 | config.writeEntry( "NumberOfFiles", i_numofFiles +1 ); | 612 | config.writeEntry( "NumberOfFiles", i_numofFiles +1 ); |
604 | QString interger; | 613 | QString interger; |
605 | interger.setNum( i_numofFiles +1); | 614 | interger.setNum( i_numofFiles +1); |
606 | config.writeEntry( interger, File_Name); | 615 | config.writeEntry( interger, File_Name); |
607 | config.setGroup( "Titles" ); | 616 | config.setGroup( "Titles" ); |
608 | config.writeEntry( File_Name, DlglistItemTitle); | 617 | config.writeEntry( File_Name, DlglistItemTitle); |
609 | } | 618 | |
610 | test = 0; | 619 | test = 0; |
611 | return true; | 620 | return true; |
612 | } | 621 | } |
613 | 622 | ||
@@ -749,10 +758,8 @@ void LibraryDialog::onButtonSearch() | |||
749 | texter = SearchResultsDialog->selText; | 758 | texter = SearchResultsDialog->selText; |
750 | // odebug << texter << oendl; | 759 | // odebug << texter << oendl; |
751 | resultLs = SearchResultsDialog->resultsList; | 760 | resultLs = SearchResultsDialog->resultsList; |
752 | i_berger = 1; | 761 | i_berger = 1; |
753 | } else { | ||
754 | resultLs.clear(); | ||
755 | } | 762 | } |
756 | Searchlist.clear(); | 763 | Searchlist.clear(); |
757 | 764 | ||
758 | // if(SearchResultsDialog) | 765 | // if(SearchResultsDialog) |
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp index fac21da..c7cdd83 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp +++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | |||
@@ -220,25 +220,36 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) { | |||
220 | chdir(local_library); | 220 | chdir(local_library); |
221 | odebug << "Issuing the system command: " << cmd << "" << oendl; | 221 | odebug << "Issuing the system command: " << cmd << "" << oendl; |
222 | 222 | ||
223 | Output *outDlg; | 223 | Output *outDlg; |
224 | outDlg = new Output(this, tr("Gutenbrowser Output"),FALSE); | 224 | |
225 | outDlg = new Output( 0, tr("Downloading Gutenberg Index...."),TRUE); | ||
226 | |||
225 | outDlg->showMaximized(); | 227 | outDlg->showMaximized(); |
226 | outDlg->show(); | 228 | outDlg->show(); |
227 | qApp->processEvents(); | 229 | qApp->processEvents(); |
228 | FILE *fp; | 230 | FILE *fp; |
229 | char line[130]; | 231 | char line[130]; |
230 | outDlg->OutputEdit->append( tr("Running wget") ); | 232 | outDlg->OutputEdit->append( tr("Running wget") ); |
233 | outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); | ||
231 | sleep(1); | 234 | sleep(1); |
232 | fp = popen( (const char *) cmd, "r"); | 235 | fp = popen( (const char *) cmd, "r"); |
233 | odebug << "Issuing the command\n"+cmd << oendl; | 236 | if ( !fp ) { |
237 | } else { | ||
238 | //odebug << "Issuing the command\n"+cmd << oendl; | ||
234 | // system(cmd); | 239 | // system(cmd); |
235 | while ( fgets( line, sizeof line, fp)) { | 240 | while ( fgets( line, sizeof line, fp)) { |
236 | outDlg->OutputEdit->append(line); | 241 | outDlg->OutputEdit->append(line); |
237 | // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); | 242 | outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); |
238 | } | 243 | } |
239 | pclose(fp); | 244 | pclose(fp); |
245 | outDlg->OutputEdit->append("Finished downloading\n"); | ||
246 | outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); | ||
247 | qApp->processEvents(); | ||
248 | |||
249 | } | ||
240 | outDlg->close(); | 250 | outDlg->close(); |
251 | |||
241 | if(outDlg) | 252 | if(outDlg) |
242 | delete outDlg; | 253 | delete outDlg; |
243 | } else { | 254 | } else { |
244 | if( brow == "Konq") { | 255 | if( brow == "Konq") { |