Changeset View
Changeset View
Standalone View
Standalone View
src/kcmoduleloader.cpp
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 95 | } else { | |||
---|---|---|---|---|---|
96 | KPluginLoader loader(KPluginLoader::findPlugin(QLatin1String("kcms/") + mod.service()->library())); | 96 | KPluginLoader loader(KPluginLoader::findPlugin(QLatin1String("kcms/") + mod.service()->library())); | ||
97 | KPluginFactory* factory = loader.factory(); | 97 | KPluginFactory* factory = loader.factory(); | ||
98 | if (!factory) { | 98 | if (!factory) { | ||
99 | qWarning() << "Error loading plugin:" << loader.errorString(); | 99 | qWarning() << "Error loading plugin:" << loader.errorString(); | ||
100 | } else { | 100 | } else { | ||
101 | KQuickAddons::ConfigModule *cm = factory->create<KQuickAddons::ConfigModule>(nullptr, args2); | 101 | KQuickAddons::ConfigModule *cm = factory->create<KQuickAddons::ConfigModule>(nullptr, args2); | ||
102 | if (!cm) { | 102 | if (!cm) { | ||
103 | qWarning() << "Error creating object from plugin" << loader.fileName(); | 103 | qWarning() << "Error creating object from plugin" << loader.fileName(); | ||
104 | } else { | ||||
105 | if (!cm->mainUi()) { | ||||
106 | return reportError(report, i18n("Error loading QML file."), cm->errorString(), parent); | ||||
104 | } | 107 | } | ||
105 | module = new KCModuleQml(cm, parent, args2); | 108 | module = new KCModuleQml(cm, parent, args2); | ||
106 | return module; | 109 | return module; | ||
107 | } | 110 | } | ||
108 | } | 111 | } | ||
112 | } | ||||
109 | //#ifndef NDEBUG | 113 | //#ifndef NDEBUG | ||
110 | { | 114 | { | ||
111 | // get the create_ function | 115 | // get the create_ function | ||
112 | QLibrary lib(KPluginLoader::findPlugin(mod.library())); | 116 | QLibrary lib(KPluginLoader::findPlugin(mod.library())); | ||
113 | if (lib.load()) { | 117 | if (lib.load()) { | ||
114 | KCModule *(*create)(QWidget *, const char *); | 118 | KCModule *(*create)(QWidget *, const char *); | ||
115 | QByteArray factorymethod("create_"); | 119 | QByteArray factorymethod("create_"); | ||
116 | factorymethod += mod.handle().toLatin1(); | 120 | factorymethod += mod.handle().toLatin1(); | ||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |