LanguagePlugins and AlwaysOn
mail at milianw.de
Thu Jun 17 19:42:14 UTC 2010
On Thursday 17 June 2010 19:56:44 Andreas Pakulat wrote:
> On 17.06.10 19:10:47, Milian Wolff wrote:
> > while working on the multilang support I found out that the "AlwaysOn"
> > attribute doesn#t actually mean AlwaysOn but more "neverUnload". But
> > imagine this:
> > open index.html
> > => langController->languagesForUrl()
> > (foreground)
> > => loads XML Language Support
> > => parsejob
> > => run (background)
> > <style type="text/css">
> > => langController->languagesForMimeType("text/css")
> > => nothing found since loading plugins from the background is explicitly
> > forbidden
> > Now what to do? Can't we simply load all language plugins _always_? I.e.
> > also at start?
> Don't load it in the background then, load it in the foreground. We
> currently have no easy way of doing this, but IMHO it would make sense
> to add a KJob subclass that contains a schedule function that basically
> QueueJobEvent* m = new QueueJobEvent( this );
> QApplication::postEvent(Core::self()->runController(), m);
> And RunController than catches the event and simply does:
> m->job()->moveToThread( this->thread() );
> registerJob( m->job() );
> Unless of course you need the language plugin in the background thread,
> that would make it a bit more complicated (as in, wait for the
> plugin-loaded signal by running a local event loop).
I explicitly wanted to prevent that. What I have now is much easier since I
can just build a context of a different language without having to create a new
parse job for that, which would end up in the parse queue waiting...
mail at milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: This is a digitally signed message part.
More information about the KDevelop-devel