How a non-KDE application access Kwallet

Thiago Macieira thiago at kde.org
Mon Mar 28 12:54:29 BST 2005


Suryanarayanan Rajaram wrote:
>Thanks for the answer.
>I am pasting here the stack trace for the crash when KApplication is not
>used.
>Also please find the snippet of my code sequence below..
>So is there no way for me to access kwallet secrets without linking to
>Qt..?

There's no way to use the KWallet classes in KDE without creating a 
KApplication or a KInstance because it will crash with the backtrace 
below:

>#0  0x40a4b062 in KInstance::dirs () from /opt/kde3/lib/libkdecore.so.4

I am pretty sure this frame has this == 0x0.

>#1  0x40a4b0f2 in KGlobal::dirs () from /opt/kde3/lib/libkdecore.so.4
>#2  0x40a75fc4 in KConfigBackEnd::changeFileName () from
>/opt/kde3/lib/libkdecore.so.4
>#3  0x40a76287 in KConfigBackEnd::KConfigBackEnd () from
>/opt/kde3/lib/libkdecore.so.4
>#4  0x40a77f8b in KConfig::KConfig () from /opt/kde3/lib/libkdecore.so.4
>
>#5  0x4003cc54 in KWallet::Wallet::NetworkWallet () from
>/opt/kde3/lib/libkwalletclient.so.1
>#6  0x0804a099 in DCOPDemoWidget::setKWalletSecret (this=0x8050968) at
>mytest.cpp:51
>#7  0x0804a2a5 in main (argc=1, argv=0xbfffe894) at mytest.cpp:169
>(gdb) quit

You need at least a KInstance object in order to use the wallet and config 
classes. A KApplication is not necessary, but is sufficient.

>DCOP should still work without a KApplication, but it definitely
>requires linking to Qt.

DCOP is a protocol. You can use it without Qt. What you can't use without 
Qt is the DCOPObject class and libdcop library that comes with KDE.

I think there are other bindings to DCOP available, but I am not sure the 
state they are in.

-- 
  Thiago Macieira  -  thiago (AT) macieira (DOT) info
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

3. Ac seo woruld wearð geborod, swá se Scieppend cweað "Gewurde Unix" and 
wundor fremede and him "Unix" genemned, þæt is se rihtendgesamnung.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050328/5f17baa4/attachment.sig>


More information about the kde-core-devel mailing list