summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-gutenbrowser/NetworkDialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/NetworkDialog.cpp67
1 files changed, 33 insertions, 34 deletions
diff --git a/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp b/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
index a321952..ba583ad 100644
--- a/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
@@ -164,52 +164,51 @@ bool NetworkDialog::downloadFile( QString networkUrl )
// successDownload=false;
// msg.sprintf("Unable to change directories "+dir+"\n%s",FtpLastResponse(conn));
// QMessageBox::message("Note",msg);
// FtpQuit(conn);
// return false;
// }
- odebug << "Requesting directory list." << oendl;
- TextLabel3->setText("Getting directory list.");
- qApp->processEvents();
- if (!FtpDir( "./.guten_temp", dir.latin1(), conn) ) {
- msg.sprintf("Unable to list the directory\n"+dir+"\n%s",FtpLastResponse(conn));
- QMessageBox::message("Note",msg);
- successDownload=false;
- FtpQuit(conn);
- return false;
- }
- QFile tmp("./.guten_temp");
- QString s, File_Name;
+ QString File_Name;
- if (tmp.open(IO_ReadOnly)) {
- QTextStream t( &tmp ); // use a text stream
- odebug << "Finding partial filename "+s_partialFileName << oendl;
- while ( !t.eof()) {
- s = t.readLine();
+ if( s_partialFileName.right(4) != ".txt") {
+ TextLabel3->setText("Getting directory list.");
+ qApp->processEvents();
+ if (!FtpDir( "./.guten_temp", dir.latin1(), conn) ) {
+ msg.sprintf("Unable to list the directory\n"+dir+"\n%s",FtpLastResponse(conn));
+ QMessageBox::message("Note",msg);
+ successDownload = false;
+ FtpQuit(conn);
+ return false;
+ }
+ QFile tmp("./.guten_temp");
+ if (tmp.open(IO_ReadOnly)) {
+ QTextStream t( &tmp ); // use a text stream
+ //odebug << "Finding partial filename "+s_partialFileName << oendl;
+ QString s;
- if (s.contains(s_partialFileName, FALSE)) {
- QString str = s.right( (s.length()) - (s.find(s_partialFileName, FALSE)) );
+ while ( !t.eof()) {
+ s = t.readLine();
- if (str.contains(".txt")) {
- File_Name = str;
- odebug << "Found file_name "+ File_Name << oendl;
- break;
- }
-// if (str.contains(".zip")) {
-// File_Name = str;
-// odebug << "Found file_name "+ File_Name << oendl;
-// break;
-// }
+ if (s.contains(s_partialFileName, FALSE)) {
+ QString str = s.right( (s.length()) - (s.find(s_partialFileName, FALSE)) );
- }
- } //end of while loop
- tmp.close();
+ if (str.contains(".txt")) {
+ File_Name = str;
+ //odebug << "Found file_name "+ File_Name << oendl;
+ break;
+ }
+ }
+ } //end of while loop
+ tmp.close();
// tmp.remove(); ///TODO this is for release version Zaurus
+ }
+ } else {
+ File_Name = s_partialFileName;
+ qDebug("new dir " + File_Name);
}
- else
- odebug << "Error opening temp file." << oendl;
+
Config cfg("Gutenbrowser");
cfg.setGroup("General");
QString temp=cfg.readEntry("DownloadDirectory",local_library);
localFileName = temp+File_Name;