[Digikam-devel] extragear/graphics/digikam/digikam
Renchi Raju
renchi at pooh.tam.uiuc.edu
Thu Jul 14 22:03:36 BST 2005
SVN commit 434623 by pahlibar:
rmb menu cleanup: remove kipi-plugins actions from context menu
and add only "Rotate" from jpeglossless plugin
CCMAIL: digikam-devel at kde.org
M +24 -38 albumiconview.cpp
--- trunk/extragear/graphics/digikam/digikam/albumiconview.cpp #434622:434623
@@ -80,6 +80,9 @@
#include <libkexif/kexifutils.h>
#include <libkexif/kexifdata.h>
+#include <libkipi/pluginloader.h>
+#include <libkipi/plugin.h>
+
extern "C"
{
#include <sys/types.h>
@@ -109,7 +112,6 @@
#include "albumiconitem.h"
#include "albumicongroupitem.h"
-#include "digikamapp.h"
#include "albumiconview.h"
class AlbumIconViewPrivate
@@ -448,47 +450,32 @@
// Merge in the KIPI plugins actions ----------------------------
- const QPtrList<KAction>& ImageActions = DigikamApp::getinstance()->menuImageActions();
-
- QPtrListIterator<KAction> it1(ImageActions);
- KAction *action;
- bool count =0;
-
- while ( (action = it1.current()) != 0 )
+ KIPI::PluginLoader* kipiPluginLoader = KIPI::PluginLoader::instance();
+ KIPI::PluginLoader::PluginList pluginList = kipiPluginLoader->pluginList();
+ for (KIPI::PluginLoader::PluginList::const_iterator it = pluginList.begin();
+ it != pluginList.end(); ++it)
{
- action->plug(&popmenu);
- ++it1;
- count = 1;
- }
+ KIPI::Plugin* plugin = (*it)->plugin();
- // Don't insert a separator if we didn't plug in any actions
+ if (plugin && (*it)->name() == "JPEGLossless")
+ {
+ kdDebug() << "Found JPEGLossless plugin" << endl;
- if (count != 0)
- popmenu.insertSeparator();
-
- KActionMenu* batchMenu = new KActionMenu(i18n("Batch Processes"));
-
- const QPtrList<KAction>& BatchActions =
- DigikamApp::getinstance()->menuBatchActions();
-
- QPtrListIterator<KAction> it2(BatchActions);
- count = 0;
-
- while ( (action = it2.current()) != 0 )
- {
- batchMenu->insert(action);
- ++it2;
- count = 1;
+ KActionPtrList actionList = plugin->actions();
+ for (KActionPtrList::const_iterator iter = actionList.begin();
+ iter != actionList.end(); ++iter)
+ {
+ KAction* action = *iter;
+ if (QString::fromLatin1(action->name())
+ == QString::fromLatin1("jpeglossless_rotate"))
+ {
+ action->plug(&popmenu);
+ }
+ }
+
+ }
}
- // Don't insert a separator if we didn't plug in any actions
-
- if (count != 0)
- {
- batchMenu->plug(&popmenu);
- popmenu.insertSeparator();
- }
-
// --------------------------------------------------------
popmenu.insertItem(SmallIcon("pencil"),
@@ -559,7 +546,6 @@
serviceVector.clear();
delete assignTagsPopup;
delete removeTagsPopup;
- delete batchMenu;
}
void AlbumIconView::slotSetAlbumThumbnail(AlbumIconItem *iconItem)
More information about the Digikam-devel
mailing list