From eeff2aa63a3006167542071bd19dd44ffbed8ba2 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 3 Apr 2009 01:45:09 +0200 Subject: Added Comments in main.cpp Fixed loading external sites on new tabs. This costs us a forced initial resizing.. that could be payed (perhaps..)! --- src/application.cpp | 7 +++---- src/main.cpp | 11 ++++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index 3ff931e4..3b73cf56 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -64,7 +64,7 @@ Application::Application() m_mainWindow = new MainWindow(); m_mainWindow->setObjectName("MainWindow"); setWindowIcon(KIcon("rekonq")); - newWebView(); +// newWebView(); m_mainWindow->show(); @@ -86,9 +86,7 @@ int Application::newInstance() if (args->count() > 0) { - KUrl url = MainWindow::guessUrlFromString(args->arg(0)); - mainWindow()->loadUrl(url); - for (int i = 1; i < args->count(); ++i) + for (int i = 0; i < args->count(); ++i) { KUrl url = MainWindow::guessUrlFromString(args->arg(i)); newWebView(); @@ -98,6 +96,7 @@ int Application::newInstance() } else { + newWebView(); mainWindow()->slotHome(); } diff --git a/src/main.cpp b/src/main.cpp index b7cfbb3b..630c38d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -51,11 +51,19 @@ int main(int argc, char **argv) "adjam7@gmail.com" ); + // Initialize command line args KCmdLineArgs::init(argc, argv, &about); + // Define the command line options using KCmdLineOptions KCmdLineOptions options; - options.add("+URL" , ki18n("Location to open")); + + // adding URL option + options.add("+[URL]" , ki18n("Location to open")); + + // Register the supported options KCmdLineArgs::addCmdLineOptions(options); + + // Add options from Application class Application::addCmdLineOptions(); if (!Application::start()) @@ -63,6 +71,7 @@ int main(int argc, char **argv) kWarning() << "rekonq is already running!"; return 0; } + Application app; return app.exec(); } -- cgit v1.2.1