[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

vestbo at webkit.org vestbo at webkit.org
Thu Apr 8 00:18:28 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 80cd11e2e7ff49ce6497a2631767b7b3c135c515
Author: vestbo at webkit.org <vestbo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 4 15:36:34 2009 +0000

    [Qt] Clean up argument parsing in the QtLauncher
    
    Reviewed by Simon Hausmann.
    
    * QtLauncher/main.cpp:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51695 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 9d47212..a1e3ebb 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,11 @@
+2009-12-04  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Clean up argument parsing in the QtLauncher
+
+        * QtLauncher/main.cpp:
+
 2009-12-04  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit/qt/QtLauncher/main.cpp b/WebKit/qt/QtLauncher/main.cpp
index c06d474..e416e37 100644
--- a/WebKit/qt/QtLauncher/main.cpp
+++ b/WebKit/qt/QtLauncher/main.cpp
@@ -565,7 +565,7 @@ int launcherMain(const QApplication& app)
 int main(int argc, char **argv)
 {
     QApplication app(argc, argv);
-    QString url = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
+    QString defaultUrl = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
 
     QWebSettings::setMaximumPagesInCache(4);
 
@@ -599,14 +599,21 @@ int main(int argc, char **argv)
         window->show();
         launcherMain(app);
     } else {
-        if (args.count() > 1)
-            url = args.at(1);
-
-        MainWindow* window = new MainWindow(url);
+        MainWindow* window = 0;
+
+        // Look though the args for something we can open
+        for (int i = 1; i < args.count(); i++) {
+            if (!args.at(i).startsWith("-")) {
+                if (!window)
+                    window = new MainWindow(args.at(i));
+                else
+                    window->newWindow(args.at(i));
+            }
+        }
 
-        // Opens every given urls in new windows
-        for (int i = 2; i < args.count(); i++)
-            window->newWindow(args.at(i));
+        // If not, just open the default URL
+        if (!window)
+            window = new MainWindow(defaultUrl);
 
         window->show();
         launcherMain(app);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list