From 6e5ff840500f3bd8de78b318b2cec0303b991d28 Mon Sep 17 00:00:00 2001 From: Martins Mozeiko Date: Sat, 4 Mar 2017 21:22:50 -0800 Subject: [PATCH] remove empty text fields from settings fixes #32 --- src/utils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils.cpp b/src/utils.cpp index db070b3b..8d915bab 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -77,7 +77,11 @@ void WriteSettings(QSettings* settings, QObject* widget) } if (QLineEdit* obj = qobject_cast(widget)) { - if (!obj->text().isEmpty()) + if (obj->text().isEmpty()) + { + settings->remove(name); + } + else { settings->setValue(name, obj->text()); }