summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-09-04 00:19:00 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-09-04 00:19:00 +0200
commit34bc7306e5182efd07ab61d80e30bef5cf45d87c (patch)
tree5adf9b65628a83c55b9ac1c1c83bc0a6e1c718af /src/application.cpp
parentRemoved completion object from UrlBar (diff)
downloadrekonq-34bc7306e5182efd07ab61d80e30bef5cf45d87c.tar.xz
Improving Multi Windows implementation
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 69ba2d28..44b0142e 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -86,14 +86,13 @@ int Application::newInstance()
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
// creating new window
- MainWindow *w = new MainWindow;
- w->setObjectName("MainWindow");
- m_mainWindows.prepend(w);
- w->show();
+ MainWindow *w = newMainWindow();
if (args->count() > 0)
{
- for (int i = 0; i < args->count(); ++i)
+ loadUrl(args->arg(0));
+
+ for (int i = 1; i < args->count(); ++i)
{
loadUrl(args->arg(i), Rekonq::NewCurrentTab);
}
@@ -101,10 +100,9 @@ int Application::newInstance()
}
else
{
- w->mainView()->newTab();
w->slotHome();
}
-
+
return 0;
}
@@ -142,9 +140,7 @@ MainWindow *Application::mainWindow()
if(m_mainWindows.isEmpty())
{
kDebug() << "No extant windows: creating one new...";
- MainWindow *w = new MainWindow();
- m_mainWindows.prepend(w);
- w->show();
+ MainWindow *w = newMainWindow();
QTimer::singleShot(0, this, SLOT(postLaunch()));
return w;
}
@@ -350,3 +346,16 @@ void Application::loadUrl(const QString& urlString, const Rekonq::OpenType& typ
{
return loadUrl( guessUrlFromString(urlString), type );
}
+
+
+MainWindow *Application::newMainWindow()
+{
+ MainWindow *w = new MainWindow();
+ w->mainView()->newTab();
+
+ m_mainWindows.prepend(w);
+ w->show();
+
+ return w;
+}
+