UI-less kdevplatform

Manuel Breugelmans mbr.nxi at gmail.com
Fri Aug 8 07:55:18 UTC 2008


On Thursday 07 August 2008 19:16:44 Andreas Pakulat wrote:
> On 07.08.08 18:58:04, Alexander Dymo wrote:
> > On Thursday 07 August 2008 18:23:46 Aleix wrote:
> > > But anyway my idea was to leverage the more possible the shell when
> > > working without UI.
> > >
> > > > I think the easiest way would be to just run the application without
> > > > showing
> > > > the mainwindow.
> > >
> > > Shouldn't this be the last chance?
> >
> > Maybe not. Let me elaborate. UiController doesn't give any guarantees for
> > plugins (and shell) that the mainwindow exists.
> > For example, IUiController::activeMainWindow() can return 0 and that's
> > documented.
> > So what we need to do is to keep using UiController that we have and
> > simply do not create mainwindow. I haven't looked deep enough into the
> > code to understand what can break but ideally nothing should break under
> > this situation. So maybe your flag needs to be used in
> > UiControllerPrivate constructor to avoid creating default main window?
> >
> > Other than that, UiController itself is quite cheap (it just initializes
> > area and mainwindow). Area is cheap as well, so if we don't create
> > mainwindow, we'll have fast enough cmdline shell.
>
> There's also the problem of dialogs, there are quite some plugins which
> use dialogs. IMHO we should extend this, if we really go for a non-ui
> mode, and provide a new property on plugins that says "I'm not using ui"
> or "I'm using ui" and then if the shell is created without ui the
> plugin-controller can make sure no ui-plugin is loaded.
>
> So language plugins and eventually also project builders would fall into
> the no-ui-category and could be used, while everything else wouldn't.
>
> Andreas

Uhm that's kind of the same thing as the original suggestion. You are adding 
edge case stuff to the 99.9% case (which is bad).

If you really want a special shell the obvious route is to implement it, 
without touching the general one. Try to reuse as much as possible with 
#include "../shell/xcontroller.h" and implement the special ones, ie a 
pluginController and uiController. In this new plugin controller _you_ specify 
which ui-less plugins should be loaded, not the other way around. This 
requires all code to adhere strictly to the interfaces though ...

Am I missing something here?


Manuel




More information about the KDevelop-devel mailing list