From 3200ce71fc061c7ba304a69d3fd9eb392a22d51e Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Sun, 9 May 2021 16:51:08 +0300 Subject: [PATCH] UI: QuotaManager: Save only changed settings. --- src/ui/stat/quotamanager.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ui/stat/quotamanager.cpp b/src/ui/stat/quotamanager.cpp index c0a033e4..1c0aaedf 100644 --- a/src/ui/stat/quotamanager.cpp +++ b/src/ui/stat/quotamanager.cpp @@ -131,8 +131,10 @@ void QuotaManager::setQuotaDayAlerted(qint32 v) { m_quotaDayAlerted = v; - ini()->setQuotaDayAlerted(v); - confManager()->saveIni(); + if (ini()->quotaDayAlerted() != v) { + ini()->setQuotaDayAlerted(v); + confManager()->saveIni(); + } } qint32 QuotaManager::quotaMonthAlerted() const @@ -144,6 +146,8 @@ void QuotaManager::setQuotaMonthAlerted(qint32 v) { m_quotaMonthAlerted = v; - ini()->setQuotaMonthAlerted(v); - confManager()->saveIni(); + if (ini()->quotaMonthAlerted() != v) { + ini()->setQuotaMonthAlerted(v); + confManager()->saveIni(); + } }