diff --git a/src/nc_settings.cc b/src/nc_settings.cc index a2cf126..d1077aa 100644 --- a/src/nc_settings.cc +++ b/src/nc_settings.cc @@ -78,6 +78,9 @@ void NCSettings::syncSettings() } settings.setValue(SL(Margin), marginStr); + auto debug = settings.value(debugKey, QVariant(false)); + settings.setValue(debugKey, debug); + settings.sync(); } @@ -150,3 +153,7 @@ void NCSettings::setMaxHMargin(QRect const& screenGeom) maxHMargin = w / 4; } +bool NCSettings::debugEnabled() +{ + return settings.value(debugKey).toBool(); +} diff --git a/src/nc_settings.h b/src/nc_settings.h index 65abb8c..b39013a 100644 --- a/src/nc_settings.h +++ b/src/nc_settings.h @@ -26,12 +26,14 @@ class NCSettings BatteryType batteryType(); QString batteryLabel(); int margin(); + bool debugEnabled(); private: QSettings settings; int maxHMargin = 200; QString enabledKey = "Enabled"; QString batteryLabelKey = "LevelTemplate"; + QString debugKey = "Debug"; void setMaxHMargin(QRect const& screenGeom); Position position(QString const& group); diff --git a/src/nickelclock.cc b/src/nickelclock.cc index d04eb43..e6981ae 100644 --- a/src/nickelclock.cc +++ b/src/nickelclock.cc @@ -322,5 +322,8 @@ extern "C" __attribute__((visibility("default"))) void _nc_set_header_clock(Read { nc->settings.syncSettings(); nc->addItemsToFooter(_this); + if (nc->settings.debugEnabled()) { + nh_dump_log(); + } ReadingView__ReaderIsDoneLoading(_this); }