From 7c6e73220f3ffe344b7400e95f65198b3cfa7c73 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 23 Jul 2009 12:01:54 +0200 Subject: Another rekonqrun step. Using previous schemes. --- src/rekonqrun.cpp | 8 ++++---- src/rekonqrun.h | 30 +++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/rekonqrun.cpp b/src/rekonqrun.cpp index ecabe9bc..47ff7f27 100644 --- a/src/rekonqrun.cpp +++ b/src/rekonqrun.cpp @@ -50,7 +50,7 @@ RekonqRun::~RekonqRun() } -void RekonqRun::loadUrl(const KUrl& url, const Rekonq::BrowserArguments& browserArgs) +void RekonqRun::loadUrl(const KUrl& url, const Rekonq::OpenType& type) { if (url.isEmpty()) return; @@ -113,7 +113,7 @@ void RekonqRun::loadUrl(const KUrl& url, const Rekonq::BrowserArguments& browser WebView *webView = m_window->newTab(); m_window->currentUrlBar()->setUrl(loadingUrl.prettyUrl()); - switch(browserArgs) + switch(type) { case Rekonq::Default: if (!Rekonq::openTabsBack()) @@ -136,9 +136,9 @@ void RekonqRun::loadUrl(const KUrl& url, const Rekonq::BrowserArguments& browser } -void RekonqRun::loadUrl(const QString& urlString, const Rekonq::BrowserArguments& browserArgs) +void RekonqRun::loadUrl(const QString& urlString, const Rekonq::OpenType& type) { - return loadUrl( guessUrlFromString(urlString), browserArgs ); + return loadUrl( guessUrlFromString(urlString), type ); } diff --git a/src/rekonqrun.h b/src/rekonqrun.h index ee96024b..d5113df1 100644 --- a/src/rekonqrun.h +++ b/src/rekonqrun.h @@ -30,19 +30,31 @@ namespace Rekonq { /** - * @short opening tab behaviour - * Different open tab behaviour + * @short Open link options + * Different modes of opening new tab */ - - enum BrowserArguments + enum OpenType { - Default, ///< follow rekonq settings - New, ///< open tab with focus - Background ///< open tab in the background + Default, ///< open url according to users settings + New, ///< open url in new tab and make it current + Background ///< open url in new tab in background }; } +/** + * RekonqRun is not inherited from KRun or KParts::BrowserRun, as probably expected. + * We (actually) use this class just to find the REAL url to load (and load it!), so it does + * these operations: + * + * - stop loading malformed urls + * - find url scheme on relative urls + * - find right url to load on SearchProviders (Google, Wikipedia, etc.) + * - handle local urls (launches dolphin) + * - guess urls from strings + * +*/ + class RekonqRun : public QObject { Q_OBJECT @@ -55,11 +67,11 @@ public: public slots: void loadUrl( const KUrl& url, - const Rekonq::BrowserArguments& browserArgs = Rekonq::Default + const Rekonq::OpenType& type = Rekonq::Default ); void loadUrl( const QString& urlString, - const Rekonq::BrowserArguments& browserArgs = Rekonq::Default + const Rekonq::OpenType& type = Rekonq::Default ); private: -- cgit v1.2.1