Skip to content

Commit 7dede8b

Browse files
committed
Remove configtool & obsoleted part in fcitx5-diagnose.
There's never fcitx5-config-gtk, and also, the log is duplicated between fcitx5-configtool & fcitx5-diagnose. The package name is also not sync'ed. So better to let fcitx5-configtool to its job.
1 parent 1fe6ca1 commit 7dede8b

File tree

1 file changed

+0
-101
lines changed

1 file changed

+0
-101
lines changed

data/fcitx5-diagnose.sh

-101
Original file line numberDiff line numberDiff line change
@@ -1012,106 +1012,6 @@ check_fcitx() {
10121012
fi
10131013
}
10141014

1015-
_find_config_gtk() {
1016-
[ -n "${_config_tool_gtk_exe}" ] && {
1017-
echo "${_config_tool_gtk_exe}"
1018-
return 0
1019-
}
1020-
local config_gtk
1021-
config_gtk="$(command -v "fcitx5-config-gtk" 2> /dev/null)" || return 1
1022-
echo "${config_gtk}"
1023-
_config_tool_gtk_exe="${config_gtk}"
1024-
}
1025-
1026-
_check_config_gtk_version() {
1027-
local version=$1
1028-
local config_gtk
1029-
[ -z "${_config_tool_gtk_version}" ] && {
1030-
config_gtk="$(_find_config_gtk)" || return 1
1031-
ld_info="$(ldd "$config_gtk" 2> /dev/null)" ||
1032-
ld_info="$(objdump -p "$config_gtk" 2> /dev/null)" || return 1
1033-
if [[ $ld_info =~ libgtk[-._a-zA-Z0-9]*3[-._a-zA-Z0-9]*\.so ]]; then
1034-
_config_tool_gtk_version=3
1035-
elif [[ $ld_info =~ libgtk[-._a-zA-Z0-9]*2[-._a-zA-Z0-9]*\.so ]]; then
1036-
_config_tool_gtk_version=2
1037-
else
1038-
return 1
1039-
fi
1040-
}
1041-
[ "${_config_tool_gtk_version}" = "$version" ]
1042-
}
1043-
1044-
_check_config_gtk() {
1045-
local version=$1
1046-
local config_gtk config_gtk_name
1047-
write_order_list_eval "$(_ 'Config GUI for gtk${1}:')" "${version}"
1048-
if ! config_gtk="$(command -v "fcitx5-config-gtk${version}" 2> /dev/null)"; then
1049-
if ! _check_config_gtk_version "${version}"; then
1050-
write_error_eval \
1051-
"$(_ 'Config GUI for gtk${1} not found.')" "${version}"
1052-
return 1
1053-
else
1054-
config_gtk=$(_find_config_gtk)
1055-
config_gtk_name="fcitx5-config-gtk"
1056-
fi
1057-
else
1058-
config_gtk_name="fcitx5-config-gtk${version}"
1059-
fi
1060-
write_eval "$(_ 'Found ${1} at ${2}.')" \
1061-
"$(code_inline "${config_gtk_name}")" \
1062-
"$(code_inline "${config_gtk}")"
1063-
}
1064-
1065-
_check_config_qt() {
1066-
local config_qt config_qt_name
1067-
config_qt_name="fcitx5-config-qt"
1068-
write_order_list_eval "$(_ 'Config GUI for qt:')" "${version}"
1069-
if ! config_qt="$(command -v "${config_qt_name}" 2> /dev/null)"; then
1070-
write_error "$(_ 'Config GUI for qt not found.')"
1071-
return 1
1072-
fi
1073-
write_eval "$(_ 'Found ${1} at ${2}.')" \
1074-
"$(code_inline "${config_qt_name}")" \
1075-
"$(code_inline "${config_qt}")"
1076-
}
1077-
1078-
_check_config_kcm() {
1079-
local version=$1
1080-
local kcm_shell config_kcm
1081-
write_order_list "$(_ 'Config GUI for kde:')"
1082-
if ! kcm_shell="$(command -v "kcmshell${version}" 2> /dev/null)"; then
1083-
write_error "$(print_not_found "kcmshell${version}")"
1084-
return 1
1085-
fi
1086-
config_kcm="$(${kcm_shell} --list 2> /dev/null | grep -i fcitx5)" && {
1087-
write_eval "$(_ 'Found ${1} kcm module.')" fcitx5
1088-
write_quote_str "${config_kcm}"
1089-
return 0
1090-
}
1091-
return 1
1092-
}
1093-
1094-
check_config_ui() {
1095-
local IFS=$'\n'
1096-
write_title 1 "$(_ 'Fcitx Configure UI:')"
1097-
write_order_list "$(_ 'Config Tool Wrapper:')"
1098-
if ! fcitx_configtool="$(command -v fcitx5-configtool 2> /dev/null)"; then
1099-
write_error_eval "$(_ 'Cannot find ${1} executable!')" fcitx5-configtool
1100-
else
1101-
write_eval "$(_ 'Found ${1} at ${2}.')" \
1102-
fcitx5-configtool \
1103-
"$(code_inline "${fcitx_configtool}")"
1104-
fi
1105-
local config_backend_found=0
1106-
_check_config_qt && config_backend_found=1
1107-
_check_config_kcm 5 && config_backend_found=1
1108-
if ((!config_backend_found)) && [[ -n "$DISPLAY$WAYLAND_DISPLAY" ]]; then
1109-
write_error_eval "$(_ 'Cannot find a GUI config tool, please install one of ${1}, or ${2}.')" \
1110-
"$(code_inline kcm-fcitx5)" "$(code_inline fcitx5-config-qt)"
1111-
fi
1112-
}
1113-
1114-
11151015
#############################
11161016
# front end
11171017
#############################
@@ -1779,7 +1679,6 @@ check_istty
17791679
check_system
17801680
check_env
17811681
check_fcitx
1782-
check_config_ui
17831682

17841683
((_check_frontend)) && {
17851684
write_title 1 "$(_ 'Frontends setup:')"

0 commit comments

Comments
 (0)