You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(keyboard): wire custom shortcut CRUD on Wayland
Wire the control center's add/modify/delete custom shortcut flows to the
new dde-services Keybinding1 custom CRUD methods on Wayland, replacing
the previous early-return stubs. Each Wayland call is observed with a
QDBusPendingCallWatcher so failures trigger refreshShortcut()/onAdded/
onShortcutChanged instead of mutating the local model optimistically.
Fetch a custom shortcut's command via the new GetShortcutCommand D-Bus
method: requestShortcutCommand fires one async call per custom shortcut
after ListAllShortcuts/SearchShortcuts/GetShortcut/ShortcutChanged, and
onGetShortcutCommandFinished overlays the Exec field onto the already-
built JSON object and re-emits shortcutQueried. The whole ShortcutInfo
JSON is stashed on the watcher so the handler needs no field-by-field
reconstruction.
ShortcutModel::onKeyBindingChanged now handles insert-on-change for new
ids arriving via ShortcutChanged: section-bearing configs are grouped
into m_groupInfos, sectionless Custom configs get the legacy "Custom"
group, and a dead unreachable tail (invalidateSystemShortcutNamesCache
+ addCustomInfo after two returning branches) is removed.
Extract KeyboardWorker::callModifyCustomShortcut() so the Wayland
modify path (modifyCustomShortcut and setNewCustomShortcut) shares one
watcher/id/type/connect setup. setNewCustomShortcut keeps the X11
fallback calling ModifyCustomShortcut directly, since on X11 it is also
invoked from onCustomConflictCleanFinished after conflict cleanup.
将控制中心自定义快捷键的增删改流程在 Wayland 下接入新的 dde-services
Keybinding1 自定义增删改方法,替换原先的提前 return 桩。每次 Wayland 调用
均用 QDBusPendingCallWatcher 观察结果,失败时触发 refreshShortcut()/
onAdded/onShortcutChanged,而不再乐观地修改本地模型。
通过新增的 GetShortcutCommand D-Bus 方法获取自定义快捷键命令:
requestShortcutCommand 在 ListAllShortcuts/SearchShortcuts/GetShortcut/
ShortcutChanged 之后对每个自定义快捷键发起一次异步调用,
onGetShortcutCommandFinished 将 Exec 字段叠加到已构建好的 JSON 对象上并
重新发射 shortcutQueried。整个 ShortcutInfo JSON 暂存在 watcher 上,处理
函数无需逐字段重建。
ShortcutModel::onKeyBindingChanged 现支持通过 ShortcutChanged 到达的新 id
的"变更即插入":带 Section 的配置归入 m_groupInfos,无 Section 的 Custom
配置归入传统"Custom"分组,并删除了两个 return 分支之后不可达的死代码尾段。
抽取 KeyboardWorker::callModifyCustomShortcut(),让 Wayland 修改路径
(modifyCustomShortcut 与 setNewCustomShortcut)共用一份 watcher/id/type/
connect 设置。setNewCustomShortcut 保留 X11 直接调用 ModifyCustomShortcut
的兜底,因为 X11 下它也会在冲突清理完成后由 onCustomConflictCleanFinished
调用。
Log: feat(keyboard): wire custom shortcut CRUD on Wayland
Change-Id: I793aa520968c92d03bb603721f00b1c7ac252fa5
0 commit comments