Plugins depending on the standardoutputview with no Ui

Julian Bäume julian at svg4all.de
Wed Mar 23 12:51:51 UTC 2011


Am Mittwoch, 23. März 2011, 13:16:53 schrieb Dmitry Risenberg:
> 2011/3/23 Julian Bäume <julian at svg4all.de>:
> > Am Mittwoch, 23. März 2011, 11:51:34 schrieb Dmitry Risenberg:
> >> 2011/3/23 Andreas Pakulat <apaku at gmx.de>:
> >> > On 23.03.11 11:18:18, Julian Bäume wrote:
> >> >> Hi,
> >> >> 
> >> >> Am Mittwoch, 23. März 2011, 09:45:22 schrieb Andreas Pakulat:
> >> >> > PS: The KDevPlatform codebase has not been written with non-gui
> >> >> > apps in mind, hence you can always run into code-paths where
> >> >> > suddenly ui is needed. As the no-ui mode usually is used without
> >> >> > KApplication or at least without X11 connection, that means your
> >> >> > app will crash at that point.
> >> >> 
> >> >> What’s the use for KDevelop::Core::NoUi then?
> >> > 
> >> > To get kdevplatform loaded into an app that uses KApplication without
> >> > X11 connection (or QCoreApplication+KComponentData as the tests do).
> >> > That however is a hack and you've to be rather careful what you do
> >> > with the kdevplatform libs as not all code-paths have been tested or
> >> > examined for necessity of this flag to disable certain things. In
> >> > particular when errors occur the code may still try to show
> >> > message-boxes or what-not to the user.
> >> 
> >> Can I check this flag to avoid showing a messagebox when code is
> >> called from a no-gui test suite?
> > 
> > No, the plugins just won’t load, when they need the GUI and you set the
> > NoUi flag.
> 
> The code itself is in kdevplatform (itemrepository.cpp), it does not
> need GUI, but it shows a messagebox in case of an error, which causes
> a crash when run from unit tests, so I think that checking for NoUi
> flag will fix it, won't it?

Ahh, now I understand. A runtime check for the flag in the plugins to enable 
message boxes. IMHO and as I understand Andreas, all of this is a hack. I 
think, it would be more desireable to remove GUI-related code from the 
plugins, that don’t essentially need it. Warnings or error messages could also 
be written to stdout or something, in case no GUI is present. So error 
handling should not be done by the plugins themselves, but somewhere else. In 
"GUI-mode" the program would show a message box and in "test-mode" the test 
will fail (or even pass, if the error is expected).

bye then
julian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110323/7f601b75/attachment.sig>


More information about the KDevelop-devel mailing list