summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/browser_context_adapter_client.h2
-rw-r--r--src/core/download_manager_delegate_qt.cpp11
2 files changed, 6 insertions, 7 deletions
diff --git a/src/core/browser_context_adapter_client.h b/src/core/browser_context_adapter_client.h
index ff65f0c8f..a9e7eb726 100644
--- a/src/core/browser_context_adapter_client.h
+++ b/src/core/browser_context_adapter_client.h
@@ -64,7 +64,7 @@ public:
const qint64 receivedBytes;
QString path;
- bool cancelled;
+ bool accepted;
};
virtual ~BrowserContextAdapterClient() { }
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 73a0976da..3ef8cc9af 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -126,7 +126,6 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(content::DownloadItem* i
item->AddObserver(this);
if (m_contextAdapter->client()) {
- bool cancelled = false;
BrowserContextAdapterClient::DownloadItemInfo info = {
item->GetId(),
toQt(item->GetURL()),
@@ -134,18 +133,18 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(content::DownloadItem* i
item->GetTotalBytes(),
item->GetReceivedBytes(),
suggestedFilePath,
- cancelled
+ false /* accepted */
};
m_contextAdapter->client()->downloadRequested(info);
suggestedFile.setFile(info.path);
- if (!info.cancelled && !suggestedFile.absoluteDir().mkpath(suggestedFile.absolutePath())) {
+ if (info.accepted && !suggestedFile.absoluteDir().mkpath(suggestedFile.absolutePath())) {
qWarning("Creating download path failed, download cancelled: %s", suggestedFile.absolutePath().toUtf8().data());
- cancelled = true;
+ info.accepted = false;
}
- if (info.cancelled) {
+ if (!info.accepted) {
cancelDownload(callback);
return true;
}
@@ -180,7 +179,7 @@ void DownloadManagerDelegateQt::OnDownloadUpdated(content::DownloadItem *downloa
download->GetTotalBytes(),
download->GetReceivedBytes(),
QString(),
- false
+ true /* accepted */
};
m_contextAdapter->client()->downloadUpdated(info);
}