summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-05-09 16:59:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-16 13:26:00 +0200
commit9e4cbda50ad3b3bc4b7911f5ec8e2591103e997f (patch)
tree10d95e73a76b0228ec2fbfbe49d0b0b2376b0406
parent05395aa55978ab4cd46916c63f032adf3a1c1587 (diff)
downloadqtwebengine-9e4cbda50ad3b3bc4b7911f5ec8e2591103e997f.tar.gz
Set the QtWebEngine modules version to 0.9.0
Also make sure that this version number appears in the user agent string and in the QML imports. The plan, unlike other Qt modules, is to keep our module and QML versions in sync to make it easy for developers to figure out what API is available in a given version. The QTWEBENGINECORE_VERSION_STR define is explicitly set in the .pro file since we don't call syncqt to generate a version header for the core module. The 0-major version currently causes the library name to start with libQt0 instead of libQt5, but this is something that we can fix in qtbase once we want to officially support linux desktop with QtWebEngine 1.0.0. Change-Id: I31915e84869b4db456416ef1f85a2296b8a06c99 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--.qmake.conf3
-rw-r--r--src/core/core_gyp_generator.pro1
-rw-r--r--src/core/web_engine_context.cpp2
-rw-r--r--src/webengine/plugin/plugin.cpp19
-rw-r--r--tests/quicktestbrowser/FeaturePermissionBar.qml2
-rw-r--r--tests/quicktestbrowser/quickwindow.qml2
6 files changed, 21 insertions, 8 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 9f986403f..aecb86d1c 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -2,5 +2,4 @@ QMAKEPATH += $$PWD/tools/qmake
load(qt_build_config)
CONFIG += qt_example_installs
-# All modules share the same version number. We plan on following Qt's releases for now.
-MODULE_VERSION = 5.2.0
+MODULE_VERSION = 0.9.0
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro
index 2f58664f4..4ac4d0060 100644
--- a/src/core/core_gyp_generator.pro
+++ b/src/core/core_gyp_generator.pro
@@ -17,6 +17,7 @@ QT_PRIVATE += qml-private quick-private gui-private core-private
DEFINES += QT_NO_KEYWORDS \
Q_FORWARD_DECLARE_OBJC_CLASS=QT_FORWARD_DECLARE_CLASS \
QTWEBENGINEPROCESS_NAME=\\\"$$QTWEBENGINEPROCESS_NAME\\\" \
+ QTWEBENGINECORE_VERSION_STR=\\\"$$MODULE_VERSION\\\" \
BUILDING_CHROMIUM
# Keep Skia happy
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index feec45e90..8af675b81 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -130,7 +130,7 @@ WebEngineContext::WebEngineContext()
CommandLine* parsedCommandLine = CommandLine::ForCurrentProcess();
// Mention the Chromium version we're based on to get passed stupid UA-string-based feature detection (several WebRTC demos need this)
- parsedCommandLine->AppendSwitchASCII(switches::kUserAgent, webkit_glue::BuildUserAgentFromProduct("QtWebEngine/0.1 Chrome/" CHROMIUM_VERSION));
+ parsedCommandLine->AppendSwitchASCII(switches::kUserAgent, webkit_glue::BuildUserAgentFromProduct("QtWebEngine/" QTWEBENGINECORE_VERSION_STR " Chrome/" CHROMIUM_VERSION));
parsedCommandLine->AppendSwitchPath(switches::kBrowserSubprocessPath, WebEngineLibraryInfo::getPath(content::CHILD_PROCESS_EXE));
parsedCommandLine->AppendSwitch(switches::kNoSandbox);
parsedCommandLine->AppendSwitch(switches::kDisablePlugins);
diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp
index 2408e5c8e..811f85dde 100644
--- a/src/webengine/plugin/plugin.cpp
+++ b/src/webengine/plugin/plugin.cpp
@@ -41,12 +41,17 @@
#include <QtQml/qqmlextensionplugin.h>
+#include "qtwebengineversion.h"
#include "qquickwebengineview_p.h"
#include "qquickwebengineloadrequest_p.h"
#include "qquickwebenginenewviewrequest_p.h"
QT_BEGIN_NAMESPACE
+class QQuickWebEngineVersionBumper : public QObject {
+ Q_OBJECT
+};
+
class QtWebEnginePlugin : public QQmlExtensionPlugin
{
Q_OBJECT
@@ -56,9 +61,17 @@ public:
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine"));
- qmlRegisterType<QQuickWebEngineView>(uri, 1, 0, "WebEngineView");
- qmlRegisterUncreatableType<QQuickWebEngineLoadRequest>(uri, 1, 0, "WebEngineLoadRequest", QObject::tr("Cannot create separate instance of WebEngineLoadRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineNewViewRequest>(uri, 1, 0, "WebEngineNewViewRequest", QObject::tr("Cannot create separate instance of WebEngineNewViewRequest"));
+ qmlRegisterType<QQuickWebEngineView>(uri, 0, 9, "WebEngineView");
+ qmlRegisterUncreatableType<QQuickWebEngineLoadRequest>(uri, 0, 9, "WebEngineLoadRequest", QObject::tr("Cannot create separate instance of WebEngineLoadRequest"));
+ qmlRegisterUncreatableType<QQuickWebEngineNewViewRequest>(uri, 0, 9, "WebEngineNewViewRequest", QObject::tr("Cannot create separate instance of WebEngineNewViewRequest"));
+
+ // The QML type loader relies on the minimum and maximum minor version of registered types
+ // to validate imports. We want to tie our import version to the module version, so register
+ // a dummy type in order to allow importing the latest version even if it didn't include
+ // an API update that would appear here in a registered type.
+ int major = QTWEBENGINE_VERSION >> 16;
+ int minor = QTWEBENGINE_VERSION >> 8;
+ qmlRegisterUncreatableType<QQuickWebEngineVersionBumper>(uri, major, minor, "WebEngineVersionBumper", QObject::tr("This is a dummy type and cannot be created."));
}
};
diff --git a/tests/quicktestbrowser/FeaturePermissionBar.qml b/tests/quicktestbrowser/FeaturePermissionBar.qml
index dd2e0f714..9b248e31f 100644
--- a/tests/quicktestbrowser/FeaturePermissionBar.qml
+++ b/tests/quicktestbrowser/FeaturePermissionBar.qml
@@ -40,7 +40,7 @@
import QtQuick 2.1
import QtQuick.Controls 1.0
-import QtWebEngine 1.0
+import QtWebEngine 0.9
import QtWebEngine.experimental 1.0
import QtQuick.Layouts 1.0
diff --git a/tests/quicktestbrowser/quickwindow.qml b/tests/quicktestbrowser/quickwindow.qml
index f08469dda..1e54bb429 100644
--- a/tests/quicktestbrowser/quickwindow.qml
+++ b/tests/quicktestbrowser/quickwindow.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.1
-import QtWebEngine 1.0
+import QtWebEngine 0.9
import QtWebEngine.experimental 1.0
import QtQuick.Controls 1.0
import QtQuick.Controls.Styles 1.0