Bug 103147

Summary: digikam image tools appear multiple times in menus
Product: [Applications] digikam Reporter: Dik Takken <kde>
Component: Usability-MenusAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, l.gruijters
Priority: NOR    
Version: 0.7.2   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 5.7.0
Attachments: Screenshot

Description Dik Takken 2005-04-03 16:54:23 UTC
Version:           0.7.2 (using KDE KDE 3.3.2)
Installed from:    Gentoo Packages

There are a lot of double and even quadruple appearances of menu entries in Digikam. The amount of double entries in the menu of the image editor can even change while Digikam is running.

One example screenshot is attached, but there are many more places with double entries.
Comment 1 Dik Takken 2005-04-03 16:56:17 UTC
Created attachment 10497 [details]
Screenshot

screenshot of the color adjustment of the image editor.
Comment 2 Dik Takken 2005-04-05 00:01:10 UTC
It seems that this problem only occurs when I run DigiKam in my local language (Dutch). When switching to English, the problem is gone.
Comment 3 Renchi Raju 2005-04-16 18:35:50 UTC
CVS commit by pahlibar: 



the service name is i18ned, whereas plugin name is from ascii. depending on
the locale, it may or may not match. set plugin name to be local8bit version of
service name. otherwise, the plugin will be loaded multiple times and appear 
multiple times in the menu
BUG: 103147


  M +9 -6      imagepluginloader.cpp   1.16
  M +2 -2      imagepluginloader.h   1.7


--- kdeextragear-3/digikam/utilities/imageeditor/imagepluginloader.cpp  #1.15:1.16
@@ -87,5 +87,7 @@ void ImagePluginLoader::loadPluginsFromL
               int error;
               plugin = KParts::ComponentFactory
-                       ::createInstanceFromService<Digikam::ImagePlugin>(service, this, 0, 0, &error);
+                       ::createInstanceFromService<Digikam::ImagePlugin>(service, this,
+                                                                         service->name().local8Bit(),
+                                                                         0, &error);
 
               if (plugin && (dynamic_cast<KXMLGUIClient*>(plugin) != 0))
@@ -138,5 +140,7 @@ void ImagePluginLoader::loadPluginsFromL
              {
              plugin = KParts::ComponentFactory
-                      ::createInstanceFromService<Digikam::ImagePlugin>(service, this, 0, 0);
+                       ::createInstanceFromService<Digikam::ImagePlugin>(service, this,
+                                                                         service->name().local8Bit(),
+                                                                         0);
 
              if (plugin)
@@ -163,5 +167,5 @@ void ImagePluginLoader::loadPluginsFromL
 }
 
-Digikam::ImagePlugin* ImagePluginLoader::pluginIsLoaded(QString pluginName)
+Digikam::ImagePlugin* ImagePluginLoader::pluginIsLoaded(const QString& pluginName)
 {
     if( m_pluginList.isEmpty() ) return NULL;
@@ -171,5 +175,5 @@ Digikam::ImagePlugin* ImagePluginLoader:
     for ( plugin = m_pluginList.first() ; plugin ; plugin = m_pluginList.next() )
        {
-       if( plugin->name() == pluginName )
+       if( QString::fromLocal8Bit(plugin->name()) == pluginName )
           return plugin;
        }
@@ -178,5 +182,5 @@ Digikam::ImagePlugin* ImagePluginLoader:
 }
 
-bool ImagePluginLoader::pluginLibraryIsLoaded(QString libraryName)
+bool ImagePluginLoader::pluginLibraryIsLoaded(const QString& libraryName)
 {
     KTrader::OfferList offers = KTrader::self()->query("Digikam/ImagePlugin");
@@ -186,5 +190,4 @@ bool ImagePluginLoader::pluginLibraryIsL
        {
        KService::Ptr service = *iter;
-       Digikam::ImagePlugin *plugin;
 
        if(service->library() == libraryName)

--- kdeextragear-3/digikam/utilities/imageeditor/imagepluginloader.h  #1.6:1.7
@@ -50,5 +50,5 @@ public:
     // Return true if plugin library is loaded in memory.
     // 'libraryName' is internal plugin library name not i18n.
-    bool pluginLibraryIsLoaded(QString libraryName);
+    bool pluginLibraryIsLoaded(const QString& libraryName);
 
 private:
@@ -58,5 +58,5 @@ private:
     QPtrList<Digikam::ImagePlugin>  m_pluginList;
     
-    Digikam::ImagePlugin* pluginIsLoaded(QString pluginName);
+    Digikam::ImagePlugin* pluginIsLoaded(const QString& pluginName);
 };
 
Comment 4 Renchi Raju 2005-05-10 00:56:30 UTC
reopening. apparently its not fixed
Comment 5 Renchi Raju 2005-05-10 02:22:41 UTC
SVN commit 411729 by pahlibar:

plugin->name() is the QObject name() function and we don't have
any control over it (the name is set internally by klibloader).
So we need to hold the name of the service separately. instead 
of adding a function to the imageplugin base which will break
BC, hold the names of the service in a separate list and use
it to check if the plugin has already been loaded or not. this
prevents plugins being loaded twice.
BUGS: 103147


 M  +100 -98   trunk/extragear/graphics/digikam/utilities/imageeditor/imagepluginloader.cpp  
 M  +11 -6     trunk/extragear/graphics/digikam/utilities/imageeditor/imagepluginloader.h  
Comment 6 Achim Bohnet 2005-05-12 12:01:38 UTC
*** Bug 105514 has been marked as a duplicate of this bug. ***
Comment 7 caulier.gilles 2017-07-09 13:33:10 UTC
Since digiKam 5.2.0, all image editor plugins have been removed and embed as well in image editor/showfoto implementation. There is no more run-time loading of plugin libraries.

Gilles Caulier