changeset 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 a1f410f895d3
files plugin/PluginScan.cpp plugin/PluginScan.h
diffstat 2 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugin/PluginScan.cpp	Thu Apr 14 16:52:55 2016 +0100
+++ b/plugin/PluginScan.cpp	Fri Apr 15 16:13:06 2016 +0100
@@ -19,6 +19,7 @@
 #include "checker/knownplugins.h"
 
 #include <QMutex>
+#include <QCoreApplication>
 
 using std::string;
 
@@ -49,12 +50,12 @@
 }
 
 void
-PluginScan::scan()
+PluginScan::scan(QString helperExecutablePath)
 {
     delete m_kp;
     m_succeeded = false;
     try {
-	m_kp = new KnownPlugins("./helper", m_logger); //!!!
+	m_kp = new KnownPlugins(helperExecutablePath.toStdString(), m_logger);
 	m_succeeded = true;
     } catch (const std::exception &e) {
 	cerr << "ERROR: PluginScan::scan: " << e.what() << endl;
@@ -85,8 +86,10 @@
 {
     if (!m_succeeded) {
 	return QObject::tr("<b>Failed to scan for plugins</b>"
-			   "<p>Failed to scan for plugins at startup "
-			   "(application installation problem?)</p>");
+			   "<p>Failed to scan for plugins at startup. Possibly "
+                           "the plugin checker helper program was not correctly "
+                           "installed alongside %1?</p>")
+            .arg(QCoreApplication::applicationName());
     }
     if (!m_kp) {
 	return QObject::tr("<b>Did not scan for plugins</b>"
@@ -101,6 +104,9 @@
 
     return QObject::tr("<b>Failed to load plugins</b>"
 		       "<p>Failed to load one or more plugin libraries:</p>")
-	+ QString(report.c_str());
+	+ QString(report.c_str())
+        + QObject::tr("<p>These plugins may be incompatible with the system, "
+                      "and will be ignored during this run of %1.</p>")
+        .arg(QCoreApplication::applicationName());
 }
 
--- a/plugin/PluginScan.h	Thu Apr 14 16:52:55 2016 +0100
+++ b/plugin/PluginScan.h	Fri Apr 15 16:13:06 2016 +0100
@@ -24,7 +24,7 @@
 public:
     static PluginScan *getInstance();
 
-    void scan();
+    void scan(QString helperExecutablePath);
 
     bool scanSucceeded() const;