X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fglobalsettings.cpp;h=088a6e27bda0701771e75c8a33c41debc89ed7f2;hp=936082909230676a8326f8f328d92dd5f028459d;hb=eaa02ef436fb9d8217a94076e1258da47d3cd8e0;hpb=bcb4c327ee9b8d2172d126429ba017884d079d4c diff --git a/pv/globalsettings.cpp b/pv/globalsettings.cpp index 93608290..088a6e27 100644 --- a/pv/globalsettings.cpp +++ b/pv/globalsettings.cpp @@ -20,6 +20,7 @@ #include "globalsettings.hpp" #include +#include #include #include @@ -40,6 +41,7 @@ const QString GlobalSettings::Key_View_DefaultDivHeight = "View_DefaultDivHeight const QString GlobalSettings::Key_View_DefaultLogicHeight = "View_DefaultLogicHeight"; const QString GlobalSettings::Key_Dec_InitialStateConfigurable = "Dec_InitialStateConfigurable"; const QString GlobalSettings::Key_Log_BufferSize = "Log_BufferSize"; +const QString GlobalSettings::Key_Log_NotifyOfStacktrace = "Log_NotifyOfStacktrace"; vector GlobalSettings::callbacks_; bool GlobalSettings::tracking_ = false; @@ -76,6 +78,10 @@ void GlobalSettings::set_defaults_where_needed() // Default to 500 lines of backlog if (!contains(Key_Log_BufferSize)) setValue(Key_Log_BufferSize, 500); + + // Notify user of existing stack trace by default + if (!contains(Key_Log_NotifyOfStacktrace)) + setValue(Key_Log_NotifyOfStacktrace, true); } void GlobalSettings::add_change_handler(GlobalSettingsInterface *cb) @@ -101,6 +107,8 @@ void GlobalSettings::setValue(const QString &key, const QVariant &value) QSettings::setValue(key, value); + qDebug().noquote() << "Setting" << key << "changed to" << value; + // Call all registered callbacks for (GlobalSettingsInterface *cb : callbacks_) cb->on_setting_changed(key, value);