diff --git a/kded/kded.cpp b/kded/kded.cpp index 05ad4c9f..f9479040 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -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(this); - } + KDEDModule *module = factory->create(this); if (module) { module->setModuleName(obj); m_modules.insert(obj, module); diff --git a/kded/kdedmodule.desktop b/kded/kdedmodule.desktop index cfeb296c..ab25f8d0 100644 --- a/kded/kdedmodule.desktop +++ b/kded/kdedmodule.desktop @@ -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] diff --git a/kdeui/widgets/kcmodule.h b/kdeui/widgets/kcmodule.h index 552f93ca..f8ca5cdd 100644 --- a/kdeui/widgets/kcmodule.h +++ b/kdeui/widgets/kcmodule.h @@ -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 diff --git a/kio/kcmodule.desktop b/kio/kcmodule.desktop index b4b4bfc5..f8c7be1c 100644 --- a/kio/kcmodule.desktop +++ b/kio/kcmodule.desktop @@ -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 diff --git a/kutils/kcmoduleinfo.cpp b/kutils/kcmoduleinfo.cpp index a572f6d2..0b1b6423 100644 --- a/kutils/kcmoduleinfo.cpp +++ b/kutils/kcmoduleinfo.cpp @@ -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; } diff --git a/kutils/kcmoduleinfo.h b/kutils/kcmoduleinfo.h index 74271984..3db585d8 100644 --- a/kutils/kcmoduleinfo.h +++ b/kutils/kcmoduleinfo.h @@ -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; diff --git a/kutils/kcmoduleloader.cpp b/kutils/kcmoduleloader.cpp index 24166aa3..68b59a59 100644 --- a/kutils/kcmoduleloader.cpp +++ b/kutils/kcmoduleloader.cpp @@ -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(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); } diff --git a/kutils/kcmoduleloader.h b/kutils/kcmoduleloader.h index 1180ba21..a8bd5b45 100644 --- a/kutils/kcmoduleloader.h +++ b/kutils/kcmoduleloader.h @@ -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, /** diff --git a/kutils/ksettings/pluginpage.h b/kutils/ksettings/pluginpage.h index 7c9b76a1..3c3d62b0 100644 --- a/kutils/ksettings/pluginpage.h +++ b/kutils/ksettings/pluginpage.h @@ -59,7 +59,6 @@ namespace KSettings ServiceTypes=KCModule X-KDE-Library=myapppluginconfig - X-KDE-FactoryName=MyAppPluginConfigFactory X-KDE-ParentApp=myapp X-KDE-ParentComponents=myapp