Diffstat (limited to 'noncore/apps/opie-gutenbrowser/NetworkDialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-gutenbrowser/NetworkDialog.cpp | 25 |
1 files changed, 12 insertions, 13 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 @@ -158,64 +158,63 @@ bool NetworkDialog::downloadFile( QString networkUrl ) msg.sprintf("Unable to change directories "+dir+"\n%s",FtpLastResponse(conn)); QMessageBox::message("Note",msg); FtpQuit(conn); return false; } // if (!FtpNlst( "./.guten_temp", dir, conn)) { // 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; + QString File_Name; + + 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"); - QString s, File_Name; - if (tmp.open(IO_ReadOnly)) { QTextStream t( &tmp ); // use a text stream - odebug << "Finding partial filename "+s_partialFileName << oendl; + //odebug << "Finding partial filename "+s_partialFileName << oendl; + QString s; + while ( !t.eof()) { s = t.readLine(); if (s.contains(s_partialFileName, FALSE)) { QString str = s.right( (s.length()) - (s.find(s_partialFileName, FALSE)) ); if (str.contains(".txt")) { File_Name = str; - odebug << "Found file_name "+ File_Name << oendl; + //odebug << "Found file_name "+ File_Name << oendl; break; } -// if (str.contains(".zip")) { -// 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 - odebug << "Error opening temp file." << oendl; + } else { + File_Name = s_partialFileName; + qDebug("new dir " + File_Name); + } + Config cfg("Gutenbrowser"); cfg.setGroup("General"); QString temp=cfg.readEntry("DownloadDirectory",local_library); localFileName = temp+File_Name; odebug << "Requesting file "+ File_Name << oendl; odebug << "Saving as "+localFileName << oendl; msg="Requesting file "+ File_Name; TextLabel3->setText(msg); qApp->processEvents(); if( File_Name.length()>3) { |