summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2012-03-21 14:19:44 (GMT)
committerChristian Franke <nobody@nowhere.ws>2012-03-21 14:20:27 (GMT)
commit0a09007bb205c2c22b4b5af6ff60548d680ec41c (patch)
treef79598e872e8dac2a29e449df7be90ddff5cbe5e
parent91cf04d9257908169e59fb052c2a77b65252004f (diff)
make use of requestSearchResults on startpageHEADmaster
-rw-r--r--src/htmls/startpage.html3
-rw-r--r--src/webpage.cpp15
-rw-r--r--src/webpage.h2
3 files changed, 15 insertions, 5 deletions
diff --git a/src/htmls/startpage.html b/src/htmls/startpage.html
index d5f6731..7e42345 100644
--- a/src/htmls/startpage.html
+++ b/src/htmls/startpage.html
@@ -38,8 +38,7 @@
if (string.length == 0)
return;
- var url = window.arora.searchUrl(string);
- window.location.href = url;
+ window.arora.search(string);
}
//]]>
</script>
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 42daf7a..82d4789 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -90,9 +90,20 @@ QObject *JavaScriptAroraObject::currentEngine() const
return ToolbarSearch::openSearchManager()->currentEngine();
}
-QString JavaScriptAroraObject::searchUrl(const QString &string) const
+void JavaScriptAroraObject::search(const QString &string) const
{
- return QString::fromUtf8(ToolbarSearch::openSearchManager()->currentEngine()->searchUrl(string).toEncoded());
+ WebPage *page = qobject_cast<WebPage*>(this->parent());
+ if (!page)
+ return;
+
+ WebView *view = qobject_cast<WebView*>(page->view());
+ if (!view)
+ return;
+
+ OpenSearchEngine *engine = ToolbarSearch::openSearchManager()->currentEngine();
+ engine->setDelegate(view);
+ engine->requestSearchResults(string);
+ engine->setDelegate(0);
}
WebPage::WebPage(QObject *parent)
diff --git a/src/webpage.h b/src/webpage.h
index c3dcba3..ba7cc19 100644
--- a/src/webpage.h
+++ b/src/webpage.h
@@ -62,7 +62,7 @@ public:
public slots:
QString translate(const QString &string);
QObject *currentEngine() const;
- QString searchUrl(const QString &string) const;
+ void search(const QString &string) const;
};
class WebPage : public WebPageProxy