-
Notifications
You must be signed in to change notification settings - Fork 105
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
refactor: remove DataCommitter
interface from QHotkeyApplication
#1997
refactor: remove DataCommitter
interface from QHotkeyApplication
#1997
Conversation
0b36d03
to
57e3b05
Compare
1f17ece
to
f0b5d6f
Compare
DataCommitter
interface from QHotkeyApplication
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
[ &m ]( QSessionManager & ) { | ||
m.commitData(); | ||
}, | ||
Qt::DirectConnection ); |
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.
any difference between DirectConnection and default?
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.
I don't think so, app
and m
lives in the same thread, so the default would be DirectionConnection
anyway.
But, the doc have a big note there, so I didn't delete it :)
https://doc.qt.io/qt-6/qguiapplication.html#commitDataRequest
The original GD's author probably wants to invent a mechanism.
He wants objects to manage themselves, implement a "DataCommitter" and register themselves to a list, so that before exiting, they will all be saved.
However, MainWindow's commitData is the only thing that do the work for such long time.
Let's just reduce the whole thing into simply
QObject::connnect
.