Skip to content

Commit

Permalink
fix: local keytab logic error
Browse files Browse the repository at this point in the history
 * Get value, not variable for cmake generator expression.
 * Local first, not local only.
  • Loading branch information
asterwyx committed Mar 7, 2024
1 parent 13948b7 commit a1fe10a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions 3rdparty/terminalwidget/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -256,7 +256,7 @@ target_compile_definitions(${TERMINALWIDGET_LIBRARY_NAME}
"TRANSLATIONS_DIR=\"${TRANSLATIONS_DIR}\""
"HAVE_POSIX_OPENPT"
"HAVE_SYS_TIME_H"
$<$<BOOL:RUNDIR_KEYBOARD_LAYOUT_FIRST>:RUNDIR_KEYBOARD_LAYOUT_FIRST>
$<$<BOOL:${RUNDIR_KEYBOARD_LAYOUT_FIRST}>:RUNDIR_KEYBOARD_LAYOUT_FIRST>
)


Expand Down
14 changes: 10 additions & 4 deletions 3rdparty/terminalwidget/lib/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a1fe10a

Please sign in to comment.