diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-12-08 15:18:52 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-12-13 08:19:00 +0900 |
commit | fd463ac0de103eda93ea1f222b1d9d821032067b (patch) | |
tree | 73c1d33219daea6ec866d186f9cb90da84394dce | |
parent | 6dcde90a7d51361fe7d49dfdfadfaf8c79e95c33 (diff) | |
download | tdebase-fd463ac0de103eda93ea1f222b1d9d821032067b.tar.gz tdebase-fd463ac0de103eda93ea1f222b1d9d821032067b.zip |
kcminit: fix initialization of multiple modules provided by a single library. This resolves issue #554.
The problem was that libinput was serving multiple modules and after initializing the first one, the others would be ignored because of a check on whether the library itself had already been initialized.
The solution is rather simple and checks not only the library name but also the module factory name. This ensures each library/factory module is correctly initialized.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit d0a2cfa94f8ebf5476be9521c9997cf7f152cc95)
-rw-r--r-- | kcminit/main.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/kcminit/main.cpp b/kcminit/main.cpp index 230d4c3dd..47dc60fe6 100644 --- a/kcminit/main.cpp +++ b/kcminit/main.cpp @@ -112,16 +112,25 @@ void KCMInit::runModules( int phase ) TQString libName = TQString("kcm_%1").arg(library); + TQString factoryName = service->property("X-TDE-FactoryName", TQVariant::String).toString(); + if (!factoryName.isEmpty()) + { + factoryName = ":" + factoryName; + } + TQString libFactoryName = libName + factoryName; + // try to load the library - if (! alreadyInitialized.contains( libName.ascii() )) { + if (!alreadyInitialized.contains( libFactoryName.ascii() )) { if (!runModule(libName, service)) { libName = TQString("libkcm_%1").arg(library); - if (! alreadyInitialized.contains( libName.ascii() )) { + libFactoryName = libName + factoryName; + if (!alreadyInitialized.contains( libFactoryName.ascii() )) { runModule(libName, service); - alreadyInitialized.append( libName.ascii() ); + alreadyInitialized.append( libFactoryName.ascii() ); } - } else - alreadyInitialized.append( libName.ascii() ); + } else { + alreadyInitialized.append( libFactoryName.ascii() ); + } } } } |