author | llornkcor <llornkcor> | 2005-03-01 07:56:26 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-03-01 07:56:26 (UTC) |
commit | 2f2b707684582cfa97c96c5fabab2197a7c7f307 (patch) (side-by-side diff) | |
tree | 72df20aae2b443f649f73e7f983eefe53a54109d /noncore/apps/opie-gutenbrowser/NetworkDialog.cpp | |
parent | e12f0049687c84c24f0b7b737b65df2ed6a500a5 (diff) | |
download | opie-2f2b707684582cfa97c96c5fabab2197a7c7f307.zip opie-2f2b707684582cfa97c96c5fabab2197a7c7f307.tar.gz opie-2f2b707684582cfa97c96c5fabab2197a7c7f307.tar.bz2 |
update to new gutenberg directory structures
Diffstat (limited to 'noncore/apps/opie-gutenbrowser/NetworkDialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-gutenbrowser/NetworkDialog.cpp | 67 |
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 @@ -169,42 +169,41 @@ bool NetworkDialog::downloadFile( QString networkUrl ) // } - 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; + |