summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-08 03:31:27 +0100
committerJonathan Bauer2011-03-08 03:31:27 +0100
commit46861b123982eff4046aa3026facb5a0c1ca4282 (patch)
treea457d9ce7ad4f8ac30c4acc3f4ed886420ce14b3 /src
parentmore (diff)
downloadfbgui-46861b123982eff4046aa3026facb5a0c1ca4282.tar.gz
fbgui-46861b123982eff4046aa3026facb5a0c1ca4282.tar.xz
fbgui-46861b123982eff4046aa3026facb5a0c1ca4282.zip
more
Diffstat (limited to 'src')
-rw-r--r--src/DownloadManager.cpp10
-rw-r--r--src/fbgui.cpp1
2 files changed, 9 insertions, 2 deletions
diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp
index b5c11a2..5d95afc 100644
--- a/src/DownloadManager.cpp
+++ b/src/DownloadManager.cpp
@@ -45,8 +45,14 @@ void DownloadManager::startNextDownload()
QUrl url = dlQ.dequeue();
// Get filename from URL.
QString tmp = url.path();
- outfile.setFileName(tmp.remove(0, tmp.lastIndexOf(QChar('/')) + 1));
-
+ tmp.remove(0, tmp.lastIndexOf(QChar('/')) + 1);
+ outfile.setFileName(downloadDirectory.path() + "/" + tmp);
+ if (outfile.exists()){
+ if (debug) qDebug() << "File already exists. Skipping: " << url.toString();
+ startNextDownload();
+ return;
+ }
+ if (debug) qDebug() << "Saving " << url.toString() << "to " << outfile.fileName();
// If error upon opening, skip this file.
if (!outfile.open(QIODevice::WriteOnly))
{
diff --git a/src/fbgui.cpp b/src/fbgui.cpp
index 0524e5c..6311b86 100644
--- a/src/fbgui.cpp
+++ b/src/fbgui.cpp
@@ -20,6 +20,7 @@ fbgui::fbgui(QApplication *parent)
/* Init JavaScript interface */
JSObject* jso = new JSObject(webView->page()->mainFrame());
+ // this still looks bad..
QObject::connect(jso, SIGNAL(signalQuitAll()), this, SLOT(close()));
QObject::connect(webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()),
jso, SLOT(attachToDOM()));