commit 0e25e3ee73cf4048b6d97ccc496bad5b1a1fd577 Author: Victor Dodon Date: Mon Jan 28 10:57:46 2013 +0200 Check the untranslatedGenericName service property when loading plugins BUGS: 302740 CCMAIL: dilfridge@gentoo.org CCMAIL: caulier.gilles@gmail.com diff --git a/libkipi/pluginloader.cpp b/libkipi/pluginloader.cpp index 496970b..5b27c63 100644 --- a/libkipi/pluginloader.cpp +++ b/libkipi/pluginloader.cpp @@ -15,7 +15,7 @@ * andi dot clemens at googlemail dot com * @author Copyright (C) 2009 by Aleix Pol Gonzalez * aleixpol at kde dot org - * @author Copyright (C) 2012 by Victor Dodon + * @author Copyright (C) 2012-2013 by Victor Dodon * dodonvictor at gmail dot com * * This program is free software; you can redistribute it @@ -304,19 +304,20 @@ void PluginLoader::init() { KService::Ptr service = *iter; QString name = service->name(); + QString uname = service->untranslatedGenericName(); QString library = service->library(); QStringList reqFeatures = service->property(QString::fromLatin1("X-KIPI-ReqFeatures")).toStringList(); int binVersion = service->property(QString::fromLatin1("X-KIPI-BinaryVersion")).toInt(); - if (library.isEmpty() || name.isEmpty()) + if (library.isEmpty() || uname.isEmpty()) { kWarning(51001) << "Plugin had an empty name or library file - this should not happen."; continue; } - if (d->ignoredPlugins.contains(name)) + if (d->ignoredPlugins.contains(uname)) { - kDebug(51001) << "Plugin " << name << " is in the ignore list from host application"; + kDebug(51001) << "Plugin " << name << " (generic name: " << uname << ") is in the ignore list from host application"; continue; } @@ -343,7 +344,7 @@ void PluginLoader::init() } } - bool load = group.readEntry(name, true); + bool load = group.readEntry(uname, true); if (!appHasAllReqFeatures) { diff --git a/tests/kxmlhelloworld/plugin/kipiplugin_kxmlhelloworld.desktop.cmake b/tests/kxmlhelloworld/plugin/kipiplugin_kxmlhelloworld.desktop.cmake index 386e5cd..6a072df 100644 --- a/tests/kxmlhelloworld/plugin/kipiplugin_kxmlhelloworld.desktop.cmake +++ b/tests/kxmlhelloworld/plugin/kipiplugin_kxmlhelloworld.desktop.cmake @@ -1,5 +1,6 @@ [Desktop Entry] Encoding=UTF-8 +UntranslatedGenericName=KXMLHelloWorld Name=KXMLHelloWorld Name[ca]=KXMLHelloWorld Name[da]=KXMLHelloWorld