diff options
-rw-r--r-- | vcl/inc/unx/desktops.hxx | 1 | ||||
-rw-r--r-- | vcl/source/app/IconThemeSelector.cxx | 1 | ||||
-rw-r--r-- | vcl/source/app/salplug.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/desktopdetect/desktopdetector.cxx | 11 | ||||
-rw-r--r-- | vcl/unx/kf5/KFSalInstance.cxx | 8 |
5 files changed, 20 insertions, 5 deletions
diff --git a/vcl/inc/unx/desktops.hxx b/vcl/inc/unx/desktops.hxx index 0abb6aa71339..2056c2c37928 100644 --- a/vcl/inc/unx/desktops.hxx +++ b/vcl/inc/unx/desktops.hxx @@ -33,6 +33,7 @@ enum SAL_DLLPUBLIC_RTTI DesktopType DESKTOP_XFCE, DESKTOP_MATE, DESKTOP_PLASMA5, + DESKTOP_PLASMA6, DESKTOP_LXQT }; // keep in sync with desktop_strings[] in salplug.cxx diff --git a/vcl/source/app/IconThemeSelector.cxx b/vcl/source/app/IconThemeSelector.cxx index 6b8dfc0f42c7..15eb4b7768fc 100644 --- a/vcl/source/app/IconThemeSelector.cxx +++ b/vcl/source/app/IconThemeSelector.cxx @@ -70,6 +70,7 @@ IconThemeSelector::GetIconThemeForDesktopEnvironment(const OUString& desktopEnvi #else OUString r; if ( desktopEnvironment.equalsIgnoreAsciiCase("plasma5") || + desktopEnvironment.equalsIgnoreAsciiCase("plasma6") || desktopEnvironment.equalsIgnoreAsciiCase("lxqt") ) { if (!bPreferDarkIconTheme) r = "breeze"; diff --git a/vcl/source/app/salplug.cxx b/vcl/source/app/salplug.cxx index e51375b94ae5..fee5b7e33e6d 100644 --- a/vcl/source/app/salplug.cxx +++ b/vcl/source/app/salplug.cxx @@ -249,7 +249,7 @@ const char* const* autodetect_plugin_list() desktop == DESKTOP_XFCE || desktop == DESKTOP_MATE ) pList = pStandardFallbackList; - else if (desktop == DESKTOP_PLASMA5 || desktop == DESKTOP_LXQT) + else if (desktop == DESKTOP_PLASMA5 || desktop == DESKTOP_PLASMA6 || desktop == DESKTOP_LXQT) pList = pKDEFallbackList; return pList; @@ -426,7 +426,7 @@ const OUString& SalGetDesktopEnvironment() // Order to match desktops.hxx' DesktopType static const char * const desktop_strings[] = { "none", "unknown", "GNOME", "UNITY", - "XFCE", "MATE", "PLASMA5", "LXQT" }; + "XFCE", "MATE", "PLASMA5", "PLASMA6", "LXQT" }; static OUString aDesktopEnvironment; if( aDesktopEnvironment.isEmpty()) { diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index bad134fbdafd..8baeb303feed 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -117,6 +117,13 @@ static bool is_plasma5_desktop() return pFullVersion && pSessionVersion && (0 == strcmp(pSessionVersion, "5")); } +static bool is_plasma6_desktop() +{ + static const char* pFullVersion = getenv("KDE_FULL_SESSION"); + static const char* pSessionVersion = getenv("KDE_SESSION_VERSION"); + return pFullVersion && pSessionVersion && (0 == strcmp(pSessionVersion, "6")); +} + extern "C" { @@ -132,6 +139,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() return DESKTOP_LXQT; if (aOver.equalsIgnoreAsciiCase("plasma5") || aOver.equalsIgnoreAsciiCase("plasma")) return DESKTOP_PLASMA5; + if (aOver.equalsIgnoreAsciiCase("plasma6")) + return DESKTOP_PLASMA6; if ( aOver.equalsIgnoreAsciiCase( "gnome" ) ) return DESKTOP_GNOME; if ( aOver.equalsIgnoreAsciiCase( "gnome-wayland" ) ) @@ -190,6 +199,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() if (is_plasma5_desktop()) return DESKTOP_PLASMA5; + if (is_plasma6_desktop()) + return DESKTOP_PLASMA6; // tdf#121275 if we still can't tell, and WAYLAND_DISPLAY // is set, default to gtk3 diff --git a/vcl/unx/kf5/KFSalInstance.cxx b/vcl/unx/kf5/KFSalInstance.cxx index 21463e05439a..bec23cc2a6af 100644 --- a/vcl/unx/kf5/KFSalInstance.cxx +++ b/vcl/unx/kf5/KFSalInstance.cxx @@ -42,7 +42,8 @@ KFSalInstance::KFSalInstance(std::unique_ptr<QApplication>& pQApp, bool bUseCair bool KFSalInstance::hasNativeFileSelection() const { - if (Application::GetDesktopEnvironment() == "PLASMA5") + const OUString sDesktop = Application::GetDesktopEnvironment(); + if (sDesktop == "PLASMA5" || sDesktop == "PLASMA6") return true; return QtInstance::hasNativeFileSelection(); } @@ -62,8 +63,9 @@ KFSalInstance::createPicker(css::uno::Reference<css::uno::XComponentContext> con // In order to insert custom controls, KFFilePicker currently relies on KFileWidget // being used in the native file picker, which is only the case for KDE Plasma. - // Therefore, return the plain qt5 one in order to not lose custom controls. - if (Application::GetDesktopEnvironment() == "PLASMA5") + // Therefore, return the plain qt5/qt6 one in order to not lose custom controls otherwise. + const OUString sDesktop = Application::GetDesktopEnvironment(); + if (sDesktop == "PLASMA5" || sDesktop == "PLASMA6") return new KFFilePicker(context, eMode); return QtInstance::createPicker(context, eMode); } |