Use X-KDE-PluginInfo-Name to identify plugins, not the lib/module name

This will allow plugins to share a lib/module, e.g. if accessing unpublished interfaces

REVIEW: 108823

thanks boud for review
parent 8e6d913f
......@@ -71,6 +71,7 @@ Comment[zh_CN]=色彩空间的一些扩展
Comment[zh_TW]=顏色空間的一些延伸
X-KDE-ServiceTypes=Calligra/ColorSpaceExtension
Type=Service
X-KDE-PluginInfo-Name=krita_colorspaces_extensions
X-Pigment-MinVersion=27
X-Pigment-PluginVersion=27
X-KDE-Library=krita_colorspaces_extensions
......@@ -2,6 +2,7 @@
Name=Basic Flakes
X-KDE-ServiceTypes=Calligra/Tool
Type=Service
X-KDE-PluginInfo-Name=basicflakesplugin
X-KDE-Library=basicflakesplugin
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -61,6 +61,7 @@ Encoding=UTF-8
Name=My Flake Shapes Plugin
ServiceTypes=Calligra/Shape
Type=Service
X-KDE-PluginInfo-Name=myflakeshapes
X-KDE-Library=myflakeshapesplugin
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......
......@@ -62,3 +62,5 @@ Comment[zh_CN]=Flake 滤镜效果定义
Comment[zh_TW]=Flake 過濾器效果定義
[PropertyDef::X-Flake-PluginVersion]
Type=int
[PropertyDef::X-KDE-PluginInfo-Name]
Type=QString
......@@ -83,3 +83,5 @@ Comment[zh_TW]=包含元件與工具集的外掛程式
Type=int
[PropertyDef::X-Flake-PluginVersion]
Type=int
[PropertyDef::X-KDE-PluginInfo-Name]
Type=QString
......@@ -72,3 +72,5 @@ Comment[zh_CN]=Flake 形状边框的定义
Comment[zh_TW]=Flake 元件邊框定義
[PropertyDef::X-Flake-PluginVersion]
Type=int
[PropertyDef::X-KDE-PluginInfo-Name]
Type=QString
......@@ -70,3 +70,5 @@ Comment[zh_TW]=Flake 裝置定義
Type=int
[PropertyDef::X-Flake-PluginVersion]
Type=int
[PropertyDef::X-KDE-PluginInfo-Name]
Type=QString
......@@ -78,3 +78,5 @@ Comment[zh_TW]=Flake 元件物件定義
Type=int
[PropertyDef::X-Flake-PluginVersion]
Type=int
[PropertyDef::X-KDE-PluginInfo-Name]
Type=QString
......@@ -77,3 +77,5 @@ Comment[zh_TW]=Flake 工具定義
Type=int
[PropertyDef::X-Flake-PluginVersion]
Type=int
[PropertyDef::X-KDE-PluginInfo-Name]
Type=QString
......@@ -30,6 +30,7 @@ Name[zh_CN]=页面应用程序背景工具
Name[zh_TW]=頁面應用程式背景工具
X-KDE-ServiceTypes=Calligra/Tool
Type=Service
X-KDE-PluginInfo-Name=kopabackgroundtool
X-KDE-Library=kopabackgroundtool
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -82,14 +82,18 @@ void KoPluginLoader::load(const QString & serviceType, const QString & versionSt
configChanged = true;
}
foreach(KSharedPtr<KService> service, offers) {
QString lib = service->library();
if (whiteList.contains(lib)) {
const QString pluginName = service->property(QLatin1String("X-KDE-PluginInfo-Name")).toString();
if (pluginName.isEmpty()) {
kWarning(30003) << "Loading plugin" << service->name() << "failed, has no X-KDE-PluginInfo-Name.";
continue;
}
if (whiteList.contains(pluginName)) {
plugins.append(service);
} else if (!firstStart && !knownList.contains(lib)) { // also load newly installed plugins.
} else if (!firstStart && !knownList.contains(pluginName)) { // also load newly installed plugins.
plugins.append(service);
configChanged = true;
} else {
blacklist << service->library();
blacklist << pluginName;
}
}
} else {
......@@ -117,7 +121,7 @@ void KoPluginLoader::load(const QString & serviceType, const QString & versionSt
QString error = 0;
QObject * plugin = service->createInstance<QObject>(this, QVariantList(), &error);
if (plugin) {
whiteList << service->library();
whiteList << service->property(QLatin1String("X-KDE-PluginInfo-Name")).toString();
kDebug(30003) << "Loaded plugin" << service->name();
delete plugin;
} else {
......
......@@ -68,3 +68,5 @@ Comment[zh_TW]=包含「嵌入元件」的外掛程式
Type=int
[PropertyDef::X-Flake-PluginVersion]
Type=int
[PropertyDef::X-KDE-PluginInfo-Name]
Type=QString
......@@ -35,6 +35,7 @@ Name[zh_CN]=艺术字形状
Name[zh_TW]=藝術文字元件
X-KDE-ServiceTypes=Calligra/Shape
Type=Service
X-KDE-PluginInfo-Name=artistictextshape
X-KDE-Library=artistictextshape
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -44,6 +44,7 @@ Name[zh_CN]=图表形状
Name[zh_TW]=圖表元件
X-KDE-ServiceTypes=Calligra/Shape
Type=Service
X-KDE-PluginInfo-Name=chartshape
X-KDE-Library=chartshape
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -88,6 +88,7 @@ Comment[zh_CN]=8 位灰度图像的色彩模型
Comment[zh_TW]=8-bit 灰階圖片的色彩模型
X-KDE-ServiceTypes=Calligra/ColorSpace
Type=Service
X-KDE-PluginInfo-Name=calligragrayau8plugin
X-KDE-Library=calligragrayau8plugin
X-Pigment-MinVersion=27
X-Flake-PluginVersion=27
......@@ -29,6 +29,7 @@ Name[x-test]=xxLCMS Color Management Engine for Pigmentxx
Name[zh_TW]=Pigment 的 LCMS 色彩管理引擎
X-KDE-ServiceTypes=Calligra/ColorSpace
Type=Service
X-KDE-PluginInfo-Name=kolcmsengine
X-KDE-Library=kolcmsengine
X-Pigment-MinVersion=27
X-Pigment-PluginVersion=27
......@@ -33,6 +33,7 @@ Name[x-test]=xxComment Shapexx
Name[zh_TW]=註解元件
X-KDE-ServiceTypes=Calligra/Shape
Type=Service
X-KDE-PluginInfo-Name=commentshape
X-KDE-Library=commentshape
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -39,6 +39,7 @@ Name[zh_CN]=默认 Flake 工具
Name[zh_TW]=預設 Flake 工具
X-KDE-ServiceTypes=Calligra/Tool
Type=Service
X-KDE-PluginInfo-Name=defaulttools
X-KDE-Library=defaulttools
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -30,6 +30,7 @@ Name[zh_CN]=Calligra 停靠插件
Name[zh_TW]=Calligra 嵌入外掛程式
X-KDE-ServiceTypes=Calligra/Dock
Type=Service
X-KDE-PluginInfo-Name=calligradockers
X-KDE-Library=calligradockers
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -39,6 +39,7 @@ Name[zh_CN]=公式形状
Name[zh_TW]=公式元件
X-KDE-ServiceTypes=Calligra/Flake
Type=Service
X-KDE-PluginInfo-Name=formulashape
X-KDE-Library=formulashape
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -40,6 +40,7 @@ Name[zh_CN]=音乐形状
Name[zh_TW]=音樂元件
X-KDE-ServiceTypes=Calligra/Shape
Type=Service
X-KDE-PluginInfo-Name=musicshape
X-KDE-Library=musicshape
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -38,6 +38,7 @@ Name[zh_CN]=路径形状
Name[zh_TW]=路徑元件
X-KDE-ServiceTypes=Calligra/Shape
Type=Service
X-KDE-PluginInfo-Name=pathshapes
X-KDE-Library=pathshapes
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -38,6 +38,7 @@ Name[zh_CN]=图片形状
Name[zh_TW]=圖片元件
X-KDE-ServiceTypes=Calligra/Shape
Type=Service
X-KDE-PluginInfo-Name=pictureshape
X-KDE-Library=pictureshape
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -33,6 +33,7 @@ Name[zh_CN]=插件形状
Name[zh_TW]=外掛程式元件
X-KDE-ServiceTypes=Calligra/Shape
Type=Service
X-KDE-PluginInfo-Name=pluginshape
X-KDE-Library=pluginshape
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -31,6 +31,7 @@ Name[x-test]=xxSpacenavigator Devicexx
Name[zh_TW]=Spacenavigator 裝置
X-KDE-ServiceTypes=Calligra/Device
Type=Service
X-KDE-PluginInfo-Name=spacenavigator
X-KDE-Library=spacenavigator
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -22,6 +22,7 @@ Name[uk]=Форма-шаблон
Name[x-test]=xxTemplate Shapexx
X-KDE-ServiceTypes=Calligra/Shape
Type=Service
X-KDE-PluginInfo-Name=templateshape
X-KDE-Library=templateshape
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -3,6 +3,7 @@ Name=3D Scene Shape
Name[x-test]=xx3D Scene Shapexx
X-KDE-ServiceTypes=Calligra/Shape
Type=Service
X-KDE-PluginInfo-Name=threedshape
X-KDE-Library=threedshape
X-Flake-MinVersion=27
X-Flake-PluginVersion=27
......@@ -40,6 +40,7 @@ Name[zh_CN]=自动更正插件
Name[zh_TW]=自動修正外掛程式
X-KDE-ServiceTypes=Calligra/Text-EditingPlugin
Type=Service
X-KDE-PluginInfo-Name=autocorrect
X-KoText-MinVersion=27
X-KoText-PluginVersion=27
X-KDE-Library=autocorrect
......@@ -39,6 +39,7 @@ Name[zh_CN]=更改大小写插件
Name[zh_TW]=改變大小寫外掛程式
X-KDE-ServiceTypes=Calligra/Text-EditingPlugin
Type=Service
X-KDE-PluginInfo-Name=changecase
X-KDE-Library=changecase
X-KoText-MinVersion=27
X-KoText-PluginVersion=27
......@@ -42,6 +42,7 @@ Name[zh_CN]=拼写检查插件
Name[zh_TW]=拼字檢查外掛程式
X-KDE-ServiceTypes=Calligra/Text-EditingPlugin
Type=Service
X-KDE-PluginInfo-Name=spellcheck
X-KDE-Library=spellcheck
X-KoText-MinVersion=27
X-KoText-PluginVersion=27
......@@ -117,6 +117,7 @@ Comment[xh]=Bonisa Amagama Ahlobeneyo
Comment[x-test]=xxShow Related Wordsxx
Comment[zh_CN]=显示相关单词
Comment[zh_TW]=顯示相關單字
X-KDE-PluginInfo-Name=thesaurustool
X-KoText-MinVersion=27
X-KoText-PluginVersion=27
X-KDE-ServiceTypes=Calligra/Text-EditingPlugin
......@@ -40,6 +40,7 @@ Name[wa]=Fôme di tecse
Name[x-test]=xxText Shapexx
Name[zh_CN]=文本形状
Name[zh_TW]=文字元件
X-KDE-PluginInfo-Name=textshape
X-KDE-ServiceTypes=Calligra/Flake
Type=Service
X-KDE-Library=textshape
......
......@@ -42,6 +42,7 @@ Name[wa]=Variåves di tecse
Name[x-test]=xxText Variablesxx
Name[zh_CN]=文本变量
Name[zh_TW]=文字變數
X-KDE-PluginInfo-Name=textvariables
X-KDE-ServiceTypes=Calligra/Text-InlineObject
Type=Service
X-KDE-Library=textvariables
......
......@@ -29,6 +29,7 @@ Name[wa]=Fôme di royes sitatikes
Name[x-test]=xxStatic Vector Shapexx
Name[zh_CN]=静态矢量形状
Name[zh_TW]=靜態向量元件
X-KDE-PluginInfo-Name=vectorshape
X-KDE-ServiceTypes=Calligra/Flake
Type=Service
X-KDE-Library=vectorshape
......
......@@ -32,6 +32,7 @@ Name[wa]=Fômes videyo
Name[x-test]=xxVideo Shapexx
Name[zh_CN]=视频形状
Name[zh_TW]=影像元件
X-KDE-PluginInfo-Name=videoshape
X-KDE-ServiceTypes=Calligra/Shape
Type=Service
X-KDE-Library=videoshape
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment