From: Soeren Apel Date: Fri, 31 Jul 2015 06:22:40 +0000 (+0200) Subject: Fix #404 by only saving enabled signals X-Git-Tag: pulseview-0.3.0~155 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=de6e819c8a6b3f61e69bbb53b5c853ee6686641e;p=pulseview.git Fix #404 by only saving enabled signals --- diff --git a/pv/storesession.cpp b/pv/storesession.cpp index e4af5db7..a3d745b3 100644 --- a/pv/storesession.cpp +++ b/pv/storesession.cpp @@ -91,12 +91,15 @@ const QString& StoreSession::error() const bool StoreSession::start() { - set< shared_ptr > data_set = - session_.get_data(); - shared_lock lock(session_.signals_mutex()); - const unordered_set< shared_ptr > &sigs( - session_.signals()); + unordered_set< shared_ptr > sigs(session_.signals()); + + // Add enabled channels to the data set + set< shared_ptr > data_set; + + for (shared_ptr signal : sigs) + if (signal->enabled()) + data_set.insert(signal->data()); // Check we have logic data if (data_set.empty() || sigs.empty()) { @@ -114,7 +117,7 @@ bool StoreSession::start() shared_ptr data; if (!(data = dynamic_pointer_cast(*data_set.begin()))) { error_ = tr("PulseView currently only has support for " - "storing a logic data."); + "storing logic data."); return false; }