]> sigrok.org Git - pulseview.git/commitdiff
TraceTreeItemOwner: Make list_by_type return a vector instead of a set
authorJoel Holdsworth <redacted>
Fri, 16 Oct 2015 03:07:38 +0000 (21:07 -0600)
committerJoel Holdsworth <redacted>
Sun, 18 Oct 2015 21:32:28 +0000 (15:32 -0600)
pv/view/tracetreeitemowner.hpp
pv/view/view.cpp

index 4c0043f66dd9b7b51bad1e188fe7d30297e9ed59..c17769953e7dcd7eeb2005dc9ca2bc0e29e65255 100644 (file)
@@ -128,12 +128,12 @@ public:
         * Creates a list of decendant signals filtered by type.
         */
        template<class T>
-       std::set< std::shared_ptr<T> > list_by_type() {
-               std::set< std::shared_ptr<T> > items;
+       std::vector< std::shared_ptr<T> > list_by_type() {
+               std::vector< std::shared_ptr<T> > items;
                for (const auto &r : *this) {
                        std::shared_ptr<T> p = std::dynamic_pointer_cast<T>(r);
                        if (p)
-                               items.insert(p);
+                               items.push_back(p);
                }
 
                return items;
index 540b90e14cffb17021e698549b780475e689f280..c0b3e251d964c5266d500db962ac2ebbc764b188 100644 (file)
@@ -875,7 +875,9 @@ void View::signals_changed()
 
        // Make a list of traces that are being added, and a list of traces
        // that are being removed
-       const set<shared_ptr<Trace>> prev_traces = list_by_type<Trace>();
+       const vector<shared_ptr<Trace>> prev_trace_list = list_by_type<Trace>();
+       const set<shared_ptr<Trace>> prev_traces(
+               prev_trace_list.begin(), prev_trace_list.end());
 
        shared_lock<shared_mutex> lock(session_.signals_mutex());
        const unordered_set< shared_ptr<Signal> > &sigs(session_.signals());