Changeset View
Changeset View
Standalone View
Standalone View
src/core/kexipartmanager.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 90 | { | |||
---|---|---|---|---|---|
104 | if (p) { | 104 | if (p) { | ||
105 | return p; | 105 | return p; | ||
106 | } | 106 | } | ||
107 | 107 | | |||
108 | // actual loading | 108 | // actual loading | ||
109 | KPluginFactory *factory = qobject_cast<KPluginFactory*>(info->instantiate()); | 109 | KPluginFactory *factory = qobject_cast<KPluginFactory*>(info->instantiate()); | ||
110 | if (!factory) { | 110 | if (!factory) { | ||
111 | m_result = KDbResult(ERR_CANNOT_LOAD_OBJECT, | 111 | m_result = KDbResult(ERR_CANNOT_LOAD_OBJECT, | ||
112 | xi18nc("@info", "Could not load Kexi plugin file <filename>%1</filename>.", | 112 | xi18nc("@info", "Could not load plugin file <filename>%1</filename> " | ||
113 | info->fileName())); | 113 | "for <application>%2</application>.", | ||
114 | info->fileName(), QApplication::applicationDisplayName())); | ||||
114 | QPluginLoader loader(info->fileName()); // use this to get the message | 115 | QPluginLoader loader(info->fileName()); // use this to get the message | ||
115 | (void)loader.load(); | 116 | (void)loader.load(); | ||
116 | m_result.setServerMessage(loader.errorString()); | 117 | m_result.setServerMessage(loader.errorString()); | ||
117 | info->setErrorMessage(m_result.message()); | 118 | info->setErrorMessage(m_result.message()); | ||
118 | qWarning() << m_result.message() << m_result.serverMessage(); | 119 | qWarning() << m_result.message() << m_result.serverMessage(); | ||
119 | return 0; | 120 | return 0; | ||
120 | } | 121 | } | ||
121 | p = factory->create<PartClass>(this); | 122 | p = factory->create<PartClass>(this); | ||
122 | if (!p) { | 123 | if (!p) { | ||
123 | m_result = KDbResult(ERR_CANNOT_LOAD_OBJECT, | 124 | m_result = KDbResult( | ||
124 | xi18nc("@info", | 125 | ERR_CANNOT_LOAD_OBJECT, | ||
125 | "Could not open Kexi plugin <filename>%1</filename>.").arg(info->fileName())); | 126 | xi18nc( | ||
127 | "@info", | ||||
128 | "Could not open plugin <filename>%1</filename> for <application>%2</application>.", | ||||
129 | info->fileName(), QApplication::applicationDisplayName())); | ||||
126 | qWarning() << m_result.message(); | 130 | qWarning() << m_result.message(); | ||
127 | return 0; | 131 | return 0; | ||
128 | } | 132 | } | ||
129 | p->setInfo(info); | 133 | p->setInfo(info); | ||
130 | p->setObjectName(QString("%1 plugin").arg(info->id())); | 134 | p->setObjectName(QString("%1 plugin").arg(info->id())); | ||
131 | partDict->insert(info->pluginId(), p); | 135 | partDict->insert(info->pluginId(), p); | ||
132 | return p; | 136 | return p; | ||
133 | } | 137 | } | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 218 | else { | |||
216 | d->partlist.append(info.data()); | 220 | d->partlist.append(info.data()); | ||
217 | } | 221 | } | ||
218 | d->partsByPluginId.insert(info->pluginId(), info.data()); | 222 | d->partsByPluginId.insert(info->pluginId(), info.data()); | ||
219 | info.take(); | 223 | info.take(); | ||
220 | } | 224 | } | ||
221 | qDeleteAll(offers); | 225 | qDeleteAll(offers); | ||
222 | offers.clear(); | 226 | offers.clear(); | ||
223 | if (d->partsByPluginId.isEmpty()) { | 227 | if (d->partsByPluginId.isEmpty()) { | ||
224 | m_result = KDbResult( | 228 | m_result = KDbResult(xi18nc( | ||
225 | xi18nc("@info", "<para>Could not find any Kexi plugins, e.g. for tables or forms. " | 229 | "@info", "<para>Could not find any plugins for <application>%1</application>, e.g. for " | ||
226 | "Kexi would not be functional so it will exit.</para>" | 230 | "tables or forms. " | ||
227 | "<para><note>Please check if Kexi is properly installed.</note></para>")); | 231 | "<application>%1</application> would not be functional so it will exit.</para>" | ||
232 | "<para><note>Please check if <application>%2</application> is properly " | ||||
233 | "installed.</note></para>", | ||||
234 | QApplication::applicationDisplayName())); | ||||
228 | return false; | 235 | return false; | ||
229 | } | 236 | } | ||
230 | 237 | | |||
231 | // fill the final list using computed order | 238 | // fill the final list using computed order | ||
232 | for (int i = 0; i < orderedInfos.size(); i++) { | 239 | for (int i = 0; i < orderedInfos.size(); i++) { | ||
233 | Info *info = orderedInfos[i]; | 240 | Info *info = orderedInfos[i]; | ||
234 | if (!info) { | 241 | if (!info) { | ||
235 | continue; | 242 | continue; | ||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |