mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
window.external: Only export speedDial on qupzilla:speeddial
This commit is contained in:
parent
19f1ed6bfb
commit
a04efdc0be
@ -19,10 +19,12 @@
|
|||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "pluginproxy.h"
|
#include "pluginproxy.h"
|
||||||
#include "speeddial.h"
|
#include "speeddial.h"
|
||||||
|
#include "webpage.h"
|
||||||
#include "searchenginesmanager.h"
|
#include "searchenginesmanager.h"
|
||||||
|
|
||||||
ExternalJsObject::ExternalJsObject(QObject* parent)
|
ExternalJsObject::ExternalJsObject(WebPage *page)
|
||||||
: QObject(parent)
|
: QObject(page)
|
||||||
|
, m_page(page)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +39,10 @@ int ExternalJsObject::IsSearchProviderInstalled(const QString &engineURL)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject* ExternalJsObject::speedDial() const
|
QObject *ExternalJsObject::speedDial() const
|
||||||
{
|
{
|
||||||
|
if (m_page->url().toString() != QL1S("qupzilla:speeddial"))
|
||||||
|
return Q_NULLPTR;
|
||||||
|
|
||||||
return mApp->plugins()->speedDial();
|
return mApp->plugins()->speedDial();
|
||||||
}
|
}
|
||||||
|
@ -20,20 +20,24 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
class WebPage;
|
||||||
|
|
||||||
class ExternalJsObject : public QObject
|
class ExternalJsObject : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QObject* speedDial READ speedDial CONSTANT)
|
Q_PROPERTY(QObject* speedDial READ speedDial CONSTANT)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ExternalJsObject(QObject* parent = 0);
|
explicit ExternalJsObject(WebPage *page);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void AddSearchProvider(const QString &engineUrl);
|
void AddSearchProvider(const QString &engineUrl);
|
||||||
int IsSearchProviderInstalled(const QString &engineURL);
|
int IsSearchProviderInstalled(const QString &engineURL);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QObject* speedDial() const;
|
QObject *speedDial() const;
|
||||||
|
|
||||||
|
WebPage *m_page;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user