From 8242b29dcf4465216f9b87e6e0dbe44087ff49c1 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 16 Mar 2013 14:46:38 +0100 Subject: open url as webapp option --- src/application.cpp | 12 +++++++++--- src/rekonq_defines.h | 3 ++- src/tabwindow/rekonqwindow.cpp | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index a2d428d7..7fe23f20 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -150,9 +150,7 @@ int Application::newInstance() } kDebug() << "URL: " << u; - WebTab *tab = newWebApp(); - connect(tab->page(), SIGNAL(pageCreated(WebPage*)), this, SLOT(pageCreated(WebPage*))); - tab->view()->load(u); + loadUrl(u, Rekonq::WebApp); if (isFirstLoad) { @@ -525,6 +523,14 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) return; } + if (type == Rekonq::WebApp) + { + WebTab *tab = newWebApp(); + connect(tab->page(), SIGNAL(pageCreated(WebPage*)), this, SLOT(pageCreated(WebPage*))); + tab->view()->load(url); + return; + } + Rekonq::OpenType newType = type; // Don't open useless tabs or windows for actions in about: pages if (url.url().contains("about:") && url.url().contains("/")) diff --git a/src/rekonq_defines.h b/src/rekonq_defines.h index a97fe24d..814e7599 100644 --- a/src/rekonq_defines.h +++ b/src/rekonq_defines.h @@ -78,7 +78,8 @@ enum OpenType NewFocusedTab, ///< open url in new tab and focus it NewBackGroundTab, ///< open url in new background tab NewWindow, ///< open url in new window - NewPrivateWindow ///< open url in new private window + NewPrivateWindow, ///< open url in new private window + WebApp ///< open url in a web app window }; /** diff --git a/src/tabwindow/rekonqwindow.cpp b/src/tabwindow/rekonqwindow.cpp index 9d0b0e23..0e4dfd03 100644 --- a/src/tabwindow/rekonqwindow.cpp +++ b/src/tabwindow/rekonqwindow.cpp @@ -134,6 +134,7 @@ void RekonqWindow::loadUrl(const KUrl &url, Rekonq::OpenType type, TabHistory *h { case Rekonq::NewWindow: case Rekonq::NewPrivateWindow: + case Rekonq::WebApp: rApp->loadUrl(url, type); return; -- cgit v1.2.1