diff plugin/PluginScan.cpp @ 1249:d45a16c232bd piper

Align Sonic Annotator with the new Piper-ified subrepos (bearing in mind we want neither Piper nor the plugin load checker in Sonic Annotator itself)
author Chris Cannam
date Fri, 04 Nov 2016 14:16:01 +0000
parents 8f076d02569a
children a99641535e02
line wrap: on
line diff
--- a/plugin/PluginScan.cpp	Thu Nov 03 15:38:17 2016 +0000
+++ b/plugin/PluginScan.cpp	Fri Nov 04 14:16:01 2016 +0000
@@ -18,14 +18,21 @@
 #include "base/Preferences.h"
 #include "base/HelperExecPath.h"
 
+#ifdef HAVE_PLUGIN_CHECKER_HELPER
 #include "checker/knownplugins.h"
+#else
+class KnownPlugins {};
+#endif
 
 #include <QMutex>
 #include <QCoreApplication>
 
 using std::string;
 
-class PluginScan::Logger : public PluginCandidates::LogCallback
+class PluginScan::Logger
+#ifdef HAVE_PLUGIN_CHECKER_HELPER
+    : public PluginCandidates::LogCallback
+#endif
 {
 protected:
     void log(std::string message) {
@@ -55,6 +62,8 @@
 void
 PluginScan::scan()
 {
+#ifdef HAVE_PLUGIN_CHECKER_HELPER
+
     QMutexLocker locker(&m_mutex);
 
     bool inProcess = Preferences::getInstance()->getRunPluginsInProcess();
@@ -96,6 +105,8 @@
                  << " (with helper path = " << p.executable << ")" << endl;
         }
     }
+
+#endif
 }
 
 bool
@@ -118,6 +129,8 @@
 QList<PluginScan::Candidate>
 PluginScan::getCandidateLibrariesFor(PluginType type) const
 {
+#ifdef HAVE_PLUGIN_CHECKER_HELPER
+    
     QMutexLocker locker(&m_mutex);
 
     KnownPlugins::PluginType kpt;
@@ -157,11 +170,17 @@
     }
 
     return candidates;
+    
+#else
+    return {};
+#endif
 }
 
 QString
 PluginScan::getStartupFailureReport() const
 {
+#ifdef HAVE_PLUGIN_CHECKER_HELPER
+    
     QMutexLocker locker(&m_mutex);
 
     if (!m_succeeded) {
@@ -191,5 +210,9 @@
         + QObject::tr("<p>These plugins may be incompatible with the system, "
                       "and will be ignored during this run of %1.</p>")
         .arg(QCoreApplication::applicationName());
+
+#else
+    return "";
+#endif
 }