changeset 473:47b41ec34407

* Avoid waiting on uninstalled transforms mutex in TransformFactory:: getTransformInstallStatus -- we can return TransformUnknown * Don't follow link in SelectableLabel when clicking to select it * Restore lost version number in plugin param dialog
author Chris Cannam
date Tue, 28 Oct 2008 18:06:06 +0000
parents 5015e80cc919
children 6d45f77e63ee
files plugin/DSSIPluginInstance.cpp plugin/LADSPAPluginInstance.cpp transform/TransformFactory.cpp
diffstat 3 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugin/DSSIPluginInstance.cpp	Tue Oct 28 12:39:53 2008 +0000
+++ b/plugin/DSSIPluginInstance.cpp	Tue Oct 28 18:06:06 2008 +0000
@@ -126,7 +126,7 @@
 int
 DSSIPluginInstance::getPluginVersion() const
 {
-    return 1;
+    return -1;
 }
 
 std::string
--- a/plugin/LADSPAPluginInstance.cpp	Tue Oct 28 12:39:53 2008 +0000
+++ b/plugin/LADSPAPluginInstance.cpp	Tue Oct 28 18:06:06 2008 +0000
@@ -109,7 +109,7 @@
 int
 LADSPAPluginInstance::getPluginVersion() const
 {
-    return 1;
+    return -1;
 }
 
 std::string
--- a/transform/TransformFactory.cpp	Tue Oct 28 12:39:53 2008 +0000
+++ b/transform/TransformFactory.cpp	Tue Oct 28 18:06:06 2008 +0000
@@ -134,14 +134,29 @@
 TransformFactory::getTransformInstallStatus(TransformId id)
 {
     populateTransforms();
-    populateUninstalledTransforms();
 
     if (m_transforms.find(id) != m_transforms.end()) {
         return TransformInstalled;
     }
+    
+    if (!m_uninstalledTransformsMutex.tryLock()) {
+        // uninstalled transforms are being populated; this may take some time,
+        // and they aren't critical
+        return TransformUnknown;
+    }
+
+    if (!m_uninstalledTransformsPopulated) {
+        m_uninstalledTransformsMutex.unlock();
+        populateUninstalledTransforms();
+        m_uninstalledTransformsMutex.lock();
+    }
+
     if (m_uninstalledTransforms.find(id) != m_uninstalledTransforms.end()) {
         return TransformNotInstalled;
     }
+
+    m_uninstalledTransformsMutex.unlock();
+
     return TransformUnknown;
 }