Added member xxx_notify() to class Context and catch exception to stop the propagation
Pull request
Added member xxx_notify() to class Context and catch exception to stop the propagation
Issue tracker
Fixes will automatically close the related issue
Fixes #
Feature
Describe feature of pull request
Unit test
- [ ] Done
Manual test
- [ ] Done
Code Review
- Unit and manual test pass
- GitHub Action CI pass
- At least one contributor reviews and votes
- Can be merged clean without conflicts
- PR will be merged by rebase upstream base
Additional Info
1 class StopSlotException : public std::runtime_error 2 stop propagation when catch StopSlotException 3 added member in class Context . commit_notify() . update_notify() . select_notify() . abort_notify() . option_update_notify(const string&) . property_update_notify(const string&) . unhandled_key_notify(const KeyEvent&)
可能有一定幫助吧。但是我也注意到 update_notifier() 等這一系列 getter 已經把 Notifier 對象暴露給其他組件了。
PR 裏的修改只能管住 Context 類的發的通知,管不住其他代碼發的通知。有沒有辦法?
可能有一定幫助吧。但是我也注意到
update_notifier()等這一系列 getter 已經把Notifier對象暴露給其他組件了。 PR 裏的修改只能管住Context類的發的通知,管不住其他代碼發的通知。有沒有辦法?
已在 Context 加入 connect method 了, 也改了librime 中中有使用 notify 的code , 但沒有移除 notifier 外露 ,因為librime-lua script 還有在使用 notifier
我刚刚看明白这个不是防范异常的。
究竟要做什么,请讲讲。
如果要实现某个功能,我想了解这个功能的完整设计。 只见到你设计好的一套实现,我无法判断这种实现能否有效应对现实中的问题、是否最优设计。
原本只是要增加 Context notify 的接口,你提議想把 notifier 封裝起來,所以我再加上connect 接口.