comparison plugin/PluginScan.cpp @ 1562:830972646ccd

Handle security errors, format slightly differently for message box
author Chris Cannam
date Fri, 02 Nov 2018 14:40:44 +0000
parents d7fdc77252c6
children 232d6ddf257d
comparison
equal deleted inserted replaced
1558:73b3dd65e0b3 1562:830972646ccd
188 188
189 std::ostringstream os; 189 std::ostringstream os;
190 190
191 os << "<ul>"; 191 os << "<ul>";
192 for (auto f: failures) { 192 for (auto f: failures) {
193 os << "<li>" + f.library; 193 os << "<li><code>" + f.library + "</code>";
194 194
195 SVDEBUG << "PluginScan::formatFailureReport: tag is \"" << tag 195 SVDEBUG << "PluginScan::formatFailureReport: tag is \"" << tag
196 << "\", failure code is " << int(f.code) << ", message is \"" 196 << "\", failure code is " << int(f.code) << ", message is \""
197 << f.message << "\"" << endl; 197 << f.message << "\"" << endl;
198 198
221 break; 221 break;
222 222
223 case PluginCheckCode::FAIL_NOT_LOADABLE: 223 case PluginCheckCode::FAIL_NOT_LOADABLE:
224 userMessage = QObject::tr 224 userMessage = QObject::tr
225 ("Library cannot be loaded: %1").arg(userMessage); 225 ("Library cannot be loaded: %1").arg(userMessage);
226 break;
227
228 case PluginCheckCode::FAIL_FORBIDDEN:
229 userMessage = QObject::tr
230 ("Permission to load library was refused");
226 break; 231 break;
227 232
228 case PluginCheckCode::FAIL_DESCRIPTOR_MISSING: 233 case PluginCheckCode::FAIL_DESCRIPTOR_MISSING:
229 userMessage = QObject::tr 234 userMessage = QObject::tr
230 ("Not a valid plugin library (no descriptor found)"); 235 ("Not a valid plugin library (no descriptor found)");
296 } 301 }
297 if (report == "") { 302 if (report == "") {
298 return report; 303 return report;
299 } 304 }
300 305
301 return QObject::tr("<b>Failed to load plugins</b>" 306 return QObject::tr("<p>Failed to load one or more plugin libraries:</p>")
302 "<p>Failed to load one or more plugin libraries:</p>")
303 + report 307 + report
304 + QObject::tr("<p>These plugins may be incompatible with the system, " 308 + QObject::tr("<p>These plugins may be incompatible with the system, "
305 "and will be ignored during this run of %1.</p>") 309 "and will be ignored during this run of %1.</p>")
306 .arg(QCoreApplication::applicationName()); 310 .arg(QCoreApplication::applicationName());
307 311