-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Part 2 to fix #540: don't emit tabbar signal from zimview #751
Part 2 to fix #540: don't emit tabbar signal from zimview #751
Conversation
0e5d241
to
5496ba5
Compare
5496ba5
to
863c10d
Compare
@asashnov Can you please rebase and remove the draft? |
6e455ac
to
6465f5d
Compare
@veloman-yunkan Would you be able please to review this PR, unfortunately @mgautierfr is super busy these days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The set of changes in this PR is not so easy to understand and validate when viewed as one commit. I think that this PR can - and therefore must - be split into several smaller commits (with explanations in the commit messages where appropriate).
6465f5d
to
ec4f2ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some commit titles exceed the recommended length limit and look ugly when split with an ellipsis
Looks like the commit titled '#540: don't emit TabBar::webActionEnabledChanged signal from ZimView' can be split further into two more-or-less independent changes.
ec4f2ac
to
150593b
Compare
Fixed. Thanks for pointing this out. My further commits will be better from start.
Fixed. Split changes to commits reworked. |
No need to story what can be easily get.
According to Qt QObject manual only an QObject itself should emit their signal, indicating its internal state has changed. Calling emit on others' signal is a bad practice. References: #540
When TabBar emits currentTitleChanged(), its only affects other children of MainWindow: TopWidget and SearchBar. So it makes the code more manageble if this knowledge is local to MainWindow only.
Move 'connect()' call from KiwixApp to MainWindow because MainWindow should be responsible for connecting its children between each other.
150593b
to
921615c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one question. If the answer to it is negative then this is an approval.
Partial fix #540: stop emitting TabBar::webActionEnabledChanged from ZimView
as it's bad practice according to QObject documentation.
Dismiss way-round signal passing through KiwixApp::currentTitleChanged
Now it's local to MainWindow and its siblings (TabBar, ZimViews, TopWidget).
TabBar, TopWidget, SideBar- connect signals in MainWindow constructor
after MainWindow mp_ui->setupUi() completed.