KWallet problem for daemon process

David Faure faure at kde.org
Sun Aug 19 16:54:55 BST 2007


On Saturday 18 August 2007, Jason 'vanRijn' Kasper wrote:
> On 8/17/07, David Faure <faure at kde.org> wrote:
> >
> > On Friday 17 August 2007, Jason 'vanRijn' Kasper wrote:
> > > re, all...
> > >
> > > KPilot uses a daemon process (kpilotDaemon) which remains running for
> > > synchronization to take place for our users.  It does not currently have
> > any
> > > on-screen presence (nor has it ever) other than its system tray icon,
> > which
> > > means that it does not have a top-level widget.  Our new keyring conduit
> > > needs to store a password and retrieve it from the wallet subsystem.  It
> > > looks like KWallet::Wallet was designed with the assumption that it
> > would
> > > only be accessed from processes that have a top-level QWidget and thus a
> > > window id.  In our case, currently, this is not a true assumption.
> > >
> > > How should we approach this?  It seems like the following are possible
> > > solutions:
> > >
> > > 1) The Wallet subsystem be changed to not require a top-level widget and
> > > window id.  Not sure what the ramifications of this are or if it's
> > desirable.
> > >
> > > 2) Our keyring conduit does some hackery to randomly pick a top-level
> > widget
> > > like this:  WId window = QApplication::topLevelWidgets().at(1)->winId();
> > > This seems like not the right way...  =;)
> >
> > 3) The application that talks to kpilotDaemon gives it a winId?
> >
> > (or does the daemon synchronize stuff without any user interaction?)
> 
> 
> Hi David.  The daemon does all of its synchronizing without any user
> interaction.  Like I said, there is no visible on-screen presence for
> kpilotDaemon as it is doing its thing other than the system tray icon.  =:/
> Any other ideas?

If there's no toplevel in the process then your suggestion number 2 makes no sense.
Did you expect it to find a toplevel widget from *another* process? Surely QApplication
doesn't know about those.

Or is this about getting the winId of the systray icon? That's probably the right thing
to do (but not like this :), assuming it's possible and it works. Otherwise you seem to
have no other choice than passing 0.


-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list