mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-21 02:51:26 -04:00
Add the custom zim UrlSchemeHandler to the contentManager view.
This way, the contentManager can get some information about a zim file using the zim scheme. We have to initialize the m_schemeHandler before the m_manager.
This commit is contained in:
parent
5ca4d8903f
commit
29e27fa5d2
@ -1,10 +1,15 @@
|
||||
#include "contentmanagerview.h"
|
||||
#include <QFile>
|
||||
#include <QWebEngineProfile>
|
||||
#include "kiwixapp.h"
|
||||
|
||||
ContentManagerView::ContentManagerView(QWidget *parent)
|
||||
: QWebEngineView(parent)
|
||||
{
|
||||
page()->setWebChannel(&m_webChannel);
|
||||
auto profile = page()->profile();
|
||||
auto app = KiwixApp::instance();
|
||||
profile->installUrlSchemeHandler("zim", app->getSchemeHandler());
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,6 +82,7 @@ protected:
|
||||
|
||||
private:
|
||||
QTranslator m_qtTranslator, m_appTranslator;
|
||||
UrlSchemeHandler m_schemeHandler;
|
||||
Library m_library;
|
||||
kiwix::Downloader* mp_downloader;
|
||||
ContentManager m_manager;
|
||||
@ -90,7 +91,6 @@ private:
|
||||
QWidget* mp_currentSideBar;
|
||||
QErrorMessage* mp_errorDialog;
|
||||
|
||||
UrlSchemeHandler m_schemeHandler;
|
||||
QAction* mpa_actions[MAX_ACTION];
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user