1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

window.external: Only export speedDial on qupzilla:speeddial

This commit is contained in:
David Rosca 2015-08-31 13:17:14 +02:00
parent 19f1ed6bfb
commit a04efdc0be
2 changed files with 14 additions and 5 deletions

View File

@ -19,10 +19,12 @@
#include "mainapplication.h"
#include "pluginproxy.h"
#include "speeddial.h"
#include "webpage.h"
#include "searchenginesmanager.h"
ExternalJsObject::ExternalJsObject(QObject* parent)
: QObject(parent)
ExternalJsObject::ExternalJsObject(WebPage *page)
: QObject(page)
, m_page(page)
{
}
@ -39,5 +41,8 @@ int ExternalJsObject::IsSearchProviderInstalled(const QString &engineURL)
QObject *ExternalJsObject::speedDial() const
{
if (m_page->url().toString() != QL1S("qupzilla:speeddial"))
return Q_NULLPTR;
return mApp->plugins()->speedDial();
}

View File

@ -20,13 +20,15 @@
#include <QObject>
class WebPage;
class ExternalJsObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QObject* speedDial READ speedDial CONSTANT)
public:
explicit ExternalJsObject(QObject* parent = 0);
explicit ExternalJsObject(WebPage *page);
public slots:
void AddSearchProvider(const QString &engineUrl);
@ -35,6 +37,8 @@ public slots:
private:
QObject *speedDial() const;
WebPage *m_page;
};
#endif // EXTERNALJSOBJECT_H