diff transform/TransformFactory.cpp @ 485:9eb7ef610d7f

* Add more informative text to Find a Transform (particularly when none available)
author Chris Cannam
date Thu, 20 Nov 2008 12:09:55 +0000
parents 45ded09e4710
children c45e6c6722e0
line wrap: on
line diff
--- a/transform/TransformFactory.cpp	Wed Nov 19 21:36:33 2008 +0000
+++ b/transform/TransformFactory.cpp	Thu Nov 20 12:09:55 2008 +0000
@@ -118,6 +118,13 @@
     return m_transforms[id];
 }
 
+bool
+TransformFactory::haveInstalledTransforms()
+{
+    populateTransforms();
+    return !m_transforms.empty();
+}
+
 TransformList
 TransformFactory::getUninstalledTransformDescriptions()
 {
@@ -154,6 +161,25 @@
     return m_uninstalledTransforms[id];
 }
 
+bool
+TransformFactory::haveUninstalledTransforms(bool waitForCheckToComplete)
+{
+    if (waitForCheckToComplete) {
+        populateUninstalledTransforms();
+    } else {
+        if (!m_uninstalledTransformsMutex.tryLock()) {
+            return false;
+        }
+        if (!m_uninstalledTransformsPopulated) {
+            m_uninstalledTransformsMutex.unlock();
+            return false;
+        }
+        m_uninstalledTransformsMutex.unlock();
+    }
+
+    return !m_uninstalledTransforms.empty();
+}
+
 TransformFactory::TransformInstallStatus
 TransformFactory::getTransformInstallStatus(TransformId id)
 {