summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/DownloadManager.cpp18
-rw-r--r--src/JSObject.cpp1
2 files changed, 4 insertions, 15 deletions
diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp
index b89a371..33c8952 100644
--- a/src/DownloadManager.cpp
+++ b/src/DownloadManager.cpp
@@ -35,21 +35,11 @@ void DownloadManager::startNextDownload()
}
// Dequeue next URL to download.
QUrl url = dlQ.dequeue();
- QString filepath = url.path();
+ QString tmp = url.path();
// Get filename from URL.
- int i = filepath.lastIndexOf(QChar('/'));
- filepath.remove(0, i + 1);
- qDebug() << "From: " << url.toString() << endl
- << "Parsed: " << filepath;
- outfile.setFileName(filepath);
- /*
- qDebug() << "url.path() is:" << url.path();
- if (basename.isEmpty())
- this->filename = "download";
- else
- this->filename = basename;
- outfile.setFileName(this->filename);
- */
+ tmp.remove(0, tmp.lastIndexOf(QChar('/')) + 1);
+ outfile.setFileName(tmp);
+
// If error upon opening, skip this file.
if (!outfile.open(QIODevice::WriteOnly))
{
diff --git a/src/JSObject.cpp b/src/JSObject.cpp
index 062f4cc..10cffad 100644
--- a/src/JSObject.cpp
+++ b/src/JSObject.cpp
@@ -23,7 +23,6 @@ void JSObject::attachToDOM()
//-------------------------------------------------------------------------------------------------------
void JSObject::startDownload(QString filename)
{
-
if (filename.isEmpty())
{
owner->evaluateJavaScript("alert(\"No filename!\")");