summaryrefslogtreecommitdiffhomepage
path: root/options/bundle.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-09 08:50:41 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-09 08:50:41 +0200
commitbd9cdb3a501612843b2c4c67ac962b41d3d0b128 (patch)
treeb08633af2e3e23a603927b6b5a49c34242691df6 /options/bundle.cpp
parent12930b7ecee218d494af38e67f355bdee3fe4fd9 (diff)
options/bundle: lessen logspam
Diffstat (limited to 'options/bundle.cpp')
-rw-r--r--options/bundle.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/options/bundle.cpp b/options/bundle.cpp
index 53298d5d..f1b4069e 100644
--- a/options/bundle.cpp
+++ b/options/bundle.cpp
@@ -23,7 +23,7 @@ void bundle::reload()
{
QMutexLocker l(&mtx);
saved = group(group_name);
- const bool has_changes = is_modified();
+ const bool has_changes = is_modified(false);
transient = saved;
if (has_changes)
@@ -58,12 +58,11 @@ void bundle::save_deferred(QSettings& s)
if (group_name.size() == 0)
return;
- bool modified_ = is_modified();
+ bool modified_ = false;
- if (modified_)
{
QMutexLocker l(&mtx);
- if (is_modified())
+ if (is_modified(true))
{
qDebug() << "bundle" << group_name << "changed, saving";
modified_ = true;
@@ -81,7 +80,7 @@ void bundle::save()
save_deferred(*group::ini_file());
}
-bool bundle::is_modified() const
+bool bundle::is_modified(bool logspam) const
{
QMutexLocker l(mtx);
@@ -90,7 +89,8 @@ bool bundle::is_modified() const
const QVariant other = saved.get<QVariant>(kv.first);
if (!saved.contains(kv.first) || !is_equal(kv.first, kv.second, other))
{
- qDebug() << "bundle" << group_name << "modified" << "key" << kv.first << "-" << other << "<>" << kv.second;
+ if (logspam)
+ qDebug() << "bundle" << group_name << "modified" << "key" << kv.first << "-" << other << "<>" << kv.second;
return true;
}
}
@@ -100,7 +100,8 @@ bool bundle::is_modified() const
const QVariant other = transient.get<QVariant>(kv.first);
if (!transient.contains(kv.first) || !is_equal(kv.first, kv.second, other))
{
- qDebug() << "bundle" << group_name << "modified" << "key" << kv.first << "-" << other << "<>" << kv.second;
+ if (logspam)
+ qDebug() << "bundle" << group_name << "modified" << "key" << kv.first << "-" << other << "<>" << kv.second;
return true;
}
}