diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-09-25 18:02:23 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:05 +0100 |
commit | 02d9b5fe590303e540c1ff9111e0cfe3194f7e7d (patch) | |
tree | f2515238feb6593efc89621805046cca4d24b968 /src/download | |
parent | Don't overwrite downloads by default (diff) | |
download | rekonq-02d9b5fe590303e540c1ff9111e0cfe3194f7e7d.tar.xz |
New Private Browsing mode :D
Diffstat (limited to 'src/download')
-rw-r--r-- | src/download/downloadmanager.cpp | 17 | ||||
-rw-r--r-- | src/download/downloadmanager.h | 2 |
2 files changed, 7 insertions, 12 deletions
diff --git a/src/download/downloadmanager.cpp b/src/download/downloadmanager.cpp index 560ddb9d..0ee4d672 100644 --- a/src/download/downloadmanager.cpp +++ b/src/download/downloadmanager.cpp @@ -135,10 +135,6 @@ void DownloadManager::init() DownloadItem* DownloadManager::addDownload(KIO::CopyJob *job) { - QWebSettings *globalSettings = QWebSettings::globalSettings(); - if (globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) - return 0; - KIO::CopyJob *cJob = qobject_cast<KIO::CopyJob *>(job); QString downloadFilePath = KStandardDirs::locateLocal("appdata" , "downloads"); @@ -162,10 +158,6 @@ DownloadItem* DownloadManager::addDownload(KIO::CopyJob *job) DownloadItem* DownloadManager::addKGetDownload(const QString &srcUrl, const QString &destUrl) { - QWebSettings *globalSettings = QWebSettings::globalSettings(); - if (globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) - return 0; - QString downloadFilePath = KStandardDirs::locateLocal("appdata" , "downloads"); QFile downloadFile(downloadFilePath); if (!downloadFile.open(QFile::WriteOnly | QFile::Append)) @@ -224,7 +216,7 @@ void DownloadManager::removeDownloadItem(int index) // 1. KGet Integration // 2. Save downloads history bool DownloadManager::downloadResource(const KUrl &srcUrl, const KIO::MetaData &metaData, - QWidget *parent, bool forceDirRequest, const QString &suggestedName) + QWidget *parent, bool forceDirRequest, const QString &suggestedName, bool registerDownload) { KUrl destUrl; @@ -259,7 +251,8 @@ bool DownloadManager::downloadResource(const KUrl &srcUrl, const KIO::MetaData & QDBusMessage transfer = kget.call(QL1S("addTransfer"), srcUrl.prettyUrl(), destUrl.prettyUrl(), true); - addKGetDownload(srcUrl.pathOrUrl(), destUrl.pathOrUrl()); + if (registerDownload) + addKGetDownload(srcUrl.pathOrUrl(), destUrl.pathOrUrl()); return true; } @@ -273,6 +266,8 @@ bool DownloadManager::downloadResource(const KUrl &srcUrl, const KIO::MetaData & job->ui()->setWindow((parent ? parent->window() : 0)); job->ui()->setAutoErrorHandlingEnabled(true); - addDownload(job); + if (registerDownload) + addDownload(job); + return true; } diff --git a/src/download/downloadmanager.h b/src/download/downloadmanager.h index 5ac4d628..22998567 100644 --- a/src/download/downloadmanager.h +++ b/src/download/downloadmanager.h @@ -70,7 +70,7 @@ public: bool clearDownloadsHistory(); bool downloadResource(const KUrl &url, const KIO::MetaData &metaData = KIO::MetaData(), - QWidget *parent = 0, bool forceDirRequest = false, const QString &suggestedName = QString()); + QWidget *parent = 0, bool forceDirRequest = false, const QString &suggestedName = QString(), bool registerDownload = true); void downloadLinksWithKGet(const QVariant &contentList); |