diff options
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/desktopdetect/desktopdetector.cxx | 21 | ||||
-rw-r--r-- | vcl/unx/gtk3_kde5/kde5_filepicker.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/kf5/KF5FilePicker.cxx (renamed from vcl/unx/kde5/KDE5FilePicker2.cxx) | 44 | ||||
-rw-r--r-- | vcl/unx/kf5/KF5FilePicker.hxx (renamed from vcl/unx/kde5/KDE5FilePicker.hxx) | 6 | ||||
-rw-r--r-- | vcl/unx/kf5/KF5SalFrame.cxx (renamed from vcl/unx/kde5/KDE5SalFrame.cxx) | 26 | ||||
-rw-r--r-- | vcl/unx/kf5/KF5SalFrame.hxx (renamed from vcl/unx/kde5/KDE5SalFrame.hxx) | 6 | ||||
-rw-r--r-- | vcl/unx/kf5/KF5SalInstance.cxx (renamed from vcl/unx/kde5/KDE5SalInstance.cxx) | 32 | ||||
-rw-r--r-- | vcl/unx/kf5/KF5SalInstance.hxx (renamed from vcl/unx/kde5/KDE5SalInstance.hxx) | 4 |
8 files changed, 69 insertions, 74 deletions
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index 2c453e051b5c..b2aea898e45c 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -115,15 +115,11 @@ static bool is_gnome_desktop( Display* pDisplay ) return ret; } - -static bool is_kde5_desktop() +static bool is_plasma5_desktop() { - static const char * pFullVersion = getenv( "KDE_FULL_SESSION" ); - static const char * pSessionVersion = getenv( "KDE_SESSION_VERSION" ); - if ( pFullVersion && pSessionVersion && strcmp(pSessionVersion, "5") == 0) - return true; - - return false; + static const char* pFullVersion = getenv("KDE_FULL_SESSION"); + static const char* pSessionVersion = getenv("KDE_SESSION_VERSION"); + return pFullVersion && pSessionVersion && (0 == strcmp(pSessionVersion, "5")); } extern "C" @@ -139,8 +135,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() if ( aOver.equalsIgnoreAsciiCase( "lxqt" ) ) return DESKTOP_LXQT; - if ( aOver.equalsIgnoreAsciiCase( "kde5" ) ) - return DESKTOP_KDE5; + if (aOver.equalsIgnoreAsciiCase("plasma5") || aOver.equalsIgnoreAsciiCase("plasma")) + return DESKTOP_PLASMA5; if ( aOver.equalsIgnoreAsciiCase( "gnome" ) ) return DESKTOP_GNOME; if ( aOver.equalsIgnoreAsciiCase( "gnome-wayland" ) ) @@ -197,9 +193,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() else if ( aDesktopSession.equalsIgnoreAsciiCase( "lxqt" ) ) return DESKTOP_LXQT; - - if ( is_kde5_desktop() ) - return DESKTOP_KDE5; + if (is_plasma5_desktop()) + return DESKTOP_PLASMA5; // tdf#121275 if we still can't tell, and WAYLAND_DISPLAY // is set, default to gtk3 diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker.cxx b/vcl/unx/gtk3_kde5/kde5_filepicker.cxx index f4cb305e239c..2ee4dbd8e85c 100644 --- a/vcl/unx/gtk3_kde5/kde5_filepicker.cxx +++ b/vcl/unx/gtk3_kde5/kde5_filepicker.cxx @@ -68,7 +68,7 @@ void KDE5FilePicker::enableFolderMode() // and then confirming would return "foo" rather than "foo/bar"; // on the other hand, non-native file dialog needs 'QFileDialog::Directory' // and doesn't allow folder selection otherwise - if (Application::GetDesktopEnvironment() != "KDE5") + if (Application::GetDesktopEnvironment() != "PLASMA5") { _dialog->setFileMode(QFileDialog::Directory); } @@ -248,7 +248,7 @@ void KDE5FilePicker::setupCustomWidgets() // dialog there in order not to lose the custom controls and insert the custom // widget in the layout returned by QFileDialog::layout() // (which returns nullptr for native file dialogs) - if (Application::GetDesktopEnvironment() == "KDE5") + if (Application::GetDesktopEnvironment() == "PLASMA5") { qApp->installEventFilter(this); } diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kf5/KF5FilePicker.cxx index cb778e2fd0f7..366ca89ffa54 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kf5/KF5FilePicker.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "KDE5FilePicker.hxx" -#include <KDE5FilePicker.moc> +#include "KF5FilePicker.hxx" +#include <KF5FilePicker.moc> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include <cppuhelper/supportsservice.hxx> @@ -41,17 +41,17 @@ uno::Sequence<OUString> FilePicker_getSupportedServiceNames() uno::Sequence<OUString> aRet(4); aRet[0] = "com.sun.star.ui.dialogs.FilePicker"; aRet[1] = "com.sun.star.ui.dialogs.SystemFilePicker"; - aRet[2] = "com.sun.star.ui.dialogs.KDE5FilePicker"; - aRet[3] = "com.sun.star.ui.dialogs.KDE5FolderPicker"; + aRet[2] = "com.sun.star.ui.dialogs.KF5FilePicker"; + aRet[3] = "com.sun.star.ui.dialogs.KF5FolderPicker"; return aRet; } } -// KDE5FilePicker +// KF5FilePicker -KDE5FilePicker::KDE5FilePicker(css::uno::Reference<css::uno::XComponentContext> const& context, - QFileDialog::FileMode eMode) - // Native kde5 filepicker does not add file extension automatically +KF5FilePicker::KF5FilePicker(css::uno::Reference<css::uno::XComponentContext> const& context, + QFileDialog::FileMode eMode) + // Native kf5 filepicker does not add file extension automatically : Qt5FilePicker(context, eMode, true, true) , _layout(new QGridLayout(m_pExtraControls)) , allowRemoteUrls(false) @@ -78,7 +78,7 @@ KDE5FilePicker::KDE5FilePicker(css::uno::Reference<css::uno::XComponentContext> qApp->installEventFilter(this); } -sal_Int16 SAL_CALL KDE5FilePicker::execute() +sal_Int16 SAL_CALL KF5FilePicker::execute() { SolarMutexGuard g; auto* pSalInst(static_cast<Qt5Instance*>(GetSalData()->m_pInstance)); @@ -101,8 +101,8 @@ sal_Int16 SAL_CALL KDE5FilePicker::execute() } // XFilePickerControlAccess -void SAL_CALL KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, - const uno::Any& value) +void SAL_CALL KF5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, + const uno::Any& value) { if (CHECKBOX_AUTOEXTENSION == controlId) // We ignore this one and rely on QFileDialog to provide the functionality @@ -111,7 +111,7 @@ void SAL_CALL KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAc Qt5FilePicker::setValue(controlId, nControlAction, value); } -uno::Any SAL_CALL KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) +uno::Any SAL_CALL KF5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) { SolarMutexGuard g; auto* pSalInst(static_cast<Qt5Instance*>(GetSalData()->m_pInstance)); @@ -136,7 +136,7 @@ uno::Any SAL_CALL KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nContr return Qt5FilePicker::getValue(controlId, nControlAction); } -void SAL_CALL KDE5FilePicker::enableControl(sal_Int16 controlId, sal_Bool enable) +void SAL_CALL KF5FilePicker::enableControl(sal_Int16 controlId, sal_Bool enable) { if (CHECKBOX_AUTOEXTENSION == controlId) // We ignore this one and rely on QFileDialog to provide the functionality @@ -145,7 +145,7 @@ void SAL_CALL KDE5FilePicker::enableControl(sal_Int16 controlId, sal_Bool enable Qt5FilePicker::enableControl(controlId, enable); } -void SAL_CALL KDE5FilePicker::setLabel(sal_Int16 controlId, const OUString& label) +void SAL_CALL KF5FilePicker::setLabel(sal_Int16 controlId, const OUString& label) { if (CHECKBOX_AUTOEXTENSION == controlId) // We ignore this one and rely on QFileDialog to provide the functionality @@ -154,7 +154,7 @@ void SAL_CALL KDE5FilePicker::setLabel(sal_Int16 controlId, const OUString& labe Qt5FilePicker::setLabel(controlId, label); } -OUString SAL_CALL KDE5FilePicker::getLabel(sal_Int16 controlId) +OUString SAL_CALL KF5FilePicker::getLabel(sal_Int16 controlId) { // We ignore this one and rely on QFileDialog to provide the functionality if (CHECKBOX_AUTOEXTENSION == controlId) @@ -163,9 +163,9 @@ OUString SAL_CALL KDE5FilePicker::getLabel(sal_Int16 controlId) return Qt5FilePicker::getLabel(controlId); } -void KDE5FilePicker::addCustomControl(sal_Int16 controlId) +void KF5FilePicker::addCustomControl(sal_Int16 controlId) { - // native kde5 filepicker has its own autoextension checkbox, + // native kf5 filepicker has its own autoextension checkbox, // therefore avoid adding yet another one if (controlId == CHECKBOX_AUTOEXTENSION) return; @@ -174,22 +174,22 @@ void KDE5FilePicker::addCustomControl(sal_Int16 controlId) } // XServiceInfo -OUString SAL_CALL KDE5FilePicker::getImplementationName() +OUString SAL_CALL KF5FilePicker::getImplementationName() { - return OUString("com.sun.star.ui.dialogs.KDE5FilePicker"); + return OUString("com.sun.star.ui.dialogs.KF5FilePicker"); } -sal_Bool SAL_CALL KDE5FilePicker::supportsService(const OUString& ServiceName) +sal_Bool SAL_CALL KF5FilePicker::supportsService(const OUString& ServiceName) { return cppu::supportsService(this, ServiceName); } -uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getSupportedServiceNames() +uno::Sequence<OUString> SAL_CALL KF5FilePicker::getSupportedServiceNames() { return FilePicker_getSupportedServiceNames(); } -bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e) +bool KF5FilePicker::eventFilter(QObject* o, QEvent* e) { if (e->type() == QEvent::Show && o->isWidgetType()) { diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kf5/KF5FilePicker.hxx index 786a99b00777..6bfc7ee96077 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kf5/KF5FilePicker.hxx @@ -23,7 +23,7 @@ class QGridLayout; -class KDE5FilePicker : public Qt5FilePicker +class KF5FilePicker : public Qt5FilePicker { Q_OBJECT @@ -34,8 +34,8 @@ protected: bool allowRemoteUrls; public: - explicit KDE5FilePicker(css::uno::Reference<css::uno::XComponentContext> const& context, - QFileDialog::FileMode); + explicit KF5FilePicker(css::uno::Reference<css::uno::XComponentContext> const& context, + QFileDialog::FileMode); // XExecutableDialog functions virtual sal_Int16 SAL_CALL execute() override; diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kf5/KF5SalFrame.cxx index efb08a74d832..a212759aeb91 100644 --- a/vcl/unx/kde5/KDE5SalFrame.cxx +++ b/vcl/unx/kf5/KF5SalFrame.cxx @@ -28,7 +28,7 @@ #include <KConfigGroup> #include <KSharedConfig> -#include "KDE5SalFrame.hxx" +#include "KF5SalFrame.hxx" #include <tools/color.hxx> @@ -42,7 +42,7 @@ #include <boost/optional.hpp> -KDE5SalFrame::KDE5SalFrame(KDE5SalFrame* pParent, SalFrameStyleFlags nState, bool bUseCairo) +KF5SalFrame::KF5SalFrame(KF5SalFrame* pParent, SalFrameStyleFlags nState, bool bUseCairo) : Qt5Frame(pParent, nState, bUseCairo) , m_bGraphicsInUse(false) { @@ -101,13 +101,13 @@ static vcl::Font toFont(const QFont& rQFont, const css::lang::Locale& rLocale) else aInfo.m_eWidth = WIDTH_ULTRA_EXPANDED; - SAL_INFO("vcl.kde5", "font name BEFORE system match: \"" << aInfo.m_aFamilyName << "\""); + SAL_INFO("vcl.kf5", "font name BEFORE system match: \"" << aInfo.m_aFamilyName << "\""); // match font to e.g. resolve "Sans" psp::PrintFontManager::get().matchFont(aInfo, rLocale); - SAL_INFO("vcl.kde5", "font match " << (aInfo.m_nID != 0 ? "succeeded" : "failed") - << ", name AFTER: \"" << aInfo.m_aFamilyName << "\""); + SAL_INFO("vcl.kf5", "font match " << (aInfo.m_nID != 0 ? "succeeded" : "failed") + << ", name AFTER: \"" << aInfo.m_aFamilyName << "\""); // font height int nPointHeight = qFontInfo.pointSize(); @@ -130,7 +130,7 @@ static vcl::Font toFont(const QFont& rQFont, const css::lang::Locale& rLocale) /** Implementation of KDE integration's main method. */ -void KDE5SalFrame::UpdateSettings(AllSettings& rSettings) +void KF5SalFrame::UpdateSettings(AllSettings& rSettings) { Qt5Frame::UpdateSettings(rSettings); @@ -196,26 +196,26 @@ void KDE5SalFrame::UpdateSettings(AllSettings& rSettings) rSettings.SetStyleSettings(style); } -SalGraphics* KDE5SalFrame::AcquireGraphics() +SalGraphics* KF5SalFrame::AcquireGraphics() { if (m_bGraphicsInUse) return nullptr; m_bGraphicsInUse = true; - if (!m_pKDE5Graphics.get()) + if (!m_pKF5Graphics.get()) { - m_pKDE5Graphics.reset(new Qt5SvpGraphics(this)); - Qt5Frame::InitQt5SvpGraphics(m_pKDE5Graphics.get()); + m_pKF5Graphics.reset(new Qt5SvpGraphics(this)); + Qt5Frame::InitQt5SvpGraphics(m_pKF5Graphics.get()); } - return m_pKDE5Graphics.get(); + return m_pKF5Graphics.get(); } -void KDE5SalFrame::ReleaseGraphics(SalGraphics* pSalGraph) +void KF5SalFrame::ReleaseGraphics(SalGraphics* pSalGraph) { (void)pSalGraph; - assert(pSalGraph == m_pKDE5Graphics.get()); + assert(pSalGraph == m_pKF5Graphics.get()); m_bGraphicsInUse = false; } diff --git a/vcl/unx/kde5/KDE5SalFrame.hxx b/vcl/unx/kf5/KF5SalFrame.hxx index cf3874af7c8c..091a5b019ca7 100644 --- a/vcl/unx/kde5/KDE5SalFrame.hxx +++ b/vcl/unx/kf5/KF5SalFrame.hxx @@ -26,14 +26,14 @@ class QWidget; -class KDE5SalFrame : public Qt5Frame +class KF5SalFrame : public Qt5Frame { private: - std::unique_ptr<Qt5SvpGraphics> m_pKDE5Graphics; + std::unique_ptr<Qt5SvpGraphics> m_pKF5Graphics; bool m_bGraphicsInUse; public: - KDE5SalFrame(KDE5SalFrame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo); + KF5SalFrame(KF5SalFrame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo); virtual SalGraphics* AcquireGraphics() override; virtual void ReleaseGraphics(SalGraphics* pGraphics) override; diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kf5/KF5SalInstance.cxx index b1b8eb59375f..da4906a70a49 100644 --- a/vcl/unx/kde5/KDE5SalInstance.cxx +++ b/vcl/unx/kf5/KF5SalInstance.cxx @@ -27,39 +27,39 @@ #include <Qt5Data.hxx> -#include "KDE5FilePicker.hxx" -#include "KDE5SalFrame.hxx" -#include "KDE5SalInstance.hxx" +#include "KF5FilePicker.hxx" +#include "KF5SalFrame.hxx" +#include "KF5SalInstance.hxx" using namespace com::sun::star; -KDE5SalInstance::KDE5SalInstance(std::unique_ptr<QApplication>& pQApp) +KF5SalInstance::KF5SalInstance(std::unique_ptr<QApplication>& pQApp) : Qt5Instance(pQApp, true) { ImplSVData* pSVData = ImplGetSVData(); - pSVData->maAppData.mxToolkitName = OUString("kde5"); + pSVData->maAppData.mxToolkitName = OUString("kf5"); } -SalFrame* KDE5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nState) +SalFrame* KF5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nState) { SalFrame* pRet(nullptr); RunInMainThread(std::function([&pRet, pParent, nState]() { - pRet = new KDE5SalFrame(static_cast<KDE5SalFrame*>(pParent), nState, true); + pRet = new KF5SalFrame(static_cast<KF5SalFrame*>(pParent), nState, true); })); assert(pRet); return pRet; } -bool KDE5SalInstance::hasNativeFileSelection() const +bool KF5SalInstance::hasNativeFileSelection() const { - if (Application::GetDesktopEnvironment() == "KDE5") + if (Application::GetDesktopEnvironment() == "PLASMA5") return true; return Qt5Instance::hasNativeFileSelection(); } Qt5FilePicker* -KDE5SalInstance::createPicker(css::uno::Reference<css::uno::XComponentContext> const& context, - QFileDialog::FileMode eMode) +KF5SalInstance::createPicker(css::uno::Reference<css::uno::XComponentContext> const& context, + QFileDialog::FileMode eMode) { if (!IsMainThread()) { @@ -70,16 +70,16 @@ KDE5SalInstance::createPicker(css::uno::Reference<css::uno::XComponentContext> c return pPicker; } - // In order to insert custom controls, KDE5FilePicker currently relies on KFileWidget + // In order to insert custom controls, KF5FilePicker 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() == "KDE5") - return new KDE5FilePicker(context, eMode); + if (Application::GetDesktopEnvironment() == "PLASMA5") + return new KF5FilePicker(context, eMode); return Qt5Instance::createPicker(context, eMode); } extern "C" { -VCLPLUG_KDE5_PUBLIC SalInstance* create_SalInstance() +VCLPLUG_KF5_PUBLIC SalInstance* create_SalInstance() { std::unique_ptr<char* []> pFakeArgv; std::unique_ptr<int> pFakeArgc; @@ -89,7 +89,7 @@ VCLPLUG_KDE5_PUBLIC SalInstance* create_SalInstance() std::unique_ptr<QApplication> pQApp = Qt5Instance::CreateQApplication(*pFakeArgc, pFakeArgv.get()); - KDE5SalInstance* pInstance = new KDE5SalInstance(pQApp); + KF5SalInstance* pInstance = new KF5SalInstance(pQApp); pInstance->MoveFakeCmdlineArgs(pFakeArgv, pFakeArgc, aFakeArgvFreeable); new Qt5Data(pInstance); diff --git a/vcl/unx/kde5/KDE5SalInstance.hxx b/vcl/unx/kf5/KF5SalInstance.hxx index 4215ec483308..5dd306da5231 100644 --- a/vcl/unx/kde5/KDE5SalInstance.hxx +++ b/vcl/unx/kf5/KF5SalInstance.hxx @@ -21,7 +21,7 @@ #include <qt5/Qt5Instance.hxx> -class KDE5SalInstance final : public Qt5Instance +class KF5SalInstance final : public Qt5Instance { bool hasNativeFileSelection() const override; Qt5FilePicker* createPicker(css::uno::Reference<css::uno::XComponentContext> const& context, @@ -30,7 +30,7 @@ class KDE5SalInstance final : public Qt5Instance SalFrame* CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle) override; public: - explicit KDE5SalInstance(std::unique_ptr<QApplication>& pQApp); + explicit KF5SalInstance(std::unique_ptr<QApplication>& pQApp); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |