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

refactor: remove DataCommitter interface from QHotkeyApplication #1997

Merged

Conversation

shenlebantongying
Copy link
Collaborator

@shenlebantongying shenlebantongying commented Nov 26, 2024

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.

@shenlebantongying shenlebantongying changed the title refactor: remove DataComiiter interfaces from QHotkeyApplication refactor: remove DataCommitter interface from QHotkeyApplication Nov 26, 2024
@shenlebantongying shenlebantongying enabled auto-merge (squash) November 26, 2024 07:23
@shenlebantongying shenlebantongying enabled auto-merge (squash) November 26, 2024 07:32
@shenlebantongying shenlebantongying merged commit a1b3d76 into xiaoyifang:staged Nov 26, 2024
7 checks passed
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
D Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@shenlebantongying shenlebantongying deleted the clean/rm-data-comitter branch November 26, 2024 07:45
[ &m ]( QSessionManager & ) {
m.commitData();
},
Qt::DirectConnection );
Copy link
Owner

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?

Copy link
Collaborator Author

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

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