From d0a2cfa94f8ebf5476be9521c9997cf7f152cc95 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 8 Dec 2024 15:18:52 +0900 Subject: 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 --- kcminit/main.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'kcminit/main.cpp') 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() ); + } } } } -- cgit v1.2.1