diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-02-02 09:34:13 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-02-02 09:34:13 +0100 |
commit | 75abb0c0190b991b0766f56e4823666f9c7326c4 (patch) | |
tree | aa5390fc930b1bc0311ef82d640c0229887177f0 | |
parent | Fixed download system about downloading files with the same name. (diff) | |
download | rekonq-75abb0c0190b991b0766f56e4823666f9c7326c4.tar.xz |
Code Optimization
-rw-r--r-- | src/download.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/download.cpp b/src/download.cpp index e4ee556d..627b11b2 100644 --- a/src/download.cpp +++ b/src/download.cpp @@ -51,7 +51,6 @@ void Download::slotData(KIO::Job *job, const QByteArray& data) void Download::slotResult(KJob * job) { - kDebug(5001); switch (job->error()) { case 0://The download has finished @@ -59,9 +58,9 @@ void Download::slotResult(KJob * job) kDebug(5001) << "Downloading successfully finished: " << m_destUrl.url(); QFile destFile(m_destUrl.path()); int n = 1; + QString fn = destFile.fileName(); while( destFile.exists() ) { - QString fn = QFile(m_destUrl.path()).fileName(); destFile.setFileName( fn + "." + QString::number(n) ); n++; } @@ -75,12 +74,12 @@ void Download::slotResult(KJob * job) } case KIO::ERR_FILE_ALREADY_EXIST: { - kDebug(5001) << "ERROR - File already exists"; + kWarning() << "ERROR - File already exists"; m_data = 0; break; } default: - kDebug(5001) << "We are sorry to say you, that there were errors while downloading :("; + kWarning() << "We are sorry to say you, that there were errors while downloading :("; m_data = 0; break; } |