[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

kenneth at webkit.org kenneth at webkit.org
Thu Feb 4 21:29:28 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 94d1f6b2c1dc91bdab3c8df02ae1f7b659c8b632
Author: kenneth at webkit.org <kenneth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 27 14:21:48 2010 +0000

    Rubberstamped by Simon Hausmann
    
    [Qt] QtLauncher refactoring, separating utility methods.
    
    * QtLauncher/QtLauncher.pro:
    * QtLauncher/main.cpp:
    * QtLauncher/utils.cpp: Added.
    (urlFromUserInput):
    * QtLauncher/utils.h: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53929 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index b2372df..bedea67 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -18,6 +18,18 @@
 
         Rubberstamped by Simon Hausmann
 
+        [Qt] QtLauncher refactoring, separating utility methods.
+
+        * QtLauncher/QtLauncher.pro:
+        * QtLauncher/main.cpp:
+        * QtLauncher/utils.cpp: Added.
+        (urlFromUserInput):
+        * QtLauncher/utils.h: Added.
+
+2010-01-27  Kenneth Rohde Christiansen  <kenneth at webkit.org>
+
+        Rubberstamped by Simon Hausmann
+
         [Qt] Refactor the code in the QtLauncher dealing with HTTP proxy.
 
         * QtLauncher/main.cpp:
diff --git a/WebKitTools/QtLauncher/QtLauncher.pro b/WebKitTools/QtLauncher/QtLauncher.pro
index b1b03cb..150fd59 100644
--- a/WebKitTools/QtLauncher/QtLauncher.pro
+++ b/WebKitTools/QtLauncher/QtLauncher.pro
@@ -1,6 +1,17 @@
 TEMPLATE = app
-SOURCES += main.cpp webpage.cpp urlloader.cpp
-HEADERS += webinspector.h webpage.h urlloader.h
+
+SOURCES += \
+    main.cpp \
+    webpage.cpp \
+    urlloader.cpp \
+    utils.cpp \
+
+HEADERS += \
+    webinspector.h \
+    webpage.h \
+    urlloader.h \
+    utils.h \
+
 CONFIG -= app_bundle
 CONFIG += uitools
 DESTDIR = ../../bin
diff --git a/WebKitTools/QtLauncher/main.cpp b/WebKitTools/QtLauncher/main.cpp
index 629a481..3cbca6f 100644
--- a/WebKitTools/QtLauncher/main.cpp
+++ b/WebKitTools/QtLauncher/main.cpp
@@ -50,6 +50,7 @@
 #include <qwebsettings.h>
 #include <qwebview.h>
 #include "urlloader.h"
+#include "utils.h"
 #include "webinspector.h"
 #include "webpage.h"
 
@@ -57,15 +58,6 @@
 void QWEBKIT_EXPORT qt_drt_garbageCollector_collect();
 #endif
 
-static QUrl urlFromUserInput(const QString& input)
-{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-    return QUrl::fromUserInput(input);
-#else
-    return QUrl(input);
-#endif
-}
-
 class WebView : public QWebView {
     Q_OBJECT
 public:
diff --git a/WebKitTools/QtLauncher/utils.cpp b/WebKitTools/QtLauncher/utils.cpp
new file mode 100644
index 0000000..7013f46
--- /dev/null
+++ b/WebKitTools/QtLauncher/utils.cpp
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils.h"
+
+QUrl urlFromUserInput(const QString& string)
+{
+    QString input(string);
+    QFileInfo fi(input);
+    if (fi.exists() && fi.isRelative())
+        input = fi.absoluteFilePath();
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+    return QUrl::fromUserInput(input);
+#else
+    return QUrl(input);
+#endif
+}
diff --git a/WebKitTools/QtLauncher/utils.h b/WebKitTools/QtLauncher/utils.h
new file mode 100644
index 0000000..afe771e
--- /dev/null
+++ b/WebKitTools/QtLauncher/utils.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef utils_h
+#define utils_h
+
+#include <QtCore>
+
+QUrl urlFromUserInput(const QString& input);
+
+#endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list