birdtray icon indicating copy to clipboard operation
birdtray copied to clipboard

Add Qt 5.15.1 compatibility

Open Abestanis opened this issue 4 years ago • 3 comments

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: https://github.com/gyunaev/birdtray/blob/9ff57bb54c8e09c0a4300d4906e1b09ccd184b8c/src/trayicon.cpp#L136-L144

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 avatar Nov 01 '20 22:11 Abestanis

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

gyunaev avatar Nov 02 '20 13:11 gyunaev

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

gyunaev avatar Nov 02 '20 13:11 gyunaev

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?

ladar avatar Jun 29 '22 03:06 ladar

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 avatar Nov 14 '22 15:11 Abestanis