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

Add Qt 5.15.1 compatibility #434

Closed
wants to merge 10 commits into from

Conversation

Abestanis
Copy link
Collaborator

This pull request adds support for Qt 5.15.1.
There is still a big problem that we need to discuss:

QProcess::startDetached(command) has become deprecated and might be removed in future Qt versions. We need to use QProcess::startDetached(executable, arguments[]). This prevents us from passing in the whole shell command as a whole, we are required to at least split the executable path from the arguments. This is especially problematic for the new unread counter change hook, because we allow entering the full shell command:

birdtray/src/trayicon.cpp

Lines 136 to 144 in 9ff57bb

QString cmdline = BirdtrayApp::get()->getSettings()->mProcessRunOnCountChange;
// Replace the %NEW% with the new unread count
cmdline.replace( "%NEW%", QString::number( total ) );
// Replace the %OLD% with the old unread count
cmdline.replace( "%OLD%", QString::number( mUnreadCounter ) );
if ( !QProcess::startDetached( cmdline ) )

We need to be able to differentiate between the executable and the arguments. I propose adding a custom widget like this:

The proposed new widget

A click on the configure button opens a dialog that allows to configure arguments and environment variables. I based the dialog on UI elements from the JetBrains Products, which I find very intuitive to use. This would also allow us to implement #313. We could use the same widget in the Advanced settings tab for the Thunderbird command.

@gyunaev What are your thoughts on this? I know you want to keep things as simple as possible and I think I can implement this without to much complexity. The alternative would be to just use Utils::splitCommandLine and hope the user doesn't input anything crazy.

@Abestanis Abestanis requested a review from gyunaev November 1, 2020 22:39
@gyunaev
Copy link
Owner

gyunaev commented Nov 2, 2020

No, not worth changing anything simply because it is deprecated. When/if it gets removed, then we can see. They could add another replacement.

Copy link
Owner

@gyunaev gyunaev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What benefit does it introduce?

@gyunaev
Copy link
Owner

gyunaev commented Nov 2, 2020

What I do to get rid of annoying deprecated warnings, -W-no-deprecated

@ladar
Copy link

ladar commented Jun 29, 2022

I know this is an old PR, but I'm wondering if any of the changes it introduces would fix #500 ...

@nicolamori can you try compiling this outdated PR and see if works?

@Abestanis Abestanis force-pushed the feature/qt15_compatibility branch from 7c517ed to 61190e5 Compare June 29, 2022 08:01
@Abestanis
Copy link
Collaborator Author

I'm going to close this for now, we can always revive it if we decide that we need a newer Qt combability.
Regarding the deprecated startDetached, this function is removed in Qt6 and the only alternatives are to pass the program and arguments separately. So if we ever want to have Qt6, we'll have to tackle that problem, but we'll figure it out when we get there.

@Abestanis Abestanis closed this Nov 14, 2022
@Abestanis Abestanis deleted the feature/qt15_compatibility branch November 14, 2022 15:11
@Abestanis Abestanis mentioned this pull request Nov 17, 2022
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.

3 participants