summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <[email protected]>2024-12-05 13:45:38 +0100
committerLiang Qi <[email protected]>2025-01-21 18:00:53 +0100
commit3e29267df0e2f332290caad69e5bd5cfd61cf3da (patch)
tree4ab463605e7ff7c8e22c8ae8dfd1ec10447b94f0
parentf8d0e4798c0d2985dbe5f8515a8281c9109ef6c4 (diff)
platforms: rename QGenericUnixServices to QDesktopUnixServices
The implementation follows XDG Desktop Portal mostly, and is for desktop, not generic unix. Task-number: QTBUG-130884 Pick-to: 6.9 Change-Id: I88456abb37b8b23cfec00ee8eac8ffee9a65ed9f Reviewed-by: Tor Arne Vestbø <[email protected]>
-rw-r--r--src/gui/CMakeLists.txt2
-rw-r--r--src/gui/platform/unix/dbusmenu/qdbusmenubar.cpp6
-rw-r--r--src/gui/platform/unix/qdesktopunixservices.cpp (renamed from src/gui/platform/unix/qgenericunixservices.cpp)38
-rw-r--r--src/gui/platform/unix/qdesktopunixservices_p.h (renamed from src/gui/platform/unix/qgenericunixservices_p.h)12
-rw-r--r--src/plugins/platforms/vnc/qvncintegration.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp6
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp4
-rw-r--r--src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp4
8 files changed, 38 insertions, 38 deletions
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index adfb7aeab58..e6c9875ce2f 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -1028,7 +1028,7 @@ qt_internal_extend_target(Gui CONDITION QT_FEATURE_glib AND UNIX
qt_internal_extend_target(Gui CONDITION UNIX AND (QT_FEATURE_xcb OR NOT UIKIT)
SOURCES
- platform/unix/qgenericunixservices.cpp platform/unix/qgenericunixservices_p.h
+ platform/unix/qdesktopunixservices.cpp platform/unix/qdesktopunixservices_p.h
)
qt_internal_extend_target(Gui CONDITION UNIX AND (QT_FEATURE_xcb)
diff --git a/src/gui/platform/unix/dbusmenu/qdbusmenubar.cpp b/src/gui/platform/unix/dbusmenu/qdbusmenubar.cpp
index 862b60f12d0..6fa0e8b36af 100644
--- a/src/gui/platform/unix/dbusmenu/qdbusmenubar.cpp
+++ b/src/gui/platform/unix/dbusmenu/qdbusmenubar.cpp
@@ -5,7 +5,7 @@
#include "qdbusmenuregistrarproxy_p.h"
#include <private/qguiapplication_p.h>
-#include <private/qgenericunixservices_p.h>
+#include <private/qdesktopunixservices_p.h>
#include <qpa/qplatformintegration.h>
QT_BEGIN_NAMESPACE
@@ -127,7 +127,7 @@ void QDBusMenuBar::registerMenuBar()
connection.unregisterObject(m_objectPath);
return;
}
- const auto unixServices = dynamic_cast<QGenericUnixServices *>(
+ const auto unixServices = dynamic_cast<QDesktopUnixServices *>(
QGuiApplicationPrivate::platformIntegration()->services());
unixServices->registerDBusMenuForWindow(m_window, connection.baseService(), m_objectPath);
}
@@ -144,7 +144,7 @@ void QDBusMenuBar::unregisterMenuBar()
qWarning("Failed to unregister window menu, reason: %s (\"%s\")",
qUtf8Printable(r.error().name()), qUtf8Printable(r.error().message()));
- const auto unixServices = dynamic_cast<QGenericUnixServices *>(
+ const auto unixServices = dynamic_cast<QDesktopUnixServices *>(
QGuiApplicationPrivate::platformIntegration()->services());
unixServices->unregisterDBusMenuForWindow(m_window);
}
diff --git a/src/gui/platform/unix/qgenericunixservices.cpp b/src/gui/platform/unix/qdesktopunixservices.cpp
index 444d6940960..19edd95d14a 100644
--- a/src/gui/platform/unix/qgenericunixservices.cpp
+++ b/src/gui/platform/unix/qdesktopunixservices.cpp
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#include "qgenericunixservices_p.h"
+#include "qdesktopunixservices_p.h"
#include <QtGui/private/qtguiglobal_p.h>
#include "qguiapplication.h"
#include "qwindow.h"
@@ -371,7 +371,7 @@ private:
#endif // QT_CONFIG(dbus)
-QGenericUnixServices::QGenericUnixServices()
+QDesktopUnixServices::QDesktopUnixServices()
{
if (desktopEnvironment() == QByteArrayLiteral("UNKNOWN"))
return;
@@ -400,14 +400,14 @@ QGenericUnixServices::QGenericUnixServices()
#endif
}
-QGenericUnixServices::~QGenericUnixServices()
+QDesktopUnixServices::~QDesktopUnixServices()
{
#if QT_CONFIG(dbus)
QObject::disconnect(m_watcherConnection);
#endif
}
-QPlatformServiceColorPicker *QGenericUnixServices::colorPicker(QWindow *parent)
+QPlatformServiceColorPicker *QDesktopUnixServices::colorPicker(QWindow *parent)
{
#if QT_CONFIG(dbus)
// Make double sure that we are in a wayland environment. In particular check
@@ -424,7 +424,7 @@ QPlatformServiceColorPicker *QGenericUnixServices::colorPicker(QWindow *parent)
#endif
}
-QByteArray QGenericUnixServices::desktopEnvironment() const
+QByteArray QDesktopUnixServices::desktopEnvironment() const
{
static const QByteArray result = detectDesktopEnvironment();
return result;
@@ -460,7 +460,7 @@ void runWithXdgActivationToken(F &&functionToCall)
#endif
}
-bool QGenericUnixServices::openUrl(const QUrl &url)
+bool QDesktopUnixServices::openUrl(const QUrl &url)
{
auto openUrlInternal = [this](const QUrl &url, const QString &xdgActivationToken) {
if (url.scheme() == "mailto"_L1) {
@@ -509,7 +509,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url)
}
}
-bool QGenericUnixServices::openDocument(const QUrl &url)
+bool QDesktopUnixServices::openDocument(const QUrl &url)
{
auto openDocumentInternal = [this](const QUrl &url, const QString &xdgActivationToken) {
@@ -544,29 +544,29 @@ bool QGenericUnixServices::openDocument(const QUrl &url)
}
#else
-QGenericUnixServices::QGenericUnixServices() = default;
-QGenericUnixServices::~QGenericUnixServices() = default;
+QDesktopUnixServices::QDesktopUnixServices() = default;
+QDesktopUnixServices::~QDesktopUnixServices() = default;
-QByteArray QGenericUnixServices::desktopEnvironment() const
+QByteArray QDesktopUnixServices::desktopEnvironment() const
{
return QByteArrayLiteral("UNKNOWN");
}
-bool QGenericUnixServices::openUrl(const QUrl &url)
+bool QDesktopUnixServices::openUrl(const QUrl &url)
{
Q_UNUSED(url);
qWarning("openUrl() not supported on this platform");
return false;
}
-bool QGenericUnixServices::openDocument(const QUrl &url)
+bool QDesktopUnixServices::openDocument(const QUrl &url)
{
Q_UNUSED(url);
qWarning("openDocument() not supported on this platform");
return false;
}
-QPlatformServiceColorPicker *QGenericUnixServices::colorPicker(QWindow *parent)
+QPlatformServiceColorPicker *QDesktopUnixServices::colorPicker(QWindow *parent)
{
Q_UNUSED(parent);
return nullptr;
@@ -574,27 +574,27 @@ QPlatformServiceColorPicker *QGenericUnixServices::colorPicker(QWindow *parent)
#endif // QT_NO_MULTIPROCESS
-QString QGenericUnixServices::portalWindowIdentifier(QWindow *window)
+QString QDesktopUnixServices::portalWindowIdentifier(QWindow *window)
{
Q_UNUSED(window);
return QString();
}
-void QGenericUnixServices::registerDBusMenuForWindow(QWindow *window, const QString &service, const QString &path)
+void QDesktopUnixServices::registerDBusMenuForWindow(QWindow *window, const QString &service, const QString &path)
{
Q_UNUSED(window);
Q_UNUSED(service);
Q_UNUSED(path);
}
-void QGenericUnixServices::unregisterDBusMenuForWindow(QWindow *window)
+void QDesktopUnixServices::unregisterDBusMenuForWindow(QWindow *window)
{
Q_UNUSED(window);
}
-bool QGenericUnixServices::hasCapability(Capability capability) const
+bool QDesktopUnixServices::hasCapability(Capability capability) const
{
switch (capability) {
case Capability::ColorPicking:
@@ -603,7 +603,7 @@ bool QGenericUnixServices::hasCapability(Capability capability) const
return false;
}
-void QGenericUnixServices::setApplicationBadge(qint64 number)
+void QDesktopUnixServices::setApplicationBadge(qint64 number)
{
#if QT_CONFIG(dbus)
if (qGuiApp->desktopFileName().isEmpty()) {
@@ -636,4 +636,4 @@ void QGenericUnixServices::setApplicationBadge(qint64 number)
QT_END_NAMESPACE
-#include "qgenericunixservices.moc"
+#include "qdesktopunixservices.moc"
diff --git a/src/gui/platform/unix/qgenericunixservices_p.h b/src/gui/platform/unix/qdesktopunixservices_p.h
index 9e34f090229..f52dc35bbe2 100644
--- a/src/gui/platform/unix/qgenericunixservices_p.h
+++ b/src/gui/platform/unix/qdesktopunixservices_p.h
@@ -1,8 +1,8 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QGENERICUNIXDESKTOPSERVICES_H
-#define QGENERICUNIXDESKTOPSERVICES_H
+#ifndef QDESKTOPUNIXSERVICES_H
+#define QDESKTOPUNIXSERVICES_H
//
// W A R N I N G
@@ -23,11 +23,11 @@ QT_BEGIN_NAMESPACE
class QWindow;
-class Q_GUI_EXPORT QGenericUnixServices : public QPlatformServices
+class Q_GUI_EXPORT QDesktopUnixServices : public QPlatformServices
{
public:
- QGenericUnixServices();
- ~QGenericUnixServices();
+ QDesktopUnixServices();
+ ~QDesktopUnixServices();
QByteArray desktopEnvironment() const override;
@@ -53,4 +53,4 @@ private:
QT_END_NAMESPACE
-#endif // QGENERICUNIXDESKTOPSERVICES_H
+#endif // QDESKTOPUNIXSERVICES_H
diff --git a/src/plugins/platforms/vnc/qvncintegration.cpp b/src/plugins/platforms/vnc/qvncintegration.cpp
index 1f4ed194553..5a79d9ec92d 100644
--- a/src/plugins/platforms/vnc/qvncintegration.cpp
+++ b/src/plugins/platforms/vnc/qvncintegration.cpp
@@ -6,7 +6,7 @@
#include "qvnc_p.h"
#include <QtGui/private/qgenericunixfontdatabase_p.h>
-#include <QtGui/private/qgenericunixservices_p.h>
+#include <QtGui/private/qdesktopunixservices_p.h>
#include <QtGui/private/qgenericunixeventdispatcher_p.h>
#include <QtFbSupport/private/qfbbackingstore_p.h>
@@ -105,7 +105,7 @@ QPlatformFontDatabase *QVncIntegration::fontDatabase() const
QPlatformServices *QVncIntegration::services() const
{
if (m_services.isNull())
- m_services.reset(new QGenericUnixServices);
+ m_services.reset(new QDesktopUnixServices);
return m_services.data();
}
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 2c28de316f7..0371c1daecf 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -25,7 +25,7 @@
#include <xcb/xcb.h>
#include <QtGui/private/qgenericunixfontdatabase_p.h>
-#include <QtGui/private/qgenericunixservices_p.h>
+#include <QtGui/private/qdesktopunixservices_p.h>
#include <stdio.h>
@@ -93,7 +93,7 @@ static bool runningUnderDebugger()
#endif
}
-class QXcbUnixServices : public QGenericUnixServices, public QXcbObject
+class QXcbUnixServices : public QDesktopUnixServices, public QXcbObject
{
public:
QString portalWindowIdentifier(QWindow *window) override;
@@ -595,7 +595,7 @@ QPlatformVulkanInstance *QXcbIntegration::createPlatformVulkanInstance(QVulkanIn
void QXcbIntegration::setApplicationBadge(qint64 number)
{
- auto unixServices = dynamic_cast<QGenericUnixServices *>(services());
+ auto unixServices = dynamic_cast<QDesktopUnixServices *>(services());
unixServices->setApplicationBadge(number);
}
diff --git a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
index 348afacff7f..ebc1de2c3a2 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
@@ -14,7 +14,7 @@
#include <qfileinfo.h>
#include <private/qguiapplication_p.h>
-#include <private/qgenericunixservices_p.h>
+#include <private/qdesktopunixservices_p.h>
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformfontdatabase.h>
@@ -109,7 +109,7 @@ bool QGtk3Dialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWind
if (false) {
#if defined(GDK_WINDOWING_WAYLAND) && GTK_CHECK_VERSION(3, 22, 0)
} else if (GDK_IS_WAYLAND_WINDOW(gdkWindow)) {
- const auto unixServices = dynamic_cast<QGenericUnixServices *>(
+ const auto unixServices = dynamic_cast<QDesktopUnixServices *>(
QGuiApplicationPrivate::platformIntegration()->services());
if (unixServices) {
const auto handle = unixServices->portalWindowIdentifier(parent);
diff --git a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp
index aa29deed726..cea1ca903fa 100644
--- a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp
+++ b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp
@@ -3,7 +3,7 @@
#include "qxdgdesktopportalfiledialog_p.h"
-#include <private/qgenericunixservices_p.h>
+#include <private/qdesktopunixservices_p.h>
#include <private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
@@ -269,7 +269,7 @@ void QXdgDesktopPortalFileDialog::openPortal(Qt::WindowFlags windowFlags, Qt::Wi
// TODO choices a(ssa(ss)s)
// List of serialized combo boxes to add to the file chooser.
- auto unixServices = dynamic_cast<QGenericUnixServices *>(
+ auto unixServices = dynamic_cast<QDesktopUnixServices *>(
QGuiApplicationPrivate::platformIntegration()->services());
if (parent && unixServices)
message << unixServices->portalWindowIdentifier(parent);