Mercurial > hg > svcore
comparison plugin/PluginScan.cpp @ 1181:2f628dc9a0b0 pluginscan
Check for plugin scan helper checker helper program in suitable directory, & tidy up warning messages somewhat
author | Chris Cannam |
---|---|
date | Fri, 15 Apr 2016 16:13:06 +0100 |
parents | 98664afd518b |
children | c0cec4659784 |
comparison
equal
deleted
inserted
replaced
1180:98664afd518b | 1181:2f628dc9a0b0 |
---|---|
17 #include "base/Debug.h" | 17 #include "base/Debug.h" |
18 | 18 |
19 #include "checker/knownplugins.h" | 19 #include "checker/knownplugins.h" |
20 | 20 |
21 #include <QMutex> | 21 #include <QMutex> |
22 #include <QCoreApplication> | |
22 | 23 |
23 using std::string; | 24 using std::string; |
24 | 25 |
25 class PluginScan::Logger : public PluginCandidates::LogCallback | 26 class PluginScan::Logger : public PluginCandidates::LogCallback |
26 { | 27 { |
47 delete m_kp; | 48 delete m_kp; |
48 delete m_logger; | 49 delete m_logger; |
49 } | 50 } |
50 | 51 |
51 void | 52 void |
52 PluginScan::scan() | 53 PluginScan::scan(QString helperExecutablePath) |
53 { | 54 { |
54 delete m_kp; | 55 delete m_kp; |
55 m_succeeded = false; | 56 m_succeeded = false; |
56 try { | 57 try { |
57 m_kp = new KnownPlugins("./helper", m_logger); //!!! | 58 m_kp = new KnownPlugins(helperExecutablePath.toStdString(), m_logger); |
58 m_succeeded = true; | 59 m_succeeded = true; |
59 } catch (const std::exception &e) { | 60 } catch (const std::exception &e) { |
60 cerr << "ERROR: PluginScan::scan: " << e.what() << endl; | 61 cerr << "ERROR: PluginScan::scan: " << e.what() << endl; |
61 m_kp = 0; | 62 m_kp = 0; |
62 } | 63 } |
83 QString | 84 QString |
84 PluginScan::getStartupFailureReport() const | 85 PluginScan::getStartupFailureReport() const |
85 { | 86 { |
86 if (!m_succeeded) { | 87 if (!m_succeeded) { |
87 return QObject::tr("<b>Failed to scan for plugins</b>" | 88 return QObject::tr("<b>Failed to scan for plugins</b>" |
88 "<p>Failed to scan for plugins at startup " | 89 "<p>Failed to scan for plugins at startup. Possibly " |
89 "(application installation problem?)</p>"); | 90 "the plugin checker helper program was not correctly " |
91 "installed alongside %1?</p>") | |
92 .arg(QCoreApplication::applicationName()); | |
90 } | 93 } |
91 if (!m_kp) { | 94 if (!m_kp) { |
92 return QObject::tr("<b>Did not scan for plugins</b>" | 95 return QObject::tr("<b>Did not scan for plugins</b>" |
93 "<p>Apparently no scan for plugins was attempted " | 96 "<p>Apparently no scan for plugins was attempted " |
94 "(internal error?)</p>"); | 97 "(internal error?)</p>"); |
99 return QString(report.c_str()); | 102 return QString(report.c_str()); |
100 } | 103 } |
101 | 104 |
102 return QObject::tr("<b>Failed to load plugins</b>" | 105 return QObject::tr("<b>Failed to load plugins</b>" |
103 "<p>Failed to load one or more plugin libraries:</p>") | 106 "<p>Failed to load one or more plugin libraries:</p>") |
104 + QString(report.c_str()); | 107 + QString(report.c_str()) |
108 + QObject::tr("<p>These plugins may be incompatible with the system, " | |
109 "and will be ignored during this run of %1.</p>") | |
110 .arg(QCoreApplication::applicationName()); | |
105 } | 111 } |
106 | 112 |