mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 11:37:56 -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 "contentmanagerview.h"
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QWebEngineProfile>
|
||||||
|
#include "kiwixapp.h"
|
||||||
|
|
||||||
ContentManagerView::ContentManagerView(QWidget *parent)
|
ContentManagerView::ContentManagerView(QWidget *parent)
|
||||||
: QWebEngineView(parent)
|
: QWebEngineView(parent)
|
||||||
{
|
{
|
||||||
page()->setWebChannel(&m_webChannel);
|
page()->setWebChannel(&m_webChannel);
|
||||||
|
auto profile = page()->profile();
|
||||||
|
auto app = KiwixApp::instance();
|
||||||
|
profile->installUrlSchemeHandler("zim", app->getSchemeHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QTranslator m_qtTranslator, m_appTranslator;
|
QTranslator m_qtTranslator, m_appTranslator;
|
||||||
|
UrlSchemeHandler m_schemeHandler;
|
||||||
Library m_library;
|
Library m_library;
|
||||||
kiwix::Downloader* mp_downloader;
|
kiwix::Downloader* mp_downloader;
|
||||||
ContentManager m_manager;
|
ContentManager m_manager;
|
||||||
@ -90,7 +91,6 @@ private:
|
|||||||
QWidget* mp_currentSideBar;
|
QWidget* mp_currentSideBar;
|
||||||
QErrorMessage* mp_errorDialog;
|
QErrorMessage* mp_errorDialog;
|
||||||
|
|
||||||
UrlSchemeHandler m_schemeHandler;
|
|
||||||
QAction* mpa_actions[MAX_ACTION];
|
QAction* mpa_actions[MAX_ACTION];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user