Fix QDesktopServices::openUrl when there is no windowmanager integration
Change-Id: I51da06261acfb193a59db34bc2dd25e3452fce8d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
parent
0b71d61d37
commit
eb1fe81b7d
@ -127,28 +127,33 @@ QByteArray QWaylandWindowManagerIntegration::desktopEnvironment() const
|
||||
|
||||
void QWaylandWindowManagerIntegration::openUrl_helper(const QUrl &url)
|
||||
{
|
||||
if (isInitialized()) {
|
||||
QByteArray data = url.toString().toUtf8();
|
||||
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));
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user