Fix calling qdbus by using qt5-current name qdbus-qt5
ClosedPublic

Authored by kossebau on Sep 19 2018, 6:26 PM.

Details

Summary

Due to Qt not providing OOTB support for parallel installation of different
base versions (like Qt4 and Qt5), Linux distributions have separated into
different approaches how to name the Qt tools like qmake and qdbus.
Many use -qt4 and -qt5 suffixes and link the normal name to a variant, e.g.
controlled by a custom tool qtchooser. Others kept the Qt4 versions to stay
with the names, and only added a suffix -qt5 to the new ones.

Test Plan

There is no longer a warning about missing qtdbus in the embedded konsole on
opening. The commands like search! & Co. work again.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Sep 19 2018, 6:26 PM
Restricted Application added a project: KDevelop. · View Herald TranscriptSep 19 2018, 6:26 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
kossebau requested review of this revision.Sep 19 2018, 6:26 PM
fvogt added a comment.Sep 19 2018, 6:29 PM

IMO it should just check for both and prefer qdbus-qt5 if available.

IMO it should just check for both and prefer qdbus-qt5 if available.

Yes, that was my starting patch, but then I got unsure about the great picture.
If going this route, any shell script wizard proposal how to change checkToolsInPath in kdevplatform_shell_environment.sh to check for both variants, without adding too much boilerplate code?
kdevelop! I had changed to if ! [ "$(which qdbus-qt5)$(which qdbus)" ]; then which should work fine, no?

fvogt added a comment.Sep 19 2018, 7:32 PM

IMO it should just check for both and prefer qdbus-qt5 if available.

Yes, that was my starting patch, but then I got unsure about the great picture.
If going this route, any shell script wizard proposal how to change checkToolsInPath in kdevplatform_shell_environment.sh to check for both variants, without adding too much boilerplate code?

What about this:

qdbus_exe=$(which qdbus-qt5 qdbus 2>/dev/null | head -n1)

if [ -z "${qdbus_exe}" ]; then checkToolsInPath qdbus-qt5; fi

$qdbus_exe $KDEV_DBUS_ID etc.
`kdevelop!` I had changed to `if ! [ "$(which qdbus-qt5)$(which qdbus)" ]; then` which should work fine, no?

Looks fine to me, but doesn't the other script check for its presence already?

IMO it should just check for both and prefer qdbus-qt5 if available.

Yes, that was my starting patch, but then I got unsure about the great picture.
If going this route, any shell script wizard proposal how to change checkToolsInPath in kdevplatform_shell_environment.sh to check for both variants, without adding too much boilerplate code?

What about this:

qdbus_exe=$(which qdbus-qt5 qdbus 2>/dev/null | head -n1)

if [ -z "${qdbus_exe}" ]; then checkToolsInPath qdbus-qt5; fi

$qdbus_exe $KDEV_DBUS_ID etc.

Thanks. Small issue I have with this that it would result in the error message only talking about qdbus-qt5, which might be a name not making sense on some platforms. Instead proposing in the updated patch to use some explicit custom code, with custom warning.

`kdevelop!` I had changed to `if ! [ "$(which qdbus-qt5)$(which qdbus)" ]; then` which should work fine, no?

Looks fine to me, but doesn't the other script check for its presence already?

Not exactly sure why this is, so left that aspect untouched for now.

kossebau updated this revision to Diff 42103.Sep 21 2018, 4:19 PM
  • use custom explicit checkToolsInPath code for qdbus variants
  • avoid error print from "which" in kdevelop!
kfunk requested changes to this revision.Oct 4 2018, 3:13 PM
kfunk added a subscriber: kfunk.
kfunk added inline comments.
kdevplatform/util/kdevplatform_shell_environment.sh
74

Maybe rename to QDBUS_EXE?

74

Shouldn't this prefer qdbus-qt5 over qdbus, too?

This revision now requires changes to proceed.Oct 4 2018, 3:13 PM
kossebau added inline comments.Oct 4 2018, 3:19 PM
kdevplatform/util/kdevplatform_shell_environment.sh
74

I used _qdbus to follow _shell, but then the naming patterns seems not consistent.
Whatever you prefer.

I preferred qdbus over qdbus-qt5, as the latter seems he exception. But no fixed opinion, there are arguments for both orders. Why the "too"?

kfunk added inline comments.Oct 4 2018, 3:25 PM
kdevplatform/util/kdevplatform_shell_environment.sh
74

I preferred qdbus over qdbus-qt5, as the latter seems he exception. But no fixed opinion, there are arguments for both orders.

Reasoning here: qdbus could resemble the Qt4-Version of qdbus in case there are multiple installs of Qt; qdbus-qt5 never is. Thus using qdbus-qt5 as first option is more fail-safe.

Why, the too

Well, kdevelop! first checks qdbus-qt5 -- but otoh order is not important there.

I used _qdbus to follow _shell, but then the naming patterns seems not consistent.

Ah, okay, that wasn't obvious from the diff: Use whatever you prefer, and what appears consistent in this file. _qdbus then, if you prefer.

kossebau edited the summary of this revision. (Show Details)Oct 4 2018, 7:59 PM
This revision was not accepted when it landed; it landed in state Needs Revision.Oct 4 2018, 8:02 PM
This revision was automatically updated to reflect the committed changes.