[Kde-imaging] kdeextragear-libs-1

Jesper Pedersen blackie at blackie.dk
Fri May 28 20:10:42 CEST 2004


CVS commit by blackie: 

CCMAIL: kde-imaging at kde.org, dfaure at kde.org

Together with David Faure I did yesterday make the necessary changes to
allow icons local to each plugin.

The basic point of all this was that the KIPI::Plugin::actionCollection()
needed to know about the plugins KInstance - as it was till this change, it
got the KInstance for the host application, and would thus look for icons
in the host applications directory.

Making this change did, however, reveal a conflict, namely that each and
every action in the plugin must have the actionCollection as parent -
which was not the case for items in KMenuActions.

The way the host application finds actions right now is by querying the
actionCollection(), which with the above change would also reveal those
actions from menus.

I therefore needed to add another way for the host application to get
information about actions. I added a method called KIPI::Plugin::actions()
which the host application must call to get information about actions. At
the same time I made the actionCollection() method protected, so the host
application can't get to that anymore. 

To tell KIPI about actions, then plugins must now call
KIPI::Plugin::addAction() on each action they want to be in the topmost
menu (thus not actions located in KActionMenu's).

Let me summerize the changes
- Host application now need to call actions() rather than
  actionCollection() to get information about action in the plugin.
- plugins now need to give a pointer to KGenericFactory<..>::instance() in
  the constructor of the Plugin superclass.
- the plugin must call addAction() for each toplevel action.

And now to answer the question on how to get local icons.
In Makefile.am, you need a line similar to this:
kipibatchprocessimagesicondir = $(kde_datadir)/kipiplugin_batchprocessimages/icons

The name specified above (the "kipiplugin_batchprocessimages"), must be
the same as what you specify to KGenericFactory in the plugin:

typedef KGenericFactory<Plugin_BatchProcessImages> Factory;
K_EXPORT_COMPONENT_FACTORY( kipiplugin_batchprocessimages,
                            Factory("kipiplugin_batchprocessimages"));

Cheers
Jesper


  M +6 -6      kipi-plugins/acquireimages/plugin_acquireimages.cpp   1.7
  M +1 -1      kipi-plugins/batchprocessimages/Makefile.am   1.4
  M +13 -12    kipi-plugins/batchprocessimages/plugin_batchprocessimages.cpp   1.5
  M +9 -10     kipi-plugins/calendar/plugin_calendar.cpp   1.6
  M +4 -5      kipi-plugins/cdarchiving/plugin_cdarchiving.cpp   1.5
  M +6 -5      kipi-plugins/commentseditor/plugin_commentseditor.cpp   1.8
  M +6 -6      kipi-plugins/diroperations/plugin_diroperations.cpp   1.4
  M +10 -10    kipi-plugins/findimages/plugin_findimages.cpp   1.4
  M +8 -19     kipi-plugins/helloworld/plugin_helloworld.cpp   1.8
  M +11 -11    kipi-plugins/imagesgallery/plugin_imagesgallery.cpp   1.5
  M +12 -12    kipi-plugins/jpeglossless/plugin_jpeglossless.cpp   1.4
  M +11 -12    kipi-plugins/mpegencoder/plugin_mpegencoder.cpp   1.8
  M +4 -8      kipi-plugins/printwizard/plugin_printwizard.cpp   1.8
  M +6 -6      kipi-plugins/rawconverter/plugin_rawconverter.cpp   1.6
  M +4 -4      kipi-plugins/sendimages/plugin_sendimages.cpp   1.5
  M +1 -2      kipi-plugins/slideshow/plugin_slideshow.cpp   1.5
  M +11 -11    kipi-plugins/timeadjust/plugin_timeadjust.cpp   1.3
  M +11 -12    kipi-plugins/wallpaper/plugin_wallpaper.cpp   1.3
  M +8 -0      libkipi/libkipi/interface.cpp   1.13
  M +16 -6     libkipi/libkipi/plugin.cpp   1.3
  M +11 -5     libkipi/libkipi/plugin.h   1.6





More information about the Kde-imaging mailing list