From 281056aedf2097d04fa03b4962cd0865f7088ecc Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 20 May 2015 13:41:28 +0200 Subject: Disambiguate name of QLocalServer used in Browser example. Append Qt version and engine name so that it does not lock out the QtWebKit based browser and allows for comparing different versions of Qt. Remove outdated section within Q_WS_QWS. Change-Id: I754db3ce78eefea88b97960af24ae628093e3c2a Task-number: QTBUG-46233 Reviewed-by: Allan Sandfeld Jensen --- examples/webenginewidgets/browser/browserapplication.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'examples/webenginewidgets/browser/browserapplication.cpp') diff --git a/examples/webenginewidgets/browser/browserapplication.cpp b/examples/webenginewidgets/browser/browserapplication.cpp index 3bc801295..8961bf7fb 100644 --- a/examples/webenginewidgets/browser/browserapplication.cpp +++ b/examples/webenginewidgets/browser/browserapplication.cpp @@ -122,14 +122,8 @@ BrowserApplication::BrowserApplication(int &argc, char **argv) QCoreApplication::setOrganizationName(QLatin1String("Qt")); QCoreApplication::setApplicationName(QLatin1String("demobrowser")); QCoreApplication::setApplicationVersion(QLatin1String("0.1")); -#ifdef Q_WS_QWS - // Use a different server name for QWS so we can run an X11 - // browser and a QWS browser in parallel on the same machine for - // debugging - QString serverName = QCoreApplication::applicationName() + QLatin1String("_qws"); -#else - QString serverName = QCoreApplication::applicationName(); -#endif + QString serverName = QCoreApplication::applicationName() + + QString::fromLatin1(QT_VERSION_STR).remove('.') + QLatin1String("webengine"); QLocalSocket socket; socket.connectToServer(serverName); if (socket.waitForConnected(500)) { -- cgit v1.2.1 From 0b65f3ca378810d3b33345b99bf084124acf3e5f Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Thu, 11 Jun 2015 14:06:13 +0200 Subject: Last minute API review cleanup The getters in QWebEngineDownloadItem were not const. The script collection in QWebEngineProfile was passed by reference, which is not idiomatic of Qt. Change-Id: I9b4218b407288b91a726a711bd2a7e1c1167d99a Reviewed-by: Andras Becsi --- examples/webenginewidgets/browser/browserapplication.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/webenginewidgets/browser/browserapplication.cpp') diff --git a/examples/webenginewidgets/browser/browserapplication.cpp b/examples/webenginewidgets/browser/browserapplication.cpp index 8961bf7fb..ca28b2d0b 100644 --- a/examples/webenginewidgets/browser/browserapplication.cpp +++ b/examples/webenginewidgets/browser/browserapplication.cpp @@ -83,11 +83,11 @@ static void setUserStyleSheet(QWebEngineProfile *profile, const QString &styleSh Q_ASSERT(profile); QString scriptName(QStringLiteral("userStyleSheet")); QWebEngineScript script; - QList styleSheets = profile->scripts().findScripts(scriptName); + QList styleSheets = profile->scripts()->findScripts(scriptName); if (!styleSheets.isEmpty()) script = styleSheets.first(); Q_FOREACH (const QWebEngineScript &s, styleSheets) - profile->scripts().remove(s); + profile->scripts()->remove(s); if (script.isNull()) { script.setName(scriptName); @@ -106,7 +106,7 @@ static void setUserStyleSheet(QWebEngineProfile *profile, const QString &styleSh "css.innerText = \"%1\";"\ "})()").arg(styleSheet); script.setSourceCode(source); - profile->scripts().insert(script); + profile->scripts()->insert(script); // run the script on the already loaded views // this has to be deferred as it could mess with the storage initialization on startup if (mainWindow) -- cgit v1.2.1