CefView / QCefView

A Qt Widget encapsulated CEF view based on QWidget
https://cefview.github.io/QCefView/
GNU Lesser General Public License v2.1
527 stars 137 forks source link

[BUG]: QCefDownloadItem::start() path problem #263

Open L-Super opened 1 year ago

L-Super commented 1 year ago

Describe the bug 【Bug描述】

https://github.com/CefView/QCefView/blob/6d42213de75d528916f8b39d97ff711db7bd0586/example/QCefViewTest/DownloadManager.cpp#L25

当我在用QCefViewTest测试QCefDownloadItem 的下载功能时,发现调用start()的时候,如果传入的路径为D:/CppProject/QCefView右斜杠形式时,则会下载失败。改为双斜杠D:\\CppProject\\QCefView形式即可正常下载。

右斜杠形式控制台输出如下:

+++ "CCefClientDelegate::onDownloadUpdated"
--- "CCefClientDelegate::onDownloadUpdated"
+++ "CCefClientDelegate::onBeforeDownload"
onNewDownloadItem suggest name "qtcharts-everywhere-opensource-src-5.15.9.tar.xz"
DownloadManager::AddNewDownloadItem:   id:  1 
   name:  ""
   path:  ""
   percent:  0 %,  4253692 / 0
   canceled:  false
   complete:  false
--- "CCefClientDelegate::onBeforeDownload"
+++ "CCefClientDelegate::onDownloadUpdated"
DownloadManager::UpdateDownloadItem:   id:  1
   name:  ""
   path:  ""
   percent:  0 %,  4253692 / 0
   canceled:  false
   complete:  false
--- "CCefClientDelegate::onDownloadUpdated"
+++ "CCefClientDelegate::onDownloadUpdated"
DownloadManager::UpdateDownloadItem:   id:  1
   name:  ""
   path:  ""
   percent:  0 %,  4253692 / 0
   canceled:  false
   complete:  false
--- "CCefClientDelegate::onDownloadUpdated"
+++ "CCefClientDelegate::onDownloadUpdated"
DownloadManager::UpdateDownloadItem:   id:  1
   name:  ""
   path:  ""
   percent:  0 %,  4253692 / 32768
   canceled:  false
   complete:  false
--- "CCefClientDelegate::onDownloadUpdated"
+++ "CCefClientDelegate::onDownloadUpdated"
DownloadManager::UpdateDownloadItem:   id:  1
   name:  ""
   path:  ""
   percent:  0 %,  4253692 / 0
   canceled:  false
   complete:  false
--- "CCefClientDelegate::onDownloadUpdated"

同时,发现当useDefaultDialog形参为true时,不管路径为哪种形式,打开的对话框都是系统下载文件夹路径(路径可能会有差异),而不是指定的D:\\CppProject\\QCefView\\qtcharts-everywhere-opensource-src-5.15.9.tar.xz路径

item->start("D:\\CppProject\\QCefView\\qtcharts-everywhere-opensource-src-5.15.9.tar.xz", true);

如果不是bug,额外说明一下可能会更好。

Environment 【BUG产生的环境】

Additional context 【更多额外信息】

...