summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-08-20 14:47:36 +0200
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-08-26 07:42:02 +0000
commite0646eee7519554cfec0926911f3dd962697048c (patch)
tree4ce59b8fcfb6184c4631de01620a09ce6b7c8b5a
parent46e904275ef6b53d94f4b646d7262aaa0706f884 (diff)
downloadqtwayland-e0646eee7519554cfec0926911f3dd962697048c.tar.gz
qtwayland-e0646eee7519554cfec0926911f3dd962697048c.tar.bz2
qtwayland-e0646eee7519554cfec0926911f3dd962697048c.zip
Fix QDesktopServices::openUrl when there is no windowmanager integration
Change-Id: I51da06261acfb193a59db34bc2dd25e3452fce8d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r--src/client/qwaylandwindowmanagerintegration.cpp31
-rw-r--r--src/client/qwaylandwindowmanagerintegration_p.h4
2 files changed, 20 insertions, 15 deletions
diff --git a/src/client/qwaylandwindowmanagerintegration.cpp b/src/client/qwaylandwindowmanagerintegration.cpp
index 56fe7c5a..5e8a628b 100644
--- a/src/client/qwaylandwindowmanagerintegration.cpp
+++ b/src/client/qwaylandwindowmanagerintegration.cpp
@@ -127,28 +127,33 @@ QByteArray QWaylandWindowManagerIntegration::desktopEnvironment() const
void QWaylandWindowManagerIntegration::openUrl_helper(const QUrl &url)
{
- if (isInitialized()) {
- QByteArray data = url.toString().toUtf8();
-
- static const int chunkSize = 128;
- while (!data.isEmpty()) {
- QByteArray chunk = data.left(chunkSize);
- data = data.mid(chunkSize);
- open_url(!data.isEmpty(), QString::fromUtf8(chunk));
- }
+ Q_ASSERT(isInitialized());
+ QByteArray data = url.toString().toUtf8();
+
+ static const int chunkSize = 128;
+ while (!data.isEmpty()) {
+ QByteArray chunk = data.left(chunkSize);
+ data = data.mid(chunkSize);
+ open_url(!data.isEmpty(), QString::fromUtf8(chunk));
}
}
bool QWaylandWindowManagerIntegration::openUrl(const QUrl &url)
{
- openUrl_helper(url);
- return true;
+ if (isInitialized()) {
+ openUrl_helper(url);
+ return true;
+ }
+ return QGenericUnixServices::openUrl(url);
}
bool QWaylandWindowManagerIntegration::openDocument(const QUrl &url)
{
- openUrl_helper(url);
- return true;
+ if (isInitialized()) {
+ openUrl_helper(url);
+ return true;
+ }
+ return QGenericUnixServices::openDocument(url);
}
}
diff --git a/src/client/qwaylandwindowmanagerintegration_p.h b/src/client/qwaylandwindowmanagerintegration_p.h
index 612cda43..c5ceb6d5 100644
--- a/src/client/qwaylandwindowmanagerintegration_p.h
+++ b/src/client/qwaylandwindowmanagerintegration_p.h
@@ -38,7 +38,7 @@
#include <QtCore/QScopedPointer>
#include <wayland-client.h>
-#include <qpa/qplatformservices.h>
+#include <QtPlatformSupport/private/qgenericunixservices_p.h>
#include <QtWaylandClient/private/qwayland-windowmanager.h>
#include <QtWaylandClient/private/qwaylandclientexport_p.h>
@@ -52,7 +52,7 @@ class QWaylandDisplay;
class QWaylandWindowManagerIntegrationPrivate;
-class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowManagerIntegration : public QObject, public QPlatformServices, public QtWayland::qt_windowmanager
+class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowManagerIntegration : public QObject, public QGenericUnixServices, public QtWayland::qt_windowmanager
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandWindowManagerIntegration)