summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/download_manager_delegate_qt.cpp2
-rw-r--r--src/core/profile_adapter.cpp7
-rw-r--r--src/core/profile_adapter.h1
-rw-r--r--src/core/profile_adapter_client.h2
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp6
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p_p.h1
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp1
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.cpp6
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem_p.h1
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp1
10 files changed, 12 insertions, 16 deletions
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 34e290317..7049b8273 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -298,7 +298,7 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
ProfileAdapterClient::NoReason,
adapterClient,
QFileInfo(suggestedFilePath).fileName(),
- time_t(QDateTime::currentMSecsSinceEpoch())
+ QDateTime::currentMSecsSinceEpoch()
};
for (ProfileAdapterClient *client : qAsConst(clients)) {
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index d421edf00..bccdf1ada 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -715,13 +715,6 @@ QString ProfileAdapter::determineDownloadPath(const QString &downloadDirectory,
return suggestedFilePath;
}
-QString ProfileAdapter::updateDownloadPath(int downloadId, const QString &directory, const QString &fileName)
-{
- download::DownloadItem *download = m_downloadManagerDelegate->findDownloadById(downloadId);
- Q_ASSERT(download);
- return determineDownloadPath(directory, fileName, download->GetStartTime().ToTimeT());
-}
-
#if QT_CONFIG(ssl)
QWebEngineClientCertificateStore *ProfileAdapter::clientCertificateStore()
{
diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h
index 01477d0d9..1b89a8004 100644
--- a/src/core/profile_adapter.h
+++ b/src/core/profile_adapter.h
@@ -214,7 +214,6 @@ public:
{ return m_persistentNotifications; }
QString determineDownloadPath(const QString &downloadDirectory, const QString &suggestedFilename, const time_t &startTime);
- QString updateDownloadPath(int downloadId, const QString &directory, const QString &filename);
private:
void updateCustomUrlSchemeHandlers();
diff --git a/src/core/profile_adapter_client.h b/src/core/profile_adapter_client.h
index dc0f508a1..394f92270 100644
--- a/src/core/profile_adapter_client.h
+++ b/src/core/profile_adapter_client.h
@@ -140,7 +140,7 @@ public:
int downloadInterruptReason;
WebContentsAdapterClient *page;
QString suggestedFileName;
- time_t startTime;
+ qint64 startTime;
};
virtual ~ProfileAdapterClient() { }
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
index 878dddadb..6abd89910 100644
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ b/src/webengine/api/qquickwebenginedownloaditem.cpp
@@ -521,9 +521,9 @@ void QQuickWebEngineDownloadItem::setDownloadDirectory(const QString &directory)
Q_EMIT downloadDirectoryChanged();
}
- QString newFileName = QFileInfo(d->profile->d_ptr->profileAdapter()->updateDownloadPath(d->downloadId,
- d->downloadDirectory,
- d->suggestedFileName)).fileName();
+ QString newFileName = QFileInfo(d->profile->d_ptr->profileAdapter()->determineDownloadPath(d->downloadDirectory,
+ d->suggestedFileName,
+ d->startTime)).fileName();
if (d->downloadFileName != newFileName) {
d->downloadFileName = newFileName;
Q_EMIT pathChanged();
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p_p.h b/src/webengine/api/qquickwebenginedownloaditem_p_p.h
index 51deee18b..1be6434ec 100644
--- a/src/webengine/api/qquickwebenginedownloaditem_p_p.h
+++ b/src/webengine/api/qquickwebenginedownloaditem_p_p.h
@@ -71,6 +71,7 @@ public:
~QQuickWebEngineDownloadItemPrivate();
quint32 downloadId;
+ qint64 startTime;
QQuickWebEngineDownloadItem::DownloadState downloadState;
QQuickWebEngineDownloadItem::SavePageFormat savePageFormat;
QQuickWebEngineDownloadItem::DownloadType type;
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index edad7ec44..834bb6a05 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -245,6 +245,7 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
QQuickWebEngineDownloadItemPrivate *itemPrivate = new QQuickWebEngineDownloadItemPrivate(q, info.url);
itemPrivate->downloadId = info.id;
itemPrivate->downloadState = QQuickWebEngineDownloadItem::DownloadRequested;
+ itemPrivate->startTime = info.startTime;
itemPrivate->totalBytes = info.totalBytes;
itemPrivate->mimeType = info.mimeType;
itemPrivate->downloadDirectory = QFileInfo(info.path).path();
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.cpp b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
index 724249208..fd7d90704 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem.cpp
+++ b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
@@ -599,9 +599,9 @@ void QWebEngineDownloadItem::setDownloadDirectory(const QString &directory)
if (!directory.isEmpty() && d->downloadDirectory != directory)
d->downloadDirectory = directory;
- d->downloadFileName = QFileInfo(d->profile->profileAdapter()->updateDownloadPath(d->downloadId,
- d->downloadDirectory,
- d->suggestedFileName)).fileName();
+ d->downloadFileName = QFileInfo(d->profile->profileAdapter()->determineDownloadPath(d->downloadDirectory,
+ d->suggestedFileName,
+ d->startTime)).fileName();
}
/*!
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem_p.h b/src/webenginewidgets/api/qwebenginedownloaditem_p.h
index 08e478736..034684a00 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem_p.h
+++ b/src/webenginewidgets/api/qwebenginedownloaditem_p.h
@@ -70,6 +70,7 @@ public:
bool downloadFinished;
quint32 downloadId;
+ qint64 startTime;
QWebEngineDownloadItem::DownloadState downloadState;
QWebEngineDownloadItem::SavePageFormat savePageFormat;
QWebEngineDownloadItem::DownloadType type;
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index 09f5ce2fd..470babf8f 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -227,6 +227,7 @@ void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
itemPrivate->downloadId = info.id;
itemPrivate->downloadState = info.accepted ? QWebEngineDownloadItem::DownloadInProgress
: QWebEngineDownloadItem::DownloadRequested;
+ itemPrivate->startTime = info.startTime;
itemPrivate->downloadDirectory = QFileInfo(info.path).path();
itemPrivate->downloadFileName = QFileInfo(info.path).fileName();
itemPrivate->suggestedFileName = info.suggestedFileName;