From 5c049a00fd9c799ea332436267ba1b85bc08fa1e Mon Sep 17 00:00:00 2001 From: megabigbug Date: Sun, 15 Aug 2010 08:37:16 +0200 Subject: wait signal --- src/CMakeLists.txt | 2 ++ src/application.cpp | 15 +++++++++++++++ src/application.h | 3 +++ src/urlbar/urlresolver.cpp | 5 +++++ 4 files changed, 25 insertions(+) (limited to 'src') 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 Application::s_historyManager; QWeakPointer Application::s_bookmarkProvider; QWeakPointer Application::s_sessionManager; QWeakPointer Application::s_adblockManager; +QWeakPointer 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 s_bookmarkProvider; static QWeakPointer s_sessionManager; static QWeakPointer s_adblockManager; + static QWeakPointer 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"); -- cgit v1.2.1