Commit aefcf710 authored by kenneth@webkit.org's avatar kenneth@webkit.org

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
parent 260364fb
......@@ -14,6 +14,18 @@
* Scripts/webkitpy/commands/upload_unittest.py: ditto
* Scripts/webkitpy/mock_bugzillatool.py: log when user.open_url is called.
2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
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@webkit.org>
Rubberstamped by Simon Hausmann
......
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
......
......@@ -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:
......
/*
* 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
}
/*
* 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment