X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fstoresession.cpp;h=42b13c46c24303c5fad2ad7ef6cf55ca13322a0f;hp=ee1a3a03f096cf5c55d3a0ce16ea3f3c85496669;hb=8962d7b3b640b5f07f26a4b4ebee839c4880b69d;hpb=323715c41a09a1aba08f4b716e9d93da58f0f3a8 diff --git a/pv/storesession.cpp b/pv/storesession.cpp index ee1a3a03..42b13c46 100644 --- a/pv/storesession.cpp +++ b/pv/storesession.cpp @@ -21,6 +21,8 @@ #include "storesession.hpp" +#include + #include #include #include @@ -28,6 +30,7 @@ #include #include #include +#include #include #include @@ -189,6 +192,20 @@ bool StoreSession::start() thread_ = std::thread(&StoreSession::store_proc, this, achannel_list, asegment_list, lsegment); + + // Save session setup if we're saving to srzip and the user wants it + GlobalSettings settings; + bool save_with_setup = settings.value(GlobalSettings::Key_General_SaveWithSetup).toBool(); + + if ((output_format_->name() == "srzip") && (save_with_setup)) { + QString setup_file_name = QString::fromStdString(file_name_); + setup_file_name.truncate(setup_file_name.lastIndexOf('.')); + setup_file_name.append(".pvs"); + + QSettings settings_storage(setup_file_name, QSettings::IniFormat); + session_.save_setup(settings_storage); + } + return true; }