mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
generic: remove KDED/KCM compatility bits
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
bd00cedf46
commit
8493b8a06e
9 changed files with 6 additions and 50 deletions
|
@ -361,25 +361,11 @@ KDEDModule *Kded::loadModule(const KService::Ptr& s, bool onDemand)
|
|||
}
|
||||
}
|
||||
|
||||
KDEDModule *module = 0;
|
||||
QString libname = "kded_"+s->library();
|
||||
KPluginLoader loader(libname);
|
||||
|
||||
KPluginFactory *factory = loader.factory();
|
||||
if (!factory) {
|
||||
// kde3 compat
|
||||
QString factoryName = s->property("X-KDE-FactoryName", QVariant::String).toString();
|
||||
if (factoryName.isEmpty())
|
||||
factoryName = s->library();
|
||||
factoryName = "create_" + factoryName;
|
||||
if (!module) {
|
||||
kWarning() << "Could not load library" << libname << ". ["
|
||||
<< loader.errorString() << "]";
|
||||
}
|
||||
} else {
|
||||
// create the module
|
||||
module = factory->create<KDEDModule>(this);
|
||||
}
|
||||
KDEDModule *module = factory->create<KDEDModule>(this);
|
||||
if (module) {
|
||||
module->setModuleName(obj);
|
||||
m_modules.insert(obj, module);
|
||||
|
|
|
@ -98,8 +98,6 @@ Comment[x-test]=xxKDED Modulexx
|
|||
Comment[zh_CN]=KDED 模块
|
||||
Comment[zh_HK]=KDED 模組
|
||||
Comment[zh_TW]=KDED 模組
|
||||
[PropertyDef::X-KDE-FactoryName]
|
||||
Type=QString
|
||||
[PropertyDef::X-KDE-DBus-ModuleName]
|
||||
Type=QString
|
||||
[PropertyDef::X-KDE-Kded-autoload]
|
||||
|
|
|
@ -68,10 +68,8 @@ namespace KAuth {
|
|||
* \endcode
|
||||
*
|
||||
* The optional parameter "name_of_the_po_file" has to correspond with the messages target
|
||||
* that containst the strings to be translated. Instead of using the library name for
|
||||
* \p yourLibName you can also use another name which you specify in the desktop
|
||||
* file with \p X-KDE-FactoryName. This is useful to have more than one factory
|
||||
* in one lib.
|
||||
* that containst the strings to be translated. You should use the library name for
|
||||
* \p yourLibName.
|
||||
*
|
||||
* The constructor of the KCModule then looks like this:
|
||||
* \code
|
||||
|
|
|
@ -91,10 +91,6 @@ Name[x-test]=xxKDE Configuration Modulexx
|
|||
Name[zh_CN]=KDE 配置模块
|
||||
Name[zh_TW]=KDE 控制模組
|
||||
|
||||
# the name of the method (with or without the init_ prefix) returning the factory object
|
||||
[PropertyDef::X-KDE-FactoryName]
|
||||
Type=QString
|
||||
|
||||
# a list of all components this KCM belongs to
|
||||
[PropertyDef::X-KDE-ParentComponents]
|
||||
Type=QStringList
|
||||
|
|
|
@ -131,8 +131,7 @@ void KCModuleInfo::Private::loadAll()
|
|||
weight = tmp.isValid() ? tmp.toInt() : 100;
|
||||
|
||||
// factory handle
|
||||
tmp = service->property("X-KDE-FactoryName", QVariant::String);
|
||||
handle = tmp.isValid() ? tmp.toString() : lib;
|
||||
handle = lib;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -142,8 +142,7 @@ public:
|
|||
QString library() const;
|
||||
|
||||
/**
|
||||
* @return a handle (the contents of the X-KDE-FactoryName field if it exists,
|
||||
* else the same as the library name)
|
||||
* @return a handle, same as the library name
|
||||
*/
|
||||
QString handle() const;
|
||||
|
||||
|
|
|
@ -89,25 +89,6 @@ KCModule* KCModuleLoader::loadModule(const KCModuleInfo& mod, ErrorReporting rep
|
|||
if (module) {
|
||||
return module;
|
||||
}
|
||||
//#ifndef NDEBUG
|
||||
{
|
||||
// get the create_ function
|
||||
QLibrary lib(mod.library());
|
||||
if (lib.load()) {
|
||||
KCModule *(*create)(QWidget *, const char *);
|
||||
QByteArray factorymethod("create_");
|
||||
factorymethod += mod.handle().toLatin1();
|
||||
create = reinterpret_cast<KCModule *(*)(QWidget *, const char*)>(lib.resolve(factorymethod));
|
||||
if (create) {
|
||||
return create(parent, mod.handle().toLatin1());
|
||||
kFatal(1208) << "This module still uses a custom factory method (" << factorymethod << "). This is not supported anymore. Please fix the module.";
|
||||
} else {
|
||||
kWarning(1208) << "This module has no valid entry symbol at all. The reason could be that it's still using K_EXPORT_COMPONENT_FACTORY with a custom X-KDE-FactoryName which is not supported anymore";
|
||||
}
|
||||
lib.unload();
|
||||
}
|
||||
}
|
||||
//#endif // NDEBUG
|
||||
return reportError(report, error, QString(), parent);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace KCModuleLoader
|
|||
None = 0,
|
||||
/**
|
||||
* the error report is shown instead of the
|
||||
* KCModule that should have * been loaded
|
||||
* KCModule that should have been loaded
|
||||
*/
|
||||
Inline = 1,
|
||||
/**
|
||||
|
|
|
@ -59,7 +59,6 @@ namespace KSettings
|
|||
ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=myapppluginconfig
|
||||
X-KDE-FactoryName=MyAppPluginConfigFactory
|
||||
X-KDE-ParentApp=myapp
|
||||
X-KDE-ParentComponents=myapp
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue