1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

moved Extensions object from plugins to externaljsobject

This commit is contained in:
Anmol Gautam 2018-07-31 14:27:58 +05:30
parent 77e90262af
commit 13ce88b618
4 changed files with 6 additions and 8 deletions

View File

@ -38,7 +38,6 @@ Plugins::Plugins(QObject* parent)
: QObject(parent) : QObject(parent)
, m_pluginsLoaded(false) , m_pluginsLoaded(false)
, m_speedDial(new SpeedDial(this)) , m_speedDial(new SpeedDial(this))
, m_extensions(new Extensions(this))
{ {
loadSettings(); loadSettings();
@ -47,8 +46,6 @@ Plugins::Plugins(QObject* parent)
} }
loadQmlSupport(); loadQmlSupport();
connect(this, &Plugins::refreshedLoadedPlugins, m_extensions, &Extensions::requestReload);
} }
QList<Plugins::Plugin> Plugins::getAvailablePlugins() QList<Plugins::Plugin> Plugins::getAvailablePlugins()

View File

@ -103,9 +103,6 @@ public:
// SpeedDial // SpeedDial
SpeedDial* speedDial() { return m_speedDial; } SpeedDial* speedDial() { return m_speedDial; }
// Extensions
Extensions *extensions() { return m_extensions; }
static PluginSpec createSpec(const DesktopFile &metaData); static PluginSpec createSpec(const DesktopFile &metaData);
static QStringList getDefaultAllowedPlugins(); static QStringList getDefaultAllowedPlugins();
@ -147,7 +144,6 @@ private:
bool m_pluginsLoaded; bool m_pluginsLoaded;
SpeedDial* m_speedDial; SpeedDial* m_speedDial;
Extensions *m_extensions;
QList<PluginInterface*> m_internalPlugins; QList<PluginInterface*> m_internalPlugins;
QLibrary *m_pythonPlugin = nullptr; QLibrary *m_pythonPlugin = nullptr;

View File

@ -23,6 +23,7 @@
#include "webpage.h" #include "webpage.h"
#include "autofilljsobject.h" #include "autofilljsobject.h"
#include "restoremanager.h" #include "restoremanager.h"
#include "extensions.h"
#include "themes.h" #include "themes.h"
#include <QWebChannel> #include <QWebChannel>
@ -33,8 +34,10 @@ ExternalJsObject::ExternalJsObject(WebPage *page)
: QObject(page) : QObject(page)
, m_page(page) , m_page(page)
, m_autoFill(new AutoFillJsObject(this)) , m_autoFill(new AutoFillJsObject(this))
, m_extensions(new Extensions(this))
, m_themes(new Themes(this)) , m_themes(new Themes(this))
{ {
connect(mApp->plugins(), &PluginProxy::refreshedLoadedPlugins, m_extensions, &Extensions::requestReload);
} }
WebPage *ExternalJsObject::page() const WebPage *ExternalJsObject::page() const
@ -90,7 +93,7 @@ QObject *ExternalJsObject::extensions() const
if (m_page->url().toString() != QL1S("falkon:extensions")) if (m_page->url().toString() != QL1S("falkon:extensions"))
return Q_NULLPTR; return Q_NULLPTR;
return mApp->plugins()->extensions(); return m_extensions;
} }
QObject *ExternalJsObject::themes() const QObject *ExternalJsObject::themes() const

View File

@ -24,6 +24,7 @@
class WebPage; class WebPage;
class AutoFillJsObject; class AutoFillJsObject;
class Extensions;
class Themes; class Themes;
class QWebChannel; class QWebChannel;
@ -56,6 +57,7 @@ private:
WebPage *m_page; WebPage *m_page;
AutoFillJsObject *m_autoFill; AutoFillJsObject *m_autoFill;
Extensions *m_extensions;
Themes *m_themes; Themes *m_themes;
}; };