1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

[OpenSearch] Added support for external.AddSearchProvider js function

This commit is contained in:
nowrep 2014-02-04 00:02:09 +01:00
parent cb99a3154e
commit ffa1e0561f
2 changed files with 15 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#include "mainapplication.h" #include "mainapplication.h"
#include "pluginproxy.h" #include "pluginproxy.h"
#include "speeddial.h" #include "speeddial.h"
#include "searchenginesmanager.h"
#include <QDebug> #include <QDebug>
@ -28,6 +29,17 @@ ExternalJsObject::ExternalJsObject(QObject* parent)
{ {
} }
void ExternalJsObject::AddSearchProvider(const QString &engineUrl)
{
mApp->searchEnginesManager()->addEngine(QUrl(engineUrl));
}
int ExternalJsObject::IsSearchProviderInstalled(const QString &engineURL)
{
qDebug() << "NOT IMPLEMENTED: IsSearchProviderInstalled()" << engineURL;
return 0;
}
QObject* ExternalJsObject::speedDial() QObject* ExternalJsObject::speedDial()
{ {
return m_onSpeedDial ? mApp->plugins()->speedDial() : 0; return m_onSpeedDial ? mApp->plugins()->speedDial() : 0;

View File

@ -29,6 +29,9 @@ public:
explicit ExternalJsObject(QObject* parent = 0); explicit ExternalJsObject(QObject* parent = 0);
public slots: public slots:
void AddSearchProvider(const QString &engineUrl);
int IsSearchProviderInstalled(const QString &engineURL);
QObject* speedDial(); QObject* speedDial();
public: public: