Skip to content
This repository has been archived by the owner on Sep 1, 2019. It is now read-only.

Commit

Permalink
remove empty text fields from settings
Browse files Browse the repository at this point in the history
fixes #32
  • Loading branch information
mmozeiko committed Mar 5, 2017
1 parent 04d5426 commit 6e5ff84
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ void WriteSettings(QSettings* settings, QObject* widget)
}
if (QLineEdit* obj = qobject_cast<QLineEdit*>(widget))
{
if (!obj->text().isEmpty())
if (obj->text().isEmpty())
{
settings->remove(name);
}
else
{
settings->setValue(name, obj->text());
}
Expand Down

0 comments on commit 6e5ff84

Please sign in to comment.