From b2ef6f9a283ea4e5a7c23ddefebcf100aaeed577 Mon Sep 17 00:00:00 2001 From: demmm Date: Tue, 20 Feb 2024 13:32:33 +0100 Subject: [PATCH] [interactivetermianl] enable konsole for Qt6 builds too 4 lines of code duplicated to avoid even more ifdefs --- CHANGES-3.3 | 1 + .../InteractiveTerminalPage.cpp | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGES-3.3 b/CHANGES-3.3 index 497cae677..1f2f54f80 100644 --- a/CHANGES-3.3 +++ b/CHANGES-3.3 @@ -18,6 +18,7 @@ This release contains contributions from (alphabetically by first name): hidden visibility by default, as a step towards ABI stability. ## Modules ## + - *interactiveterminal* can use konsole in Qt6 too - *plasmalnf* module ported to Plasma 6 diff --git a/src/modules/interactiveterminal/InteractiveTerminalPage.cpp b/src/modules/interactiveterminal/InteractiveTerminalPage.cpp index 2e6440569..fb31f2650 100644 --- a/src/modules/interactiveterminal/InteractiveTerminalPage.cpp +++ b/src/modules/interactiveterminal/InteractiveTerminalPage.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac + * SPDX-FileCopyrightText: 2024 Anke Boersma * SPDX-License-Identifier: GPL-3.0-or-later * * Calamares is Free Software: see the License-Identifier above. @@ -18,10 +19,11 @@ #include #if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) #include +#include #else +#include #include #endif -#include #include #include @@ -62,10 +64,13 @@ InteractiveTerminalPage::onActivate() } #if KCOREADDONS_VERSION_MAJOR > 5 || KCOREADDONS_VERSION_MINOR > 200 -#warning Using KF6 - errorKonsoleNotInstalled(); - return; - KParts::ReadOnlyPart* p = nullptr; + auto md = KPluginMetaData::findPluginById( QString(), "kf6/parts/konsolepart" ); + if ( !md.isValid() ) + { + errorKonsoleNotInstalled(); + return; + } + auto* p = KPluginFactory::instantiatePlugin< KParts::ReadOnlyPart >( md, this ).plugin; #elif KCOREADDONS_VERSION_MINOR >= 86 // 5.86 deprecated a bunch of KService and PluginFactory and related methods auto md = KPluginMetaData::findPluginById( QString(), "konsolepart" );