From: Soeren Apel Date: Wed, 8 Mar 2017 08:44:16 +0000 (+0100) Subject: Session: Don't reset session name for file devices X-Git-Tag: pulseview-0.4.0~157 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=53bb2e1de75f5cca9244efc83c4e77a222e322f4;p=pulseview.git Session: Don't reset session name for file devices --- diff --git a/pv/session.cpp b/pv/session.cpp index e5bf1f6a..0077ccfd 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -534,9 +534,15 @@ void Session::start_capture(function error_handler) for (const shared_ptr d : all_signal_data_) d->clear(); - // Revert name back to default name (e.g. "Session 1") as the data is gone - name_ = default_name_; - name_changed(); + // Revert name back to default name (e.g. "Session 1") for real devices + // as the (possibly saved) data is gone. File devices keep their name. + shared_ptr hw_device = + dynamic_pointer_cast< devices::HardwareDevice >(device_); + + if (hw_device) { + name_ = default_name_; + name_changed(); + } // Begin the session sampling_thread_ = std::thread(