summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-05 22:47:51 +0100
committerJonathan Bauer2011-03-05 22:47:51 +0100
commit6712b04f22aa55717c32676be04bc2e0df40645b (patch)
tree9023e5e0bd61c59b5a2aabff156180ef7ec5d5a1
parentremoved some old comments (diff)
downloadfbgui-6712b04f22aa55717c32676be04bc2e0df40645b.tar.gz
fbgui-6712b04f22aa55717c32676be04bc2e0df40645b.tar.xz
fbgui-6712b04f22aa55717c32676be04bc2e0df40645b.zip
more random things...
-rw-r--r--src/DownloadManager.cpp9
-rw-r--r--src/fbbrowser.cpp3
-rw-r--r--src/fbgui.cpp4
3 files changed, 5 insertions, 11 deletions
diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp
index 33c8952..d010490 100644
--- a/src/DownloadManager.cpp
+++ b/src/DownloadManager.cpp
@@ -35,10 +35,9 @@ void DownloadManager::startNextDownload()
}
// Dequeue next URL to download.
QUrl url = dlQ.dequeue();
- QString tmp = url.path();
// Get filename from URL.
- tmp.remove(0, tmp.lastIndexOf(QChar('/')) + 1);
- outfile.setFileName(tmp);
+ QString tmp = url.path();
+ outfile.setFileName(tmp.remove(0, tmp.lastIndexOf(QChar('/')) + 1));
// If error upon opening, skip this file.
if (!outfile.open(QIODevice::WriteOnly))
@@ -50,6 +49,7 @@ void DownloadManager::startNextDownload()
// Start the request for this URL.
QNetworkRequest request(url);
currentDownload = qnam->get(request);
+ // TODO: Error handling not working properly...
if (currentDownload->error() != QNetworkReply::NoError)
{
qDebug() << "Network reply error, skipping download...";
@@ -88,7 +88,8 @@ void DownloadManager::downloadFinished()
{
// Second check if the download actually is finished.
if (currentDownload->isFinished())
- qDebug() << "Downloaded " << currentDownload->url().toString() << endl;
+ qDebug() << "Download of " << currentDownload->url().toString()
+ << "finished." << endl;
// Close output file.
outfile.close();
currentDownload->deleteLater();
diff --git a/src/fbbrowser.cpp b/src/fbbrowser.cpp
index 6528cc8..160b9c5 100644
--- a/src/fbbrowser.cpp
+++ b/src/fbbrowser.cpp
@@ -23,9 +23,6 @@ fbbrowser::fbbrowser(const QUrl & url)
// Let the manager send the request and receive the reply.
reply = manager->get(request);
// TODO: error differentiation
- // reply->error() returns 0 even for invalid URL.
- // A possibility to check for validity, is to listen to readyRead()
- // signal, haven't found a better way yet ...
if(reply->error() == QNetworkReply::NoError)
{
view->load(url);
diff --git a/src/fbgui.cpp b/src/fbgui.cpp
index 1851ad4..57df27b 100644
--- a/src/fbgui.cpp
+++ b/src/fbgui.cpp
@@ -45,10 +45,6 @@ int main(int argc, char *argv[])
{
qDebug() << "Help requested. Printing usage info. Exiting...";
printUsage();
- // Not quite sure what the best exit statement is.
- // Maybe better a.quit() ?
- //exit(0);
- // Probably use the EXIT_SUCCESS / EXIT_FAILURE constants as defined in "man exit"
return EXIT_SUCCESS;
}