diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/application.cpp | 15 | ||||
-rw-r--r-- | src/application.h | 3 | ||||
-rw-r--r-- | src/urlbar/urlresolver.cpp | 5 |
4 files changed, 25 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a6658ed0..22419da0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -93,6 +93,7 @@ INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/rekonqpage ${CMAKE_CURRENT_SOURCE_DIR}/settings ${CMAKE_CURRENT_SOURCE_DIR}/analyzer + ${CMAKE_CURRENT_SOURCE_DIR}/search ${CMAKE_CURRENT_BINARY_DIR} ${KDE4_INCLUDES} ${QT4_INCLUDES} @@ -112,6 +113,7 @@ KDE4_ADD_KDEINIT_EXECUTABLE( rekonq ${rekonq_KDEINIT_SRCS} main.cpp ) TARGET_LINK_LIBRARIES ( kdeinit_rekonq ${QT_LIBRARIES} + ${QT_QTSCRIPT_LIBRARY} ${QT_QTWEBKIT_LIBRARY} ${KDE4_KDEWEBKIT_LIBS} ${KDE4_KUTILS_LIBS} diff --git a/src/application.cpp b/src/application.cpp index 8a24014d..231b45b7 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -42,6 +42,7 @@ #include "urlbar.h" #include "sessionmanager.h" #include "adblockmanager.h" +#include "search/opensearchmanager.h" #include "webview.h" #include "filterurljob.h" #include "tabbar.h" @@ -64,6 +65,7 @@ QWeakPointer<HistoryManager> Application::s_historyManager; QWeakPointer<BookmarkProvider> Application::s_bookmarkProvider; QWeakPointer<SessionManager> Application::s_sessionManager; QWeakPointer<AdBlockManager> Application::s_adblockManager; +QWeakPointer<OpenSearchManager> Application::s_opensearchManager; Application::Application() @@ -98,6 +100,9 @@ Application::~Application() delete s_adblockManager.data(); s_adblockManager.clear(); + + delete s_opensearchManager.data(); + s_opensearchManager.clear(); } @@ -315,6 +320,16 @@ SessionManager *Application::sessionManager() } +OpenSearchManager *Application::opensearchManager() +{ + if (s_opensearchManager.isNull()) + { + s_opensearchManager = new OpenSearchManager(instance()); + } + return s_opensearchManager.data(); +} + + KIcon Application::icon(const KUrl &url) { // avoid infinite loop at startup diff --git a/src/application.h b/src/application.h index 18c99afb..11943923 100644 --- a/src/application.h +++ b/src/application.h @@ -50,6 +50,7 @@ class HistoryManager; class MainWindow; class SessionManager; class AdBlockManager; +class OpenSearchManager; class WebView; @@ -111,6 +112,7 @@ public: static BookmarkProvider *bookmarkProvider(); static SessionManager *sessionManager(); static AdBlockManager *adblockManager(); + static OpenSearchManager *opensearchManager(); // DOWNLOADS MANAGEMENT METHODS void addDownload(const QString &srcUrl, const QString &destUrl); @@ -148,6 +150,7 @@ private: static QWeakPointer<BookmarkProvider> s_bookmarkProvider; static QWeakPointer<SessionManager> s_sessionManager; static QWeakPointer<AdBlockManager> s_adblockManager; + static QWeakPointer<OpenSearchManager> s_opensearchManager; MainWindowList m_mainWindows; }; diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index 157e26a2..189a5e46 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -349,6 +349,11 @@ UrlSearchList UrlResolver::bookmarksResolution() // STEP 4 = suggestion completion UrlSearchList UrlResolver::suggestionResolution() { + Application::opensearchManager()->requestSuggestion(); + while (!m_suggestionReceived) + { + Application->instance()->processEvents(QEventLoop::WaitForMore | QEventLoop::ExcludeUserInput); + } UrlSearchList list; UrlSearchItem gItem(UrlSearchItem::Suggestion, "a", "a"); |