From 925725bfcf0f3ffba5107949bc8424e1fd6d1902 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 21 Dec 2010 21:59:23 +0100 Subject: Icon at the right of the urlbar that allows to add an opensearch engine introduce search icon description file downloaded after validation, not before icons updated when engine added add opensearch xml description files sync desktop file => fix add webshortcut use db_opensearch.json file to track opensearch engines create an opensearch description only when the engine support suggestions remove opensearch description when an engine is deleted in the webshortcut setting dialog popup: disable ok button when webshortcut is already used Lionel Chauvin is the man having done this big, big, big work!! I'm just merging ;) --- src/opensearch/opensearchmanager.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/opensearch/opensearchmanager.h') diff --git a/src/opensearch/opensearchmanager.h b/src/opensearch/opensearchmanager.h index 4f42b4a8..df8e5367 100644 --- a/src/opensearch/opensearchmanager.h +++ b/src/opensearch/opensearchmanager.h @@ -39,6 +39,7 @@ // Qt Includes #include +#include // Forward Declarations class OpenSearchEngine; @@ -59,7 +60,7 @@ class OpenSearchManager : public QObject REQ_DESCRIPTION, IDLE }; - + public: /** * Constructor @@ -76,7 +77,7 @@ public: */ bool isSuggestionAvailable(); - void addOpenSearchEngine(const KUrl &url, const QString &title); + bool engineExists(const KUrl &url); public Q_SLOTS: /** @@ -85,6 +86,8 @@ public Q_SLOTS: * @param searchText the text to be queried to the suggestion service */ void requestSuggestion(const QString &searchText); + void addOpenSearchEngine(const KUrl &url, const QString &title, const QString &shortcut); + void removeDeletedEngines(); private Q_SLOTS: void dataReceived(KIO::Job *job, const QByteArray &data); @@ -96,18 +99,23 @@ Q_SIGNALS: private: QString trimmedEngineName(const QString &engineName) const; - + void loadEngines(); + void saveEngines(); void idleJob(); - + // QString substitutueSearchText(const QString &searchText, const QString &requestURL) const; QByteArray m_jobData; - QMap m_enginesMap; + QMap m_engineCache; + QMap m_engines; + OpenSearchEngine *m_activeEngine; STATE m_state; - + KIO::TransferJob *m_currentJob; + KUrl m_jobUrl; QString _typedText; + QString m_shortcut; }; #endif // OPENSEARCHMANAGER_H -- cgit v1.2.1