kdereview exemption for PolicyKit-KDE

Fredrik Höglund fredrik at kde.org
Mon Nov 17 19:45:48 GMT 2008

On Monday 17 November 2008 09:02, Thiago Macieira wrote:
> Aaron J. Seigo wrote:
> >* It is two exectubles, one is 844 LOC and the other is 648 LOC. They
> >communicate with PolicyKit via D-Bus, and link against libkdeui (and
> > it's dependencies) and the PolicyKit libraries (e.g. the dbus
> > convenience lib)
> I don't see how you can write a proper event loop integration in 650 lines 
> of code. Much less the integration plus the application code.
> So, where is the event loop integration code for the convenience lib? Or, 
> another related question: why use the lib instead of QtDBus generated 
> wrappers around the D-Bus calls?

The polkit_grant library provides a set of hooks that you implement,
specifically add_io_watch(), add_child_watch() and remove_watch().

The library calls add_io_watch() during the authentication phase when
it wants you to notify it when activity occurs on a file descriptor.

add_child_watch() is called when it wants you to notify it when a
child process exits.

add_io_watch() is implemented using a QSocketNotifier, so that
doesn't require a lot of code. To implement add_child_watch(), about
200 lines of code from qprocess_unix.cpp was copied into the agent
and adapted for this purpose.


More information about the kde-core-devel mailing list