Changeset View
Changeset View
Standalone View
Standalone View
src/service/Application.cpp
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Line(s) | 177 | if (!factory) { | |||
---|---|---|---|---|---|
180 | return false; | 180 | return false; | ||
181 | } | 181 | } | ||
182 | 182 | | |||
183 | auto pluginInstance = factory->create<Plugin>(); | 183 | auto pluginInstance = factory->create<Plugin>(); | ||
184 | 184 | | |||
185 | auto &modules = Module::get(); | 185 | auto &modules = Module::get(); | ||
186 | 186 | | |||
187 | if (pluginInstance) { | 187 | if (pluginInstance) { | ||
188 | pluginInstance->init(modules); | 188 | bool success = pluginInstance->init(modules); | ||
189 | 189 | | |||
190 | if (success) { | ||||
190 | pluginIds << plugin.pluginId(); | 191 | pluginIds << plugin.pluginId(); | ||
191 | plugins << pluginInstance; | 192 | plugins << pluginInstance; | ||
192 | 193 | | |||
193 | qCDebug(KAMD_LOG_APPLICATION) << "[ OK ] loaded: " << plugin.pluginId(); | 194 | qCDebug(KAMD_LOG_APPLICATION) << "[ OK ] loaded: " << plugin.pluginId(); | ||
194 | return true; | 195 | return true; | ||
196 | } else { | ||||
197 | qCWarning(KAMD_LOG_APPLICATION) << "[ FAILED ] init: " << plugin.pluginId() << loader.errorString(); | ||||
198 | // TODO: Show a notification for a plugin that failed to load | ||||
199 | delete pluginInstance; | ||||
200 | return false; | ||||
201 | } | ||||
195 | 202 | | |||
196 | } else { | 203 | } else { | ||
197 | qCWarning(KAMD_LOG_APPLICATION) << "[ FAILED ] loading: " << plugin.pluginId() << loader.errorString(); | 204 | qCWarning(KAMD_LOG_APPLICATION) << "[ FAILED ] loading: " << plugin.pluginId() << loader.errorString(); | ||
198 | // TODO: Show a notification for a plugin that failed to load | 205 | // TODO: Show a notification for a plugin that failed to load | ||
199 | return false; | 206 | return false; | ||
200 | } | 207 | } | ||
201 | } | 208 | } | ||
202 | 209 | | |||
▲ Show 20 Lines • Show All 216 Lines • Show Last 20 Lines |