[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    text-plugins (was Re: koffice)
From:       Thomas Zander <zander () kde ! org>
Date:       2010-05-29 10:19:08
Message-ID: 201005291219.09122.zander () kde ! org
[Download RAW message or body]

On Saturday 29. May 2010 07.09.41 Thorsten Zachmann wrote:
> On Friday 28 May 2010 15:54:21 Thomas Zander wrote:
> > SVN commit 1131589 by zander:
> > 
> > Fix up API issue where inline objects didn't show up in menu
> > 
> > Make it mandatory to choose an object type so its clear that only
> > factories that create a text variable will show up in the menu.
> > 
[]
> > trunk/koffice/kpresenter/plugins/variable/PresentationVariableFactory.cpp
> > #1131588:1131589 @@ -32,7 +32,7 @@
> > 
> >  #include <kdebug.h>
> >  
> >  PresentationVariableFactory::PresentationVariableFactory(QObject
> >  *parent)
> > 
> > -    : KoInlineObjectFactoryBase(parent, "PresentationVariable")
> > +    : KoInlineObjectFactoryBase(parent, "PresentationVariable", Other)
[]

> The PresentationVariable is a text variable that should show up in the
> menu. However it should only be loaded in kpresenter. Do we have a
> mechanism to archive this or how could something like that be done?


Moved discussion to koffice-devel.

Hey Thorsten,

first, the factory has no templates and will therefore never be shown in a menu  
without adding that first. You need one template per menu entry. This is the 
reason I uses the 'Other' enum value.

The way to make it kpresenter only is the same as for any other plugin in koffice 
by not installing it as a plugin with its desktop file and everything but 
instead adding the factory to the registry with some code in the startup of 
KPresenter.

So the way that it works is that any app at startup finds all text plugins using 
the .desktop files. All of them will be shown in the kword and kpresenter menus, 
and the context menu of any other text tool using application.
In other words; any plugin will always show up in all apps.

All that a plugin does on being loaded is to add its factories to the registry. 
(KoInlineObjectRegistry::instance()->add(new MyFactory(parent))).
This is something that KPresenter can do if it makes the presentation variable 
no longer be a plugin but just a couple of classes that are part of the 
KPresenterPrivate library. Then it will become a kpresenter-only thing.

-- 
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic