Port to KF6

This commit is contained in:
Tobias Fella
2023-04-09 01:28:23 +02:00
committed by Nicolas Fella
parent 3eb3d28bfc
commit 53d473cff3
17 changed files with 336 additions and 85 deletions

View File

@@ -2,7 +2,7 @@
# SPDX-License-Identifier: CC0-1.0
Dependencies:
- 'on': ['Linux/Qt6', 'FreeBSD/Qt6', 'Linux/Qt5', 'FreeBSD/Qt5', 'Windows/Qt5', 'Windows/Qt6']
- 'on': ['Linux/Qt5', 'FreeBSD/Qt5', 'Windows/Qt5']
'require':
'frameworks/extra-cmake-modules': '@stable'
'frameworks/kconfig': '@stable'
@@ -26,10 +26,40 @@ Dependencies:
'frameworks/kxmlgui': '@stable'
'frameworks/kdoctools': '@stable'
- 'on': ['Linux/Qt6', 'FreeBSD/Qt6', 'Linux/Qt5', 'FreeBSD/Qt5']
- 'on': ['Linux/Qt6', 'FreeBSD/Qt6', 'Windows/Qt6']
'require':
'frameworks/extra-cmake-modules': '@latest-kf6'
'frameworks/kconfig': '@latest-kf6'
'frameworks/knotifications': '@latest-kf6'
'frameworks/ki18n': '@latest-kf6'
'frameworks/kcalendarcore': '@latest-kf6'
'frameworks/kcoreaddons': '@latest-kf6'
'frameworks/kdbusaddons': '@latest-kf6'
'frameworks/kbookmarks': '@latest-kf6'
'frameworks/kconfigwidgets': '@latest-kf6'
'frameworks/kcrash': '@latest-kf6'
'frameworks/kguiaddons': '@latest-kf6'
'frameworks/kiconthemes': '@latest-kf6'
'frameworks/kio': '@latest-kf6'
'frameworks/knewstuff': '@latest-kf6'
'frameworks/knotifyconfig': '@latest-kf6'
'frameworks/kparts': '@latest-kf6'
'frameworks/kservice': '@latest-kf6'
'frameworks/ktextwidgets': '@latest-kf6'
'frameworks/kwidgetsaddons': '@latest-kf6'
'frameworks/kwindowsystem': '@latest-kf6'
'frameworks/kxmlgui': '@latest-kf6'
'frameworks/kdoctools': '@latest-kf6'
- 'on': ['Linux/Qt5', 'FreeBSD/Qt5']
'require':
'frameworks/kpty': '@stable'
'frameworks/kglobalaccel': '@stable'
- 'on': ['Linux/Qt6', 'FreeBSD/Qt6']
'require':
'frameworks/kpty': '@latest-kf6'
'frameworks/kglobalaccel': '@latest-kf6'
Options:
require-passing-tests-on: [ 'Linux', 'FreeBSD' ]

View File

@@ -16,12 +16,12 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
# Match KDE Frameworks update Apr 2021
set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.71.0")
set (KF_MIN_VERSION "5.71.0")
# Release script will create bugzilla versions
project(konsole VERSION ${RELEASE_SERVICE_VERSION})
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
include(KDEInstallDirs)
@@ -51,14 +51,8 @@ if(ECM_GLOBAL_FIND_VERSION VERSION_LESS "5.82.0")
endif()
endif()
if(QT_MAJOR_VERSION EQUAL "6")
# ECMDeprecationSettings is in ECM since 5.91, this assumes if you're building
# with Qt6, you have latest ECM anyway
include(ECMDeprecationSettings)
ecm_set_disabled_deprecation_versions(
QT 5.15.2
KF 5.93.0
)
if(QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6Core5Compat ${QT_MIN_VERSION} CONFIG REQUIRED)
endif()
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KONSOLEPRIVATE
@@ -72,7 +66,7 @@ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED
Widgets
)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED
Bookmarks
Config
ConfigWidgets
@@ -84,7 +78,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
IconThemes
KIO
NewStuff
NewStuffCore
Notifications
NotifyConfig
Parts
@@ -96,14 +89,14 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
)
if (NOT WIN32)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED
GlobalAccel
Pty
)
endif()
find_package(KF5DocTools ${KF5_MIN_VERSION})
set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
find_package(KF${QT_MAJOR_VERSION}DocTools ${KF_MIN_VERSION})
set_package_properties(KF${QT_MAJOR_VERSION}DocTools PROPERTIES DESCRIPTION
"Tools to generate documentation"
TYPE OPTIONAL
)
@@ -150,7 +143,7 @@ if (NOT WIN32)
add_subdirectory( kconf_update )
endif()
if (KF5DocTools_FOUND)
if (KF${QT_MAJOR_VERSION}DocTools_FOUND)
add_subdirectory( doc/manual )
endif()
@@ -170,7 +163,7 @@ ecm_qt_install_logging_categories(
)
ki18n_install( po )
if (KF5DocTools_FOUND)
if (KF${QT_MAJOR_VERSION}DocTools_FOUND)
kdoctools_install( po )
endif()

View File

@@ -8,7 +8,9 @@ install( FILES org.kde.konsole.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kgloba
if(ECM_VERSION VERSION_GREATER_EQUAL "5.89.0")
install(FILES terminalemulator.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPESDIR})
install(FILES konsolepart.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
if(QT_MAJOR_VERSION STREQUAL "5")
install(FILES konsolepart.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
endif()
install(FILES konsole.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
else()
install(FILES terminalemulator.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
@@ -16,7 +18,7 @@ else()
install(FILES konsole.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR})
endif()
if(KF5KIO_VERSION VERSION_GREATER_EQUAL "5.85.0")
if(KF${QT_MAJOR_VERSION}KIO_VERSION VERSION_GREATER_EQUAL "5.85.0")
install( PROGRAMS konsolerun.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kio/servicemenus )
else()
install( FILES konsolerun.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/ServiceMenus )

View File

@@ -3,9 +3,9 @@ add_executable(konsole_globalaccel
)
target_link_libraries(konsole_globalaccel PRIVATE
KF5::ConfigCore
KF5::GlobalAccel
KF5::Service
KF${QT_MAJOR_VERSION}::ConfigCore
KF${QT_MAJOR_VERSION}::GlobalAccel
KF${QT_MAJOR_VERSION}::Service
)
@@ -15,7 +15,8 @@ qt_add_resources(konsole_show_menubar_SRCS ../desktop/konsole.qrc)
add_executable(konsole_show_menubar ${konsole_show_menubar_SRCS})
target_link_libraries(konsole_show_menubar
KF5::XmlGui
KF${QT_MAJOR_VERSION}::XmlGui
KF${QT_MAJOR_VERSION}::CoreAddons
)

View File

@@ -15,6 +15,9 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
#include <KColorSchemeMenu>
#endif
AppColorSchemeChooser::AppColorSchemeChooser(QObject *parent)
: QAction(parent)
@@ -29,7 +32,11 @@ AppColorSchemeChooser::AppColorSchemeChooser(QObject *parent)
manager->activateScheme(manager->indexForScheme(scheme));
#else
manager->setAutosaveChanges(true);
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
KActionMenu *selectionMenu = KColorSchemeMenu::createMenu(manager, this);
#else
KActionMenu *selectionMenu = manager->createSchemeSelectionMenu(this);
#endif
#endif
setMenu(selectionMenu->menu());

View File

@@ -9,7 +9,7 @@ else()
set(HAVE_OS_DRAGONFLYBSD 0)
endif()
IF(NOT (${KF5_VERSION} VERSION_LESS "5.60.0"))
IF(NOT (${KF${QT_MAJOR_VERSION}_VERSION} VERSION_LESS "5.60.0"))
set(USE_TERMINALINTERFACEV2 1)
endif()
@@ -62,26 +62,26 @@ qt_add_dbus_adaptor(
)
set(konsole_LIBS
KF5::XmlGui
KF${QT_MAJOR_VERSION}::XmlGui
Qt::Multimedia
Qt::PrintSupport
Qt::Xml
KF5::Notifications
KF5::WindowSystem
KF5::TextWidgets
KF5::GuiAddons
KF5::IconThemes
KF5::Bookmarks
KF5::I18n
KF5::KIOWidgets
KF5::DBusAddons
KF5::NewStuff
KF${QT_MAJOR_VERSION}::Notifications
KF${QT_MAJOR_VERSION}::WindowSystem
KF${QT_MAJOR_VERSION}::TextWidgets
KF${QT_MAJOR_VERSION}::GuiAddons
KF${QT_MAJOR_VERSION}::IconThemes
KF${QT_MAJOR_VERSION}::Bookmarks
KF${QT_MAJOR_VERSION}::I18n
KF${QT_MAJOR_VERSION}::KIOWidgets
KF${QT_MAJOR_VERSION}::DBusAddons
KF${QT_MAJOR_VERSION}::NewStuffCore
)
if (NOT WIN32)
list(APPEND konsole_LIBS
KF5::Pty
KF5::GlobalAccel
KF${QT_MAJOR_VERSION}::Pty
KF${QT_MAJOR_VERSION}::GlobalAccel
)
endif()
@@ -109,7 +109,7 @@ ecm_qt_declare_logging_category(
add_library(konsoleprivate_core STATIC ${konsoleprivate_core_SRCS})
# Needed to link this static lib to shared libs
set_target_properties(konsoleprivate_core PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(konsoleprivate_core KF5::CoreAddons)
target_link_libraries(konsoleprivate_core KF${QT_MAJOR_VERSION}::CoreAddons)
set(konsolehelpers_SRCS
LabelsAligner.cpp
@@ -275,13 +275,21 @@ target_link_libraries(konsoleprivate
konsolehelpers
konsolecharacters
konsoledecoders
KF5::NewStuffWidgets
KF${QT_MAJOR_VERSION}::NewStuffCore
KF${QT_MAJOR_VERSION}::NewStuffWidgets
${konsole_LIBS}
ZLIB::ZLIB
ICU::uc
ICU::i18n
)
if(QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(konsoleprivate
PUBLIC
Qt6::Core5Compat
)
endif()
set_target_properties(konsoleprivate PROPERTIES
VERSION ${KONSOLEPRIVATE_VERSION}
SOVERSION ${KONSOLEPRIVATE_SOVERSION}
@@ -309,13 +317,13 @@ target_compile_definitions(konsoleapp PRIVATE -DRELEASE_SERVICE_VERSION="${RELEA
target_link_libraries(konsoleapp
konsoleprivate
KF5::XmlGui
KF5::WindowSystem
KF5::Bookmarks
KF5::I18n
KF5::KIOWidgets
KF5::NotifyConfig
KF5::Crash
KF${QT_MAJOR_VERSION}::XmlGui
KF${QT_MAJOR_VERSION}::WindowSystem
KF${QT_MAJOR_VERSION}::Bookmarks
KF${QT_MAJOR_VERSION}::I18n
KF${QT_MAJOR_VERSION}::KIOWidgets
KF${QT_MAJOR_VERSION}::NotifyConfig
KF${QT_MAJOR_VERSION}::Crash
)
set_target_properties(konsoleapp PROPERTIES
@@ -336,13 +344,13 @@ add_executable(konsole ${konsole_SRCS} ${ICONS_SOURCES})
target_link_libraries(konsole
konsoleprivate
konsoleapp
KF5::XmlGui
KF5::WindowSystem
KF5::Bookmarks
KF5::I18n
KF5::KIOWidgets
KF5::NotifyConfig
KF5::Crash
KF${QT_MAJOR_VERSION}::XmlGui
KF${QT_MAJOR_VERSION}::WindowSystem
KF${QT_MAJOR_VERSION}::Bookmarks
KF${QT_MAJOR_VERSION}::I18n
KF${QT_MAJOR_VERSION}::KIOWidgets
KF${QT_MAJOR_VERSION}::NotifyConfig
KF${QT_MAJOR_VERSION}::Crash
)
if(APPLE)
@@ -369,14 +377,17 @@ set(konsolepart_PART_SRCS Part.cpp
add_library(konsolepart MODULE ${konsolepart_PART_SRCS})
generate_export_header(konsolepart BASE_NAME konsole)
kcoreaddons_desktop_to_json(konsolepart ../desktop/konsolepart.desktop)
set_target_properties(konsolepart PROPERTIES DEFINE_SYMBOL KONSOLE_PART)
target_link_libraries(konsolepart
KF5::Parts
KF5::XmlGui
KF${QT_MAJOR_VERSION}::Parts
KF${QT_MAJOR_VERSION}::XmlGui
konsoleprivate
)
install(TARGETS konsolepart DESTINATION ${KDE_INSTALL_PLUGINDIR})
if(QT_MAJOR_VERSION STREQUAL "6")
install(TARGETS konsolepart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf6/parts)
else()
install(TARGETS konsolepart DESTINATION ${KDE_INSTALL_PLUGINDIR})
endif()
# Add cmake-options -DBUILD_COVERAGE=ON -DCOVERAGE_GENERATE_HTML=ON
if(COVERAGE_GENERATE_HTML)

View File

@@ -38,7 +38,11 @@ using namespace Konsole;
K_PLUGIN_FACTORY_WITH_JSON(KonsolePartFactory, "konsolepart.json", registerPlugin<Konsole::Part>();)
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
Part::Part(QObject *parent, const QVariantList &)
#else
Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
#endif
: KParts::ReadOnlyPart(parent)
, _viewManager(nullptr)
, _pluggedController(nullptr)
@@ -51,7 +55,11 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
connect(_viewManager, &Konsole::ViewManager::empty, this, &Konsole::Part::terminalExited);
connect(_viewManager, &Konsole::ViewManager::newViewRequest, this, &Konsole::Part::newTab);
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
_viewManager->widget()->setParent(widget());
#else
_viewManager->widget()->setParent(parentWidget);
#endif
setWidget(_viewManager->widget());
actionCollection()->addAssociatedWidget(_viewManager->widget());

View File

@@ -45,7 +45,11 @@ class Part : public KParts::ReadOnlyPart, public TerminalInterface
#endif
public:
/** Constructs a new Konsole part with the specified parent. */
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
explicit Part(QObject *parent, const QVariantList &);
#else
explicit Part(QWidget *parentWidget, QObject *parent, const QVariantList &);
#endif
~Part() override;
/** Reimplemented from TerminalInterface. */

View File

@@ -30,7 +30,7 @@ endif(BUILD_SHARED_LIBS)
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ecm_add_test(
PartTest.cpp
LINK_LIBRARIES KF5::XmlGui KF5::Parts KF5::Pty ${KONSOLE_TEST_LIBS}
LINK_LIBRARIES KF${QT_MAJOR_VERSION}::XmlGui KF${QT_MAJOR_VERSION}::Parts KF${QT_MAJOR_VERSION}::Pty ${KONSOLE_TEST_LIBS}
)
endif()
@@ -48,12 +48,12 @@ ecm_add_tests(
Vt102EmulationTest.cpp
LINK_LIBRARIES ${KONSOLE_TEST_LIBS}
)
target_link_libraries(PtyTest KF5::Pty ${KONSOLE_TEST_LIBS})
target_link_libraries(PtyTest KF${QT_MAJOR_VERSION}::Pty ${KONSOLE_TEST_LIBS})
ecm_add_tests(
HistoryTest.cpp
SessionTest.cpp
TerminalInterfaceTest.cpp
TerminalTest.cpp
LINK_LIBRARIES ${KONSOLE_TEST_LIBS} KF5::Parts
LINK_LIBRARIES ${KONSOLE_TEST_LIBS} KF${QT_MAJOR_VERSION}::Parts
)

158
src/konsolepart.json Normal file
View File

@@ -0,0 +1,158 @@
{
"KPlugin": {
"Description": "Command line access",
"Description[ar]": "الوصول إلى سطر الأوامر",
"Description[az]": "Əmrlər sətirinə giriş",
"Description[be@latin]": "Dostup da zahadnaha radka",
"Description[be]": "Доступ да загаднага радка",
"Description[bg]": "Достъп до команден ред",
"Description[ca@valencia]": "Accés a la línia d'ordres",
"Description[ca]": "Accés a la línia d'ordres",
"Description[cs]": "Přístup k příkazové řádce",
"Description[da]": "Kommandolinjetilgang",
"Description[de]": "Zugriff auf die Befehlszeile",
"Description[el]": "Πρόσβαση από τη γραμμή εντολών",
"Description[en_GB]": "Command line access",
"Description[eo]": "Aliro al komandlinio",
"Description[es]": "Acceso a la línea de órdenes",
"Description[et]": "Käsurea kasutamine",
"Description[eu]": "Komando-lerrora sarbidea",
"Description[fa]": "دسترسی خط فرمان",
"Description[fi]": "Pääsy komentoriville",
"Description[fr]": "Ligne de commande",
"Description[gl]": "Acceso á liña de ordes.",
"Description[he]": "גישה לשורת הפקודה",
"Description[hu]": "Parancssori hozzáférés",
"Description[ia]": "Accesso a linea de commando",
"Description[id]": "Akses baris perintah",
"Description[is]": "Aðgangur með skipanalínu",
"Description[it]": "Accesso alla riga di comando",
"Description[ka]": "ბრძანების სტრიქონთან წვდომა",
"Description[ko]": "명령행 접근",
"Description[nb]": "Tilgang til kommandolinje",
"Description[nl]": "Toegang tot de opdrachtregel",
"Description[nn]": "Kommandolinjetilgang",
"Description[pl]": "Dostęp do wiersza poleceń",
"Description[pt]": "Acesso à linha de comandos",
"Description[pt_BR]": "Acesso à linha de comandos",
"Description[ro]": "Acces în linie de comandă",
"Description[ru]": "Доступ к командной строке",
"Description[sk]": "Prístup na príkazový riadok",
"Description[sl]": "Dostop do ukazne vrstice",
"Description[sr@ijekavian]": "Приступ командној линији",
"Description[sr@ijekavianlatin]": "Pristup komandnoj liniji",
"Description[sr@latin]": "Pristup komandnoj liniji",
"Description[sr]": "Приступ командној линији",
"Description[sv]": "Åtkomst till kommandorad",
"Description[ta]": "கட்டளை வரியை அணுக உதவும்",
"Description[tr]": "Komut satırı erişimi",
"Description[uk]": "Доступ до командного рядка",
"Description[x-test]": "xxCommand line accessxx",
"Description[zh_CN]": "命令行访问",
"Description[zh_TW]": "指令列",
"Icon": "utilities-terminal",
"Name": "Terminal Emulator",
"Name[af]": "Terminaal Emulasie",
"Name[ar]": "محاكي الطرفية",
"Name[az]": "Terminal emulyatoru",
"Name[be@latin]": "Emuliatar terminala",
"Name[be]": "Эмулятар тэрмінала",
"Name[bg]": "Терминален емулатор",
"Name[bn]": "টার্মিনাল এমুলেটর",
"Name[bn_IN]": "টার্মিন্যাল এমুলেটর",
"Name[br]": "Kendarvanerezh termenell",
"Name[bs]": "Oponašanje terminala",
"Name[ca@valencia]": "Emulador de terminal",
"Name[ca]": "Emulador de terminal",
"Name[cs]": "Emulátor terminálu",
"Name[csb]": "Emùlator terminala",
"Name[cy]": "Efelychydd Terfynell",
"Name[da]": "Terminalemulator",
"Name[de]": "Terminal-Emulator",
"Name[el]": "Εξομοιωτής τερματικού",
"Name[en_GB]": "Terminal Emulator",
"Name[eo]": "Terminala imitilo",
"Name[es]": "Emulador de terminal",
"Name[et]": "Terminaliemulaator",
"Name[eu]": "Terminal emulatzailea",
"Name[fa]": "مقلد پایانه",
"Name[fi]": "Pääte-emulaattori",
"Name[fr]": "Émulateur de terminal",
"Name[fy]": "Terminal",
"Name[ga]": "Aithriseoir Teirminéil",
"Name[gl]": "Emulador de terminal",
"Name[gu]": "ટર્મિનલ ઇમ્યુલેટર",
"Name[he]": "מדמה מסוף",
"Name[hi]": "टर्मिनल एमुलेटर",
"Name[hne]": "टर्मिनल एमुलेटर",
"Name[hr]": "Emulator terminala",
"Name[hsb]": "Emulator za terminal",
"Name[hu]": "Terminálemulátor",
"Name[ia]": "Emulator de terminal",
"Name[id]": "Emulator Terminal",
"Name[is]": "Skjáhermir",
"Name[it]": "Emulatore di terminale",
"Name[ja]": "ターミナルエミュレータ",
"Name[ka]": "ტერმინალის ემულატორი",
"Name[kk]": "Терминал эмуляторы",
"Name[km]": "កម្មវិធី​​ត្រាប់​តាម​ស្ថានីយ",
"Name[kn]": "ಆದೇಶತೆರೆ ಅನುವರ್ತಕ (ಎಮುಲೇಟರ್)",
"Name[ko]": "터미널 에뮬레이터",
"Name[ku]": "Emulatora Termînalê",
"Name[lt]": "Terminalo emuliatorius",
"Name[lv]": "Termināla emulators",
"Name[mai]": "टर्मिनल एमुलेटर",
"Name[mk]": "Терминалски емулатор",
"Name[ml]": "ടെര്‍മിനല്‍ എമുലേറ്റര്‍",
"Name[mr]": "टर्मिनल एम्युलेटर",
"Name[ms]": "Pelagak Terminal",
"Name[nb]": "Terminalemulator",
"Name[nds]": "Terminal-Emulator",
"Name[ne]": "टर्मिनल इमुलेटर",
"Name[nl]": "Terminalprogramma",
"Name[nn]": "Terminalemulator",
"Name[or]": "ଟର୍ମିନାଲ ଯାନ୍ତ୍ରାନୁକରଣ",
"Name[pa]": "ਟਰਮੀਨਲ ਸਮਰੂਪ",
"Name[pl]": "Emulator terminala",
"Name[pt]": "Emulador de Terminal",
"Name[pt_BR]": "Emulador de Terminal",
"Name[ro]": "Emulator de terminal",
"Name[ru]": "Эмулятор терминала",
"Name[se]": "Terminálemuláhtor",
"Name[si]": "අග්‍ර අනුකාරක",
"Name[sk]": "Emulátor terminálu",
"Name[sl]": "Posnemovalnik terminala",
"Name[sr@ijekavian]": "Емулатор терминала",
"Name[sr@ijekavianlatin]": "Emulator terminala",
"Name[sr@latin]": "Emulator terminala",
"Name[sr]": "Емулатор терминала",
"Name[sv]": "Terminalemulator",
"Name[ta]": "முனைய செயலி",
"Name[te]": "టెర్మినల్ ఎములేటర్",
"Name[tg]": "Тақлидгари терминал",
"Name[th]": "โปรแกรมจำลองเทอร์มินัล",
"Name[tr]": "Uçbirim Öykünücü",
"Name[ug]": "تېرمىنال تەقلىدلەشتۈرگۈچ",
"Name[uk]": "Емулятор термінала",
"Name[uz@cyrillic]": "Терминал эмулятори",
"Name[uz]": "Terminal emulyatori",
"Name[vi]": "Mô phỏng thiết bị cuối",
"Name[wa]": "Programes terminås",
"Name[x-test]": "xxTerminal Emulatorxx",
"Name[xh]": "Umzami kulinganisela ngokulinganayo Wendlela yesiphelo",
"Name[zh_CN]": "终端仿真器",
"Name[zh_TW]": "終端機模擬程式",
"ServiceTypes": [
"KParts/ReadOnlyPart",
"Browser/View",
"inode/directory",
"TerminalEmulator"
]
},
"X-KDE-AuthorizeAction": "shell_access",
"X-KDE-BrowserView-AllowAsDefault": false,
"X-KDE-BrowserView-FollowActive": true,
"X-KDE-BrowserView-HideFromMenus": true,
"X-KDE-BrowserView-Toggable": true,
"X-KDE-BrowserView-ToggableView-Orientation": "horizontal"
}

View File

@@ -812,9 +812,14 @@ void SessionController::setupCommonActions()
this,
#endif
&Konsole::SessionController::changeCodec);
#else
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
connect(_codecAction, &KCodecAction::codecNameTriggered, this, [this](const QByteArray &codecName) {
changeCodec(QTextCodec::codecForName(codecName));
#else
connect(_codecAction, &KCodecAction::codecNameTriggered, this, [this](const QString &codecName) {
changeCodec(QTextCodec::codecForName(codecName.toUtf8()));
#endif
});
#endif
@@ -880,7 +885,11 @@ void SessionController::setupExtraActions()
copyInputActions->addAction(copyInputToAllTabsAction);
copyInputActions->addAction(copyInputToSelectedTabsAction);
copyInputActions->addAction(copyInputToNoneAction);
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
connect(copyInputActions, &KSelectAction::actionTriggered, this, &Konsole::SessionController::copyInputActionsTriggered);
#else
connect(copyInputActions, QOverload<QAction *>::of(&KSelectAction::triggered), this, &Konsole::SessionController::copyInputActionsTriggered);
#endif
action = collection->addAction(QStringLiteral("zmodem-upload"), this, &SessionController::zmodemUpload);
action->setText(i18n("&ZModem Upload..."));
@@ -939,7 +948,11 @@ void SessionController::setupExtraActions()
// Send signal
auto *sendSignalActions = collection->add<KSelectAction>(QStringLiteral("send-signal"));
sendSignalActions->setText(i18n("Send Signal"));
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
connect(sendSignalActions, &KSelectAction::actionTriggered, this, &Konsole::SessionController::sendSignal);
#else
connect(sendSignalActions, QOverload<QAction *>::of(&KSelectAction::triggered), this, &Konsole::SessionController::sendSignal);
#endif
action = collection->addAction(QStringLiteral("sigstop-signal"));
action->setText(i18n("&Suspend Task") + QStringLiteral(" (STOP)"));

View File

@@ -8,6 +8,6 @@ set(KONSOLE_TEST_LIBS Qt::Test konsoleprivate)
add_executable(PartManualTest PartManualTest.cpp)
ecm_mark_as_test(PartManualTest)
target_link_libraries(PartManualTest KF5::XmlGui KF5::Parts KF5::Pty
target_link_libraries(PartManualTest KF${QT_MAJOR_VERSION}::XmlGui KF${QT_MAJOR_VERSION}::Parts KF${QT_MAJOR_VERSION}::Pty
${KONSOLE_TEST_LIBS})

View File

@@ -15,8 +15,8 @@ include(FeatureSummary)
set(QT_MIN_VERSION "5.4.0")
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets)
set(REQUIRED_KF5_VERSION "5.18.0")
find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS
set(REQUIRED_KF_VERSION "5.18.0")
find_package(KF${QT_MAJOR_VERSION} ${REQUIRED_KF_VERSION} REQUIRED COMPONENTS
CoreAddons
I18n
)

View File

@@ -6,11 +6,11 @@ set(demo_konsolepart_SRCS
add_executable(demo_konsolepart ${demo_konsolepart_SRCS})
target_link_libraries(demo_konsolepart
KF5::CoreAddons
KF5::I18n
KF5::Parts
KF5::Pty
KF${QT_MAJOR_VERSION}::CoreAddons
KF${QT_MAJOR_VERSION}::I18n
KF${QT_MAJOR_VERSION}::Parts
KF${QT_MAJOR_VERSION}::Pty
Qt::Widgets
KF5::XmlGui
KF5::WindowSystem
KF${QT_MAJOR_VERSION}::XmlGui
KF${QT_MAJOR_VERSION}::WindowSystem
)

View File

@@ -51,7 +51,11 @@
#include "WindowSystemInfo.h"
#include "profile/ProfileManager.h"
using namespace Konsole;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#define KNSCore KNS3
#endif
using namespace Konsole;
EditProfileDialog::EditProfileDialog(QWidget *parent)
: KPageDialog(parent)
@@ -844,8 +848,8 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr &profile)
auto *getNewButton = new KNSWidgets::Button(this);
connect(getNewButton, &KNSWidgets::Button::dialogFinished, this, &Konsole::EditProfileDialog::gotNewColorSchemes);
#else
auto *getNewButton = new KNS3::Button(this);
connect(getNewButton, &KNS3::Button::dialogFinished, this, &Konsole::EditProfileDialog::gotNewColorSchemes);
auto *getNewButton = new KNSCore::Button(this);
connect(getNewButton, &KNSCore::Button::dialogFinished, this, &Konsole::EditProfileDialog::gotNewColorSchemes);
#endif
getNewButton->setText(QStringLiteral("Get New..."));
getNewButton->setConfigFile(QStringLiteral("konsole.knsrc"));
@@ -1223,15 +1227,21 @@ void EditProfileDialog::removeColorScheme()
}
#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 91, 0)
void EditProfileDialog::gotNewColorSchemes(const QList<KNSCore::EntryInternal> &changedEntries)
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
void EditProfileDialog::gotNewColorSchemes(const QList<KNSCore::Entry> &changedEntries)
#else
void EditProfileDialog::gotNewColorSchemes(const KNS3::Entry::List &changedEntries)
#undef KNSCore
void EditProfileDialog::gotNewColorSchemes(const QList<KNSCore::EntryInternal> &changedEntries)
#define KNSCore KNS3
#endif
#else
void EditProfileDialog::gotNewColorSchemes(const KNSCore::Entry::List &changedEntries)
#endif
{
int failures = 0;
for (auto &entry : qAsConst(changedEntries)) {
switch (entry.status()) {
case KNS3::Entry::Installed:
case KNSCore::Entry::Installed:
for (const QString &file : entry.installedFiles()) {
if (ColorSchemeManager::instance()->loadColorScheme(file)) {
continue;
@@ -1245,7 +1255,7 @@ void EditProfileDialog::gotNewColorSchemes(const KNS3::Entry::List &changedEntri
QTimer::singleShot(8000, _appearanceUi->colorSchemeMessageWidget, &KMessageWidget::animatedHide);
}
break;
case KNS3::Entry::Deleted:
case KNSCore::Entry::Deleted:
for (const auto &file : entry.uninstalledFiles()) {
if (ColorSchemeManager::instance()->unloadColorScheme(file)) {
continue;
@@ -1255,11 +1265,11 @@ void EditProfileDialog::gotNewColorSchemes(const KNS3::Entry::List &changedEntri
// it either wasn't loaded or was invalid to begin with.
}
break;
case KNS3::Entry::Invalid:
case KNS3::Entry::Installing:
case KNS3::Entry::Downloadable:
case KNS3::Entry::Updateable:
case KNS3::Entry::Updating:
case KNSCore::Entry::Invalid:
case KNSCore::Entry::Installing:
case KNSCore::Entry::Downloadable:
case KNSCore::Entry::Updateable:
case KNSCore::Entry::Updating:
// Not interesting.
break;
}
@@ -1881,9 +1891,14 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr &profile)
this,
#endif
&Konsole::EditProfileDialog::setDefaultCodec);
#else
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
connect(codecAction, &KCodecAction::codecNameTriggered, this, [this](const QByteArray &codecName) {
setDefaultCodec(QTextCodec::codecForName(codecName));
#else
connect(codecAction, &KCodecAction::codecNameTriggered, this, [this](const QString &codecName) {
setDefaultCodec(QTextCodec::codecForName(codecName.toUtf8()));
#endif
});
#endif

View File

@@ -8,9 +8,14 @@
#ifndef EDITPROFILEDIALOG_H
#define EDITPROFILEDIALOG_H
#include <QtGlobal>
// KDE
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
#include <KNSCore/Entry>
#else
#include <KNS3/Entry>
#include <KNSCore/EntryInternal>
#endif
#include <KPageDialog>
#include <knewstuff_version.h>
@@ -157,7 +162,11 @@ private Q_SLOTS:
void togglebidiLineLTR(bool);
#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 91, 0)
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
void gotNewColorSchemes(const QList<KNSCore::Entry> &changedEntries);
#else
void gotNewColorSchemes(const QList<KNSCore::EntryInternal> &changedEntries);
#endif
#else
void gotNewColorSchemes(const KNS3::Entry::List &changedEntries);
#endif

View File

@@ -10,7 +10,7 @@ if(KONSOLE_BUILD_UNI2CHARACTERWIDTH)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED
Core
)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED
KIO
)
@@ -24,7 +24,7 @@ if(KONSOLE_BUILD_UNI2CHARACTERWIDTH)
add_executable(uni2characterwidth ${uni2characterwidth_SRC})
target_link_libraries(uni2characterwidth
Qt::Core
KF5::KIOCore
KF${QT_MAJOR_VERSION}::KIOCore
)
endif()