diff transform/TransformFactory.h @ 444:14521503f196

* Start work on TransformFinder dialog
author Chris Cannam
date Tue, 23 Sep 2008 13:39:25 +0000
parents 381ec750eeee
children aa190a6a2625
line wrap: on
line diff
--- a/transform/TransformFactory.h	Mon Sep 22 15:44:03 2008 +0000
+++ b/transform/TransformFactory.h	Tue Sep 23 13:39:25 2008 +0000
@@ -46,28 +46,14 @@
     {
         TransformId transform;
         int score;
-        QStringList fragments;
+        typedef std::map<QString, QString> FragmentMap;
+        FragmentMap fragments;
 
         Match() : score(0) { }
-        Match(const Match &m) : transform(m.transform),
-                                score(m.score), fragments(m.fragments) { }
+        Match(const Match &m) :
+            transform(m.transform), score(m.score), fragments(m.fragments) { }
 
-        bool operator<(const Match &m) {
-            if (score != m.score) {
-                return score < m.score;
-            } else if (transform != m.transform) {
-                return transform < m.transform;
-            } else if (fragments.size() != m.fragments.size()) {
-                return fragments.size() < m.fragments.size();
-            } else {
-                for (int i = 0; i < fragments.size(); ++i) {
-                    if (fragments[i] != m.fragments[i]) {
-                        return fragments[i] < m.fragments[i];
-                    }
-                }
-            }
-            return false;
-        }
+        bool operator<(const Match &m) const;
     };
 
     typedef std::map<TransformId, Match> SearchResults;