From bbd7fa87168e9b976b888b040049877489421754 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Sun, 3 Oct 2021 19:28:26 +0800 Subject: [PATCH] found in dictionaries list widgets --- article_netmgr.cc | 8 +++----- articleview.cc | 9 ++++++++- goldendict.vcxproj | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/article_netmgr.cc b/article_netmgr.cc index 5bab747d..3236a5ea 100644 --- a/article_netmgr.cc +++ b/article_netmgr.cc @@ -290,12 +290,10 @@ QNetworkReply * ArticleNetworkAccessManager::createRequest( Operation op, #endif } -#if QT_VERSION >= 0x050300 // Qt 5.3+ + return op == QNetworkAccessManager::GetOperation || op == QNetworkAccessManager::HeadOperation ? new AllowFrameReply( reply ) : reply; -#else - return reply; -#endif + } sptr< Dictionary::DataRequest > ArticleNetworkAccessManager::getResource( @@ -550,11 +548,11 @@ void BlockedNetworkReply::finishedSlot() LocalSchemeHandler::LocalSchemeHandler(ArticleNetworkAccessManager& articleNetMgr):mManager(articleNetMgr){ } + void LocalSchemeHandler::requestStarted(QWebEngineUrlRequestJob *requestJob) { QUrl url = requestJob->requestUrl(); - QNetworkRequest request; request.setUrl( url ); diff --git a/articleview.cc b/articleview.cc index 10f3db3f..adb60418 100644 --- a/articleview.cc +++ b/articleview.cc @@ -701,7 +701,14 @@ unsigned ArticleView::getGroup( QUrl const & url ) QStringList ArticleView::getArticlesList() { //todo dictid - return QStringList() << getCurrentArticle(); + QStringList dictList; + for (unsigned i = 0; i < allDictionaries.size(); i++) + { + dictList.append( allDictionaries[i]->getId().c_str()); + + } + return dictList; + // return runJavaScriptVariableSafe( ui.definition->page(), "gdArticleContents" ) // .toString().trimmed().split( ' ', QString::SkipEmptyParts ); } diff --git a/goldendict.vcxproj b/goldendict.vcxproj index b3fc2274..07b50e8d 100644 --- a/goldendict.vcxproj +++ b/goldendict.vcxproj @@ -316,7 +316,7 @@ - .;winlibs\include;qtsingleapplication\src;D:\Qt\5.15.2\msvc2019_64\include;D:\Qt\5.15.2\msvc2019_64\include\QtWebEngineWidgets;D:\Qt\5.15.2\msvc2019_64\include\QtQuick;D:\Qt\5.15.2\msvc2019_64\include\QtMultimediaWidgets;D:\Qt\5.15.2\msvc2019_64\include\QtOpenGL;D:\Qt\5.15.2\msvc2019_64\include\QtPrintSupport;D:\Qt\5.15.2\msvc2019_64\include\QtSvg;D:\Qt\5.15.2\msvc2019_64\include\QtWebEngine;D:\Qt\5.15.2\msvc2019_64\include\QtQml;D:\Qt\5.15.2\msvc2019_64\include\QtMultimedia;D:\Qt\5.15.2\msvc2019_64\include\QtWidgets;D:\Qt\5.15.2\msvc2019_64\include\QtSensors;D:\Qt\5.15.2\msvc2019_64\include\QtNetwork;D:\Qt\5.15.2\msvc2019_64\include\QtXml;D:\Qt\5.15.2\msvc2019_64\include\QtGui;D:\Qt\5.15.2\msvc2019_64\include\QtANGLE;D:\Qt\5.15.2\msvc2019_64\include\QtCore;build;..\..\Qt\Qt5.1.0-msvc2012\5.1.0\msvc2012\mkspecs\win32-msvc2012;%(AdditionalIncludeDirectories) + .;winlibs\include;qtsingleapplication\src;D:\Qt\5.15.2\msvc2019_64\include\QtWebEngineCore;D:\Qt\5.15.2\msvc2019_64\include;D:\Qt\5.15.2\msvc2019_64\include\QtWebEngineWidgets;D:\Qt\5.15.2\msvc2019_64\include\QtQuick;D:\Qt\5.15.2\msvc2019_64\include\QtMultimediaWidgets;D:\Qt\5.15.2\msvc2019_64\include\QtOpenGL;D:\Qt\5.15.2\msvc2019_64\include\QtPrintSupport;D:\Qt\5.15.2\msvc2019_64\include\QtSvg;D:\Qt\5.15.2\msvc2019_64\include\QtWebEngine;D:\Qt\5.15.2\msvc2019_64\include\QtQml;D:\Qt\5.15.2\msvc2019_64\include\QtMultimedia;D:\Qt\5.15.2\msvc2019_64\include\QtWidgets;D:\Qt\5.15.2\msvc2019_64\include\QtSensors;D:\Qt\5.15.2\msvc2019_64\include\QtNetwork;D:\Qt\5.15.2\msvc2019_64\include\QtXml;D:\Qt\5.15.2\msvc2019_64\include\QtGui;D:\Qt\5.15.2\msvc2019_64\include\QtANGLE;D:\Qt\5.15.2\msvc2019_64\include\QtCore;build;..\..\Qt\Qt5.1.0-msvc2012\5.1.0\msvc2012\mkspecs\win32-msvc2012;%(AdditionalIncludeDirectories) -Zm200 -w34100 -w34189 %(AdditionalOptions) false ProgramDatabase