]> sigrok.org Git - pulseview.git/commitdiff
Session: Don't reset session name for file devices
authorSoeren Apel <redacted>
Wed, 8 Mar 2017 08:44:16 +0000 (09:44 +0100)
committerUwe Hermann <redacted>
Sun, 12 Mar 2017 14:42:12 +0000 (15:42 +0100)
pv/session.cpp

index e5bf1f6a3dee58a7f15e42005e7cbcaef0ace961..0077ccfd00d0d36d6de0a401d8f71347e24a4d08 100644 (file)
@@ -534,9 +534,15 @@ void Session::start_capture(function<void (const QString)> error_handler)
        for (const shared_ptr<data::SignalData> 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<devices::HardwareDevice> hw_device =
+               dynamic_pointer_cast< devices::HardwareDevice >(device_);
+
+       if (hw_device) {
+               name_ = default_name_;
+               name_changed();
+       }
 
        // Begin the session
        sampling_thread_ = std::thread(