diff --git a/3rdparty/terminalwidget/CMakeLists.txt b/3rdparty/terminalwidget/CMakeLists.txt index 1391c909c..7582ec312 100644 --- a/3rdparty/terminalwidget/CMakeLists.txt +++ b/3rdparty/terminalwidget/CMakeLists.txt @@ -156,10 +156,10 @@ set(HDRS_DISTRIB ) option(RUNDIR_KEYBOARD_LAYOUT_FIRST "Load keyboard layouts from application runtime directory" OFF) -message(STATUS "Use runtime directory keyboard layouts first: ${RUNDIR_KEYBOARD_LAYOUT_FIRST}") if(CMAKE_BUILD_TYPE MATCHES Debug) set(RUNDIR_KEYBOARD_LAYOUT_FIRST ON) # enable runtime layouts loading for debug endif() +message(STATUS "Use runtime directory keyboard layouts first: ${RUNDIR_KEYBOARD_LAYOUT_FIRST}") # dirs set(KB_LAYOUT_DIR "${CMAKE_INSTALL_FULL_DATADIR}/${TERMINALWIDGET_LIBRARY_NAME}/kb-layouts") @@ -256,7 +256,7 @@ target_compile_definitions(${TERMINALWIDGET_LIBRARY_NAME} "TRANSLATIONS_DIR=\"${TRANSLATIONS_DIR}\"" "HAVE_POSIX_OPENPT" "HAVE_SYS_TIME_H" - $<$:RUNDIR_KEYBOARD_LAYOUT_FIRST> + $<$:RUNDIR_KEYBOARD_LAYOUT_FIRST> ) diff --git a/3rdparty/terminalwidget/lib/tools.cpp b/3rdparty/terminalwidget/lib/tools.cpp index 098c363cb..c54d90ea6 100644 --- a/3rdparty/terminalwidget/lib/tools.cpp +++ b/3rdparty/terminalwidget/lib/tools.cpp @@ -40,14 +40,20 @@ QString get_kb_layout_dir() } else if (d.exists("../Resources/kb-layouts")) { ret = d.absoluteFilePath("../Resources/kb-layouts"); } -#else + if (!ret.isEmpty()) { + qCInfo(qLcTools) << "Found local keyboard layout directory:" << ret; + return ret.append(QDir::separator()); + } +#endif d.setPath(QLatin1String(KB_LAYOUT_DIR)); if (d.exists()) { ret = d.absolutePath(); + qCInfo(qLcTools) << "Found global keyboard layout directory:" << ret; + return ret.append(QDir::separator()); + } else { + qCWarning(qLcTools) << "Keyboard layout directory not found!"; + return ""; } -#endif - qCInfo(qLcTools) << "Found keyboard layout directory:" << ret; - return ret.append(QDir::separator()); } /*! Helper function to add custom location of color schemes.