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:18:45 +0900 |
commit | d0a2cfa94f8ebf5476be9521c9997cf7f152cc95 (patch) | |
tree | 90500ca0cba5b9c506f184c8e44c6ca9041b169c /kcminit/main.cpp | |
parent | 1c05f36ad14d115b52151b61a06b239d0e6ef27b (diff) | |
download | tdebase-d0a2cfa94f8ebf5476be9521c9997cf7f152cc95.tar.gz tdebase-d0a2cfa94f8ebf5476be9521c9997cf7f152cc95.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>
Diffstat (limited to 'kcminit/main.cpp')
-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() ); + } } } } |