[Interest] The willy-nilly deletion of convenience methods

Thiago Macieira thiago.macieira at intel.com
Sun Mar 21 22:23:00 CET 2021


On Sunday, 21 March 2021 12:40:02 PDT Thorsten Glaser wrote:
> You misunderstand.
> 
> I need to use the KDE Wallet API. This involves doing a Qt application
> and other fancy stuff. The CLI program needs $DISPLAY set and usable,
> because that’s where it connects to the KDE wallet. It’s still a CLI,
> intended for use in e.g. scripts.

What CLI program are we talking about here? It's not clear what you're 
referring to here, since this involves the KWallet daemon, a D-Bus API, and a 
client. The daemon, as the name indicates, has no UI. But it does actually 
connect to the X server so it can present the password prompts. So I am 
unclear if you meant that the kwalletd application is the CLI.

I assume you're trying to make a CLI client to KWallet. KWallet's D-Bus API 
has as a parameter a window ID (see below), which is meant to allow the wallet 
password prompt to become modal to one of your windows, so the user must type 
the password or dismiss the dialogue, instead of missing it and wondering why 
the window is now unresponsive.

If that's the case, pass one of your window IDs, *not* the root window ID. 
That's an abuse of the KWallet D-Bus API.

Or instead extend the API so it accepts window-less clients. For example, you 
could make passing 0 or -1 to this parameter (whichever is an invalid window 
ID) be interpreted as "no window".

$ qdbus org.kde.kwalletd5 /modules/kwalletd5 | grep -w open
method int org.kde.KWallet.open(QString wallet, qlonglong wId, QString appid)

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering





More information about the Interest mailing list