Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new dbus method to get current input method info #1263

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

hantengc
Copy link
Contributor

@hantengc hantengc commented Feb 8, 2025

No description provided.

@hantengc
Copy link
Contributor Author

hantengc commented Feb 8, 2025

@hantengc 老k,帮忙看看这个pr,存在一个dbus方法:CurrentInputMethod只能获取到输入法的uniqueName。
我现在想要获取到输入法更多的信息,包括icon name label 等等,就新增加了一个dbus接口CurrentInputMethodInfo。实质上就是返回了输入法entry的相关信息

@wengxt
Copy link
Member

wengxt commented Feb 8, 2025

Can you make it return the exact same thing like FullInputMethodGroupInfo does?

@hantengc
Copy link
Contributor Author

@wengxt 目前只缺少了layout,应该不需要返回layout吧?

@hantengc hantengc force-pushed the hantengc_add_new_dbus_api branch from ea53408 to ef54471 Compare February 10, 2025 06:01
@hantengc hantengc force-pushed the hantengc_add_new_dbus_api branch 2 times, most recently from c7f4ec0 to d19ae4e Compare March 17, 2025 03:15
@hantengc hantengc force-pushed the hantengc_add_new_dbus_api branch from d19ae4e to 6741ad1 Compare March 17, 2025 05:11
std::string, std::string, std::string,
std::string, bool, std::string>>
currentInputMethodInfo() {
std::vector<dbus::DBusStruct<std::string, std::string, std::string,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只可能有 0 或者 1 个结果,没必要用 vector 吧。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@hantengc hantengc force-pushed the hantengc_add_new_dbus_api branch 2 times, most recently from eea4106 to 341059b Compare March 17, 2025 06:57
std::string currentIM = instance_->currentInputMethod();
const auto *entry = instance_->inputMethodManager().entry(currentIM);
if (entry == nullptr) {
return {"", "", "", "", "", "", "", false, ""};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply {} should be enough

Also, previously I'd like it to be "sssssssbsa{sv}", while we have nothing for "a{sv}" (empty), we still want it in case we want to add anything in the future.

@hantengc hantengc force-pushed the hantengc_add_new_dbus_api branch from ae7c0cd to dadcacf Compare March 19, 2025 07:24
@wengxt wengxt merged commit 6b662aa into fcitx:master Mar 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants