From f8b64fbc38eead48cbccff4f75d11d3224b400dd Mon Sep 17 00:00:00 2001 From: ctrlaltca Date: Tue, 28 Nov 2023 10:38:17 +0100 Subject: Remove QWebEngine usage in core. Rewrite web package manager (#2570) * Remove use of QWebEngine from help module * Rewrite the WebPackageManagementDialog to use an http/json API instead of a webpage; drop QWebEngine usage * Edited repository urls to https://kvirc.github.io/--- src/modules/addon/AddonManagementDialog.cpp | 28 +++--- src/modules/addon/AddonManagementDialog.h | 5 +- src/modules/addon/WebAddonInterfaceDialog.cpp | 9 +- src/modules/addon/WebAddonInterfaceDialog.h | 4 - src/modules/help/HelpWidget.cpp | 137 -------------------------- src/modules/help/HelpWidget.h | 29 ------ src/modules/help/HelpWindow.cpp | 16 --- src/modules/help/HelpWindow.h | 12 +-- src/modules/help/libkvihelp.cpp | 12 --- src/modules/theme/ThemeFunctions.cpp | 6 +- src/modules/theme/ThemeManagementDialog.cpp | 17 +--- src/modules/theme/ThemeManagementDialog.h | 4 - src/modules/theme/WebThemeInterfaceDialog.cpp | 8 +- src/modules/theme/WebThemeInterfaceDialog.h | 4 - 14 files changed, 24 insertions(+), 267 deletions(-) (limited to 'src/modules') diff --git a/src/modules/addon/AddonManagementDialog.cpp b/src/modules/addon/AddonManagementDialog.cpp index 1e2316c7e..bc67931f6 100644 --- a/src/modules/addon/AddonManagementDialog.cpp +++ b/src/modules/addon/AddonManagementDialog.cpp @@ -56,9 +56,7 @@ #include #include -#ifdef COMPILE_WEBENGINE_SUPPORT #include "WebAddonInterfaceDialog.h" -#endif //COMPILE_WEBENGINE_SUPPORT AddonManagementDialog * AddonManagementDialog::m_pInstance = nullptr; extern QRect g_rectManagementDialogGeometry; @@ -98,9 +96,7 @@ AddonManagementDialog::AddonManagementDialog(QWidget * p) setObjectName("Addon manager"); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Addons))); -#ifdef COMPILE_WEBENGINE_SUPPORT m_pWebInterfaceDialog = nullptr; -#endif //COMPILE_WEBENGINE_SUPPORT m_pInstance = this; QGridLayout * g = new QGridLayout(this); @@ -200,10 +196,8 @@ AddonManagementDialog::AddonManagementDialog(QWidget * p) AddonManagementDialog::~AddonManagementDialog() { -#ifdef COMPILE_WEBENGINE_SUPPORT if(m_pWebInterfaceDialog) delete m_pWebInterfaceDialog; -#endif //COMPILE_WEBENGINE_SUPPORT g_rectManagementDialogGeometry = QRect(pos().x(), pos().y(), size().width(), size().height()); m_pInstance = nullptr; } @@ -292,14 +286,22 @@ void AddonManagementDialog::uninstallScript() void AddonManagementDialog::getMoreScripts() { -#ifdef COMPILE_WEBENGINE_SUPPORT if(m_pWebInterfaceDialog) - return; - m_pWebInterfaceDialog = new WebAddonInterfaceDialog(); -#else //!COMPILE_WEBENGINE_SUPPORT - // If change this introducing not-fixed text, remember to escape this using KviQString::escapeKvs()! - KviKvsScript::run("openurl http://www.kvirc.net/?id=addons&version=" KVI_VERSION "." KVI_SOURCES_DATE, g_pActiveWindow); -#endif //!COMPILE_WEBENGINE_SUPPORT + { + m_pWebInterfaceDialog->show(); + } + else + { + m_pWebInterfaceDialog = new WebAddonInterfaceDialog(); + QObject::connect(m_pWebInterfaceDialog, SIGNAL(destroyed()), this, SLOT(webInterfaceDialogDestroyed())); + m_pWebInterfaceDialog->show(); + } +} + +void AddonManagementDialog::webInterfaceDialogDestroyed() +{ + m_pWebInterfaceDialog = nullptr; + fillListView(); } void AddonManagementDialog::installScript() diff --git a/src/modules/addon/AddonManagementDialog.h b/src/modules/addon/AddonManagementDialog.h index 698d87ac2..b233c5630 100644 --- a/src/modules/addon/AddonManagementDialog.h +++ b/src/modules/addon/AddonManagementDialog.h @@ -54,9 +54,7 @@ public: KviKvsScriptAddon * addon() { return m_pAddon; }; }; -#ifdef COMPILE_WEBENGINE_SUPPORT class WebAddonInterfaceDialog; -#endif //COMPILE_WEBENGINE_SUPPORT class AddonManagementDialog : public QWidget { @@ -74,9 +72,7 @@ protected: QToolButton * m_pHelpButton; QToolButton * m_pPackButton; QToolButton * m_pUninstallButton; -#ifdef COMPILE_WEBENGINE_SUPPORT QPointer m_pWebInterfaceDialog; -#endif //COMPILE_WEBENGINE_SUPPORT public: static AddonManagementDialog * instance() { return m_pInstance; }; static void display(bool bTopLevel); @@ -94,6 +90,7 @@ protected slots: void uninstallScript(); void getMoreScripts(); void installScript(); + void webInterfaceDialogDestroyed(); virtual void reject(); }; diff --git a/src/modules/addon/WebAddonInterfaceDialog.cpp b/src/modules/addon/WebAddonInterfaceDialog.cpp index bf6ed8ced..648e20597 100644 --- a/src/modules/addon/WebAddonInterfaceDialog.cpp +++ b/src/modules/addon/WebAddonInterfaceDialog.cpp @@ -24,8 +24,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_WEBENGINE_SUPPORT - #include "WebAddonInterfaceDialog.h" #include "AddonFunctions.h" @@ -41,10 +39,9 @@ WebAddonInterfaceDialog::WebAddonInterfaceDialog(QWidget * par) { setWindowTitle(__tr2qs_ctx("Download Addons - KVIrc", "theme")); - setPackagePageUrl( - QString::fromLatin1("https://www.kvirc.net/app/addons.php?version=" KVI_VERSION "&lang=%1") - .arg(KviLocale::instance()->localeName())); + setPackagePageUrl("https://kvirc.github.io/kvirc-addons/"); } + WebAddonInterfaceDialog::~WebAddonInterfaceDialog() = default; @@ -65,5 +62,3 @@ bool WebAddonInterfaceDialog::packageIsInstalled(const QString & szId, const QSt // FIXME: If the version of the installed addon is lower than allow upgrading! return KviMiscUtils::compareVersions(pAddon->version(), szVersion) < 0; } - -#endif //COMPILE_WEBENGINE_SUPPORT diff --git a/src/modules/addon/WebAddonInterfaceDialog.h b/src/modules/addon/WebAddonInterfaceDialog.h index 79e2c9180..a1a202c37 100644 --- a/src/modules/addon/WebAddonInterfaceDialog.h +++ b/src/modules/addon/WebAddonInterfaceDialog.h @@ -26,8 +26,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_WEBENGINE_SUPPORT - #include "KviWebPackageManagementDialog.h" /// @@ -58,6 +56,4 @@ protected: }; // class WebAddonInterfaceDialog -#endif //COMPILE_WEBENGINE_SUPPORT - #endif //!_WebAddonInterfaceDialog_h_ diff --git a/src/modules/help/HelpWidget.cpp b/src/modules/help/HelpWidget.cpp index 5d9fdfd8a..5ab827a82 100644 --- a/src/modules/help/HelpWidget.cpp +++ b/src/modules/help/HelpWidget.cpp @@ -45,137 +45,6 @@ extern HelpIndex * g_pDocIndex; extern KviPointerList * g_pHelpWindowList; extern KviPointerList * g_pHelpWidgetList; -#ifdef COMPILE_WEBENGINE_SUPPORT -#include -#include - -HelpWidget::HelpWidget(QWidget * par, bool bIsStandalone) - : QWidget(par) -{ - setObjectName("help_widget"); - setMinimumWidth(80); - if(bIsStandalone) - g_pHelpWidgetList->append(this); - m_bIsStandalone = bIsStandalone; - - new QShortcut(QKeySequence::Copy, this, SLOT(slotCopy()), nullptr, Qt::WidgetWithChildrenShortcut); - new QShortcut(QKeySequence::Find, this, SLOT(slotShowHideFind()), nullptr, bIsStandalone ? Qt::WidgetWithChildrenShortcut : Qt::WindowShortcut); - - // layout - m_pLayout = new QVBoxLayout(this); - m_pLayout->setContentsMargins(0, 0, 0, 0); - m_pLayout->setSpacing(0); - setLayout(m_pLayout); - - // upper toolbar - m_pToolBar = new QToolBar(this); - m_pLayout->addWidget(m_pToolBar); - - // webview - m_pTextBrowser = new QWebEngineView(this); - m_pTextBrowser->setObjectName("text_browser"); - m_pTextBrowser->setStyleSheet("QTextBrowser { background-color:white; color:black; }"); - m_pLayout->addWidget(m_pTextBrowser); - connect(m_pTextBrowser, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished(bool))); - - // lower toolbar - m_pToolBarHighlight = new QToolBar(this); - m_pLayout->addWidget(m_pToolBarHighlight); - m_pToolBarHighlight->hide(); - - QLabel * pHighlightLabel = new QLabel(); - pHighlightLabel->setText(__tr2qs("Find: ")); - m_pToolBarHighlight->addWidget(pHighlightLabel); - - m_pFindText = new QLineEdit(); - m_pToolBarHighlight->addWidget(m_pFindText); - connect(m_pFindText, SIGNAL(textChanged(const QString)), this, SLOT(slotTextChanged(const QString))); - - m_pToolBarHighlight->addAction(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPBACK), __tr2qs("Find previous"), this, SLOT(slotFindPrev())); - m_pToolBarHighlight->addAction(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPFORWARD), __tr2qs("Find next"), this, SLOT(slotFindNext())); - m_pToolBarHighlight->addAction(*g_pIconManager->getSmallIcon(KviIconManager::Discard), __tr2qs("Close"), this, SLOT(slotShowHideFind())); - - // upper toolbar contents (depends on webview) - m_pToolBar->addAction(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPINDEX), __tr2qs("Show index"), this, SLOT(showIndex())); - - QAction * pAction; - pAction = m_pTextBrowser->pageAction(QWebEnginePage::Back); - pAction->setIcon(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPBACK)); - m_pToolBar->addAction(pAction); - pAction = m_pTextBrowser->pageAction(QWebEnginePage::Forward); - pAction->setIcon(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPFORWARD)); - m_pToolBar->addAction(pAction); - - m_pToolBar->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Minus)), __tr2qs("Zoom out"), this, SLOT(slotZoomOut())); - m_pToolBar->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Plus)), __tr2qs("Zoom in"), this, SLOT(slotZoomIn())); - - if(bIsStandalone) - { - setAttribute(Qt::WA_DeleteOnClose); - m_pToolBar->addAction(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPCLOSE), __tr2qs("Close"), this, SLOT(close())); - } -} - -void HelpWidget::slotCopy() -{ - m_pTextBrowser->triggerPageAction(QWebEnginePage::Copy); -} - -void HelpWidget::slotShowHideFind() -{ - if(m_pToolBarHighlight->isVisible()) - { - m_pToolBarHighlight->hide(); - m_pTextBrowser->findText(""); - } - else - { - m_pToolBarHighlight->show(); - m_pFindText->setFocus(); - } -} - -void HelpWidget::slotLoadFinished(bool) -{ - m_pTextBrowser->findText(m_pFindText->text()); -} - -void HelpWidget::slotTextChanged(const QString szFind) -{ - m_pTextBrowser->findText(""); - m_pTextBrowser->findText(szFind); -} - -void HelpWidget::slotFindPrev() -{ - m_pTextBrowser->findText(m_pFindText->text(), QWebEnginePage::FindBackward); -} - -void HelpWidget::slotFindNext() -{ - m_pTextBrowser->findText(m_pFindText->text()); -} - -void HelpWidget::slotZoomIn() -{ - kvs_real_t dZoom = m_pTextBrowser->zoomFactor(); - if(dZoom >= 2) - return; - dZoom += 0.05; - m_pTextBrowser->setZoomFactor(dZoom); -} - -void HelpWidget::slotZoomOut() -{ - kvs_real_t dZoom = m_pTextBrowser->zoomFactor(); - if(dZoom <= 0.5) - return; - dZoom -= 0.05; - m_pTextBrowser->setZoomFactor(dZoom); -} - -#else - HelpWidget::HelpWidget(QWidget * par, bool bIsStandalone) : QWidget(par) { @@ -223,8 +92,6 @@ HelpWidget::HelpWidget(QWidget * par, bool bIsStandalone) connect(m_pTextBrowser, SIGNAL(forwardAvailable(bool)), m_pForwardAction, SLOT(setEnabled(bool))); } -#endif - HelpWidget::~HelpWidget() { if(m_bIsStandalone) @@ -238,9 +105,5 @@ void HelpWidget::showIndex() g_pApp->getGlobalKvircDirectory(szHelpDir, KviApplication::Help); dirHelp = QDir(szHelpDir); -#ifdef COMPILE_WEBENGINE_SUPPORT - m_pTextBrowser->load(QUrl::fromLocalFile(dirHelp.absoluteFilePath("index.html"))); -#else m_pTextBrowser->setSource(QUrl::fromLocalFile(dirHelp.absoluteFilePath("index.html"))); -#endif } diff --git a/src/modules/help/HelpWidget.h b/src/modules/help/HelpWidget.h index 732d7a118..420511de0 100644 --- a/src/modules/help/HelpWidget.h +++ b/src/modules/help/HelpWidget.h @@ -27,11 +27,7 @@ #include "HelpIndex.h" #include "kvi_settings.h" -#ifdef COMPILE_WEBENGINE_SUPPORT -#include -#else #include -#endif #include #include #include @@ -48,45 +44,20 @@ public: ~HelpWidget(); private: -#ifdef COMPILE_WEBENGINE_SUPPORT - QVBoxLayout * m_pLayout; - QToolBar * m_pToolBar; - QToolBar * m_pToolBarHighlight; - QLineEdit * m_pFindText; - QWebEngineView * m_pTextBrowser; -#else QVBoxLayout * m_pLayout; QToolBar * m_pToolBar; QAction * m_pBackAction; QAction * m_pForwardAction; QTextBrowser * m_pTextBrowser; -#endif bool m_bIsStandalone; protected slots: void showIndex(); -#ifdef COMPILE_WEBENGINE_SUPPORT - void slotLoadFinished(bool ok); - void slotFindNext(); - void slotFindPrev(); - void slotZoomIn(); - void slotZoomOut(); - void slotTextChanged(const QString); - void slotCopy(); - void slotShowHideFind(); -#endif public: -#ifdef COMPILE_WEBENGINE_SUPPORT - QWebEngineView * textBrowser() - { - return m_pTextBrowser; - } -#else QTextBrowser * textBrowser() { return m_pTextBrowser; } -#endif }; #endif //_HELPWIDGET_H_ diff --git a/src/modules/help/HelpWindow.cpp b/src/modules/help/HelpWindow.cpp index 8c05461e0..f48778a36 100644 --- a/src/modules/help/HelpWindow.cpp +++ b/src/modules/help/HelpWindow.cpp @@ -268,11 +268,7 @@ void HelpWindow::startSearch() setCursor(Qt::ArrowCursor); } -#ifdef COMPILE_WEBENGINE_SUPPORT -QWebEngineView * HelpWindow::textBrowser() -#else QTextBrowser * HelpWindow::textBrowser() -#endif { return m_pHelpWidget->textBrowser(); } @@ -282,11 +278,7 @@ void HelpWindow::showIndexTopic() if(m_pIndexSearch->text().isEmpty() || !m_pIndexListWidget->selectedItems().count()) return; int i = g_pDocIndex->titlesList().indexOf(m_pIndexListWidget->selectedItems().at(0)->text()); -#ifdef COMPILE_WEBENGINE_SUPPORT - textBrowser()->load(QUrl(g_pDocIndex->documentList()[i])); -#else textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[i])); -#endif } void HelpWindow::searchInIndex(const QString & s) @@ -311,11 +303,7 @@ void HelpWindow::indexSelected(QListWidgetItem * item) if(!item) return; int i = g_pDocIndex->titlesList().indexOf(item->text()); -#ifdef COMPILE_WEBENGINE_SUPPORT - textBrowser()->load(QUrl(g_pDocIndex->documentList()[i])); -#else textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[i])); -#endif } void HelpWindow::searchSelected(QListWidgetItem * item) @@ -323,11 +311,7 @@ void HelpWindow::searchSelected(QListWidgetItem * item) if(!item) return; int i = g_pDocIndex->titlesList().indexOf(item->text()); -#ifdef COMPILE_WEBENGINE_SUPPORT - textBrowser()->load(QUrl(g_pDocIndex->documentList()[i])); -#else textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[i])); -#endif } QPixmap * HelpWindow::myIconPtr() diff --git a/src/modules/help/HelpWindow.h b/src/modules/help/HelpWindow.h index 25de74611..4aee40f69 100644 --- a/src/modules/help/HelpWindow.h +++ b/src/modules/help/HelpWindow.h @@ -31,17 +31,11 @@ #include "kvi_settings.h" #include -#ifdef COMPILE_WEBENGINE_SUPPORT -#include -#else -class QTextBrowser; -#endif - #include +class QTextBrowser; class QProgressBar; class QPushButton; - class HelpWidget; class HelpWindow : public KviWindow @@ -79,11 +73,7 @@ protected: void loadProperties(KviConfigurationFile * cfg) override; public: -#ifdef COMPILE_WEBENGINE_SUPPORT - QWebEngineView * textBrowser(); -#else QTextBrowser * textBrowser(); -#endif public slots: void indexSelected(QListWidgetItem *); void searchInIndex(const QString & s); diff --git a/src/modules/help/libkvihelp.cpp b/src/modules/help/libkvihelp.cpp index 7eeb4e57e..9c0b5e583 100644 --- a/src/modules/help/libkvihelp.cpp +++ b/src/modules/help/libkvihelp.cpp @@ -185,11 +185,7 @@ static bool help_kvs_cmd_open(KviKvsModuleCommandCall * c) if(w) { -#ifdef COMPILE_WEBENGINE_SUPPORT - w->textBrowser()->load(QUrl::fromLocalFile(f.absoluteFilePath())); -#else w->textBrowser()->setSource(QUrl::fromLocalFile(f.absoluteFilePath())); -#endif HelpWindow * pHelpWindow = g_pHelpWindowList->first(); if (pHelpWindow) pHelpWindow->delayedAutoRaise(); @@ -199,21 +195,13 @@ static bool help_kvs_cmd_open(KviKvsModuleCommandCall * c) if(c->switches()->find('m', "mdi")) { HelpWindow * w = new HelpWindow("Help browser"); -#ifdef COMPILE_WEBENGINE_SUPPORT - w->textBrowser()->load(QUrl::fromLocalFile(f.absoluteFilePath())); -#else w->textBrowser()->setSource(QUrl::fromLocalFile(f.absoluteFilePath())); -#endif g_pMainWindow->addWindow(w); } else { HelpWidget * w = new HelpWidget(g_pMainWindow->splitter(), true); -#ifdef COMPILE_WEBENGINE_SUPPORT - w->textBrowser()->load(QUrl::fromLocalFile(f.absoluteFilePath())); -#else w->textBrowser()->setSource(QUrl::fromLocalFile(f.absoluteFilePath())); -#endif w->show(); } diff --git a/src/modules/theme/ThemeFunctions.cpp b/src/modules/theme/ThemeFunctions.cpp index 0583e9a5a..0d458e416 100644 --- a/src/modules/theme/ThemeFunctions.cpp +++ b/src/modules/theme/ThemeFunctions.cpp @@ -144,7 +144,7 @@ namespace ThemeFunctions r.getStringInfoField("Date", szPackageDate); QString szWarnings; - QString szDetails = ""; + QString szDetails = ""; QString szTmp; int iIdx = 0; @@ -237,8 +237,8 @@ namespace ThemeFunctions // clang-format off hd.szHtmlText = QString( - "" \ - "" \ + "" \ + "" \ "

" \ "

%1 %2

" \ "

" \ diff --git a/src/modules/theme/ThemeManagementDialog.cpp b/src/modules/theme/ThemeManagementDialog.cpp index fb6317000..644197c16 100644 --- a/src/modules/theme/ThemeManagementDialog.cpp +++ b/src/modules/theme/ThemeManagementDialog.cpp @@ -23,10 +23,7 @@ //============================================================================= #include "kvi_settings.h" -#if defined(COMPILE_WEBENGINE_SUPPORT) #include "WebThemeInterfaceDialog.h" -#endif - #include "ThemeManagementDialog.h" #include "PackThemeDialog.h" #include "SaveThemeDialog.h" @@ -113,9 +110,8 @@ ThemeManagementDialog::ThemeManagementDialog(QWidget * parent) : QWidget(parent) { m_pItemDelegate = nullptr; -#ifdef COMPILE_WEBENGINE_SUPPORT m_pWebThemeInterfaceDialog = nullptr; -#endif + setObjectName("theme_options_widget"); setWindowTitle(__tr2qs_ctx("Manage Themes - KVIrc", "theme")); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Theme))); @@ -144,7 +140,6 @@ ThemeManagementDialog::ThemeManagementDialog(QWidget * parent) m_pPackThemeButton = new QToolButton(pHBox); m_pPackThemeButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_PACK))); - m_pPackThemeButton->setIconSize(QSize(32, 32)); m_pPackThemeButton->setToolTip(__tr2qs_ctx("Export selected themes to a distributable package", "theme")); connect(m_pPackThemeButton, SIGNAL(clicked()), this, SLOT(packTheme())); @@ -241,13 +236,11 @@ ThemeManagementDialog::~ThemeManagementDialog() delete m_pItemDelegate; g_rectManagementDialogGeometry = QRect(pos().x(), pos().y(), size().width(), size().height()); m_pInstance = nullptr; -#ifdef COMPILE_WEBENGINE_SUPPORT if(m_pWebThemeInterfaceDialog) { m_pWebThemeInterfaceDialog->deleteLater(); m_pWebThemeInterfaceDialog = nullptr; } -#endif //COMPILE_WEBENGINE_SUPPORT } void ThemeManagementDialog::closeClicked() @@ -418,7 +411,6 @@ void ThemeManagementDialog::installFromFile() void ThemeManagementDialog::getMoreThemes() { -#ifdef COMPILE_WEBENGINE_SUPPORT if(m_pWebThemeInterfaceDialog) { m_pWebThemeInterfaceDialog->show(); @@ -429,18 +421,11 @@ void ThemeManagementDialog::getMoreThemes() QObject::connect(m_pWebThemeInterfaceDialog, SIGNAL(destroyed()), this, SLOT(webThemeInterfaceDialogDestroyed())); m_pWebThemeInterfaceDialog->show(); } -#else - if(!g_pMainWindow) - return; - g_pMainWindow->executeInternalCommand(KVI_INTERNALCOMMAND_OPENURL_KVIRC_THEMES); -#endif } void ThemeManagementDialog::webThemeInterfaceDialogDestroyed() { -#ifdef COMPILE_WEBENGINE_SUPPORT m_pWebThemeInterfaceDialog = nullptr; -#endif fillThemeBox(); } diff --git a/src/modules/theme/ThemeManagementDialog.h b/src/modules/theme/ThemeManagementDialog.h index 743cd160a..e82dbbcde 100644 --- a/src/modules/theme/ThemeManagementDialog.h +++ b/src/modules/theme/ThemeManagementDialog.h @@ -39,9 +39,7 @@ #include #include "kvi_settings.h" -#if defined(COMPILE_WEBENGINE_SUPPORT) || defined(Q_MOC_RUN) #include "WebThemeInterfaceDialog.h" -#endif class QLineEdit; class QPushButton; @@ -76,9 +74,7 @@ protected: QMenu * m_pContextPopup; QToolButton * m_pDeleteThemeButton; QToolButton * m_pPackThemeButton; -#if defined(COMPILE_WEBENGINE_SUPPORT) || defined(Q_MOC_RUN) WebThemeInterfaceDialog * m_pWebThemeInterfaceDialog; -#endif public: static ThemeManagementDialog * instance() { return m_pInstance; } static void display(bool bTopLevel); diff --git a/src/modules/theme/WebThemeInterfaceDialog.cpp b/src/modules/theme/WebThemeInterfaceDialog.cpp index e6eb16711..84c177845 100644 --- a/src/modules/theme/WebThemeInterfaceDialog.cpp +++ b/src/modules/theme/WebThemeInterfaceDialog.cpp @@ -24,8 +24,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_WEBENGINE_SUPPORT - #include "WebThemeInterfaceDialog.h" #include "ThemeFunctions.h" @@ -48,9 +46,7 @@ WebThemeInterfaceDialog::WebThemeInterfaceDialog(QWidget * par) g_pApp->getGlobalKvircDirectory(m_szGlobalThemesPath, KviApplication::Themes); m_szGlobalThemesPath += KVI_PATH_SEPARATOR_CHAR; - setPackagePageUrl( - QString::fromLatin1("https://www.kvirc.net/app/themes.php?version=" KVI_VERSION "&lang=%1") - .arg(KviLocale::instance()->localeName())); + setPackagePageUrl("https://kvirc.github.io/kvirc-themes/"); } WebThemeInterfaceDialog::~WebThemeInterfaceDialog() = default; @@ -67,5 +63,3 @@ bool WebThemeInterfaceDialog::packageIsInstalled(const QString & szId, const QSt return KviFileUtils::fileExists(m_szGlobalThemesPath + szSubdir) || KviFileUtils::fileExists(m_szLocalThemesPath + szSubdir); } - -#endif //COMPILE_WEBENGINE_SUPPORT diff --git a/src/modules/theme/WebThemeInterfaceDialog.h b/src/modules/theme/WebThemeInterfaceDialog.h index c71827391..1db0b18cb 100644 --- a/src/modules/theme/WebThemeInterfaceDialog.h +++ b/src/modules/theme/WebThemeInterfaceDialog.h @@ -26,8 +26,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_WEBENGINE_SUPPORT - #include "KviWebPackageManagementDialog.h" class WebThemeInterfaceDialog : public KviWebPackageManagementDialog @@ -46,6 +44,4 @@ protected: bool installPackage(const QString & szPath, QString & szError) override; }; -#endif //COMPILE_WEBENGINE_SUPPORT - #endif //_WEBTHEMEINTERFACEDIALOG_H_ -- cgit v1.3.1-10-gc9f91