summaryrefslogtreecommitdiffstats
path: root/core/prefs-macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/prefs-macros.h')
-rw-r--r--core/prefs-macros.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/prefs-macros.h b/core/prefs-macros.h
index 16a92aa24..72d5c60b2 100644
--- a/core/prefs-macros.h
+++ b/core/prefs-macros.h
@@ -2,6 +2,8 @@
#ifndef PREFSMACROS_H
#define PREFSMACROS_H
+#include "core/qthelper.h"
+
#define SB(V, B) s.setValue(V, (int)(B->isChecked() ? 1 : 0))
#define GET_UNIT(name, field, f, t) \
@@ -60,11 +62,11 @@
else \
prefs.field = defval
-#define GET_TXT(name, field) \
- v = s.value(QString(name)); \
- if (v.isValid()) \
- prefs.field = strdup(qPrintable(v.toString())); \
- else \
+#define GET_TXT(name, field) \
+ v = s.value(QString(name)); \
+ if (v.isValid()) \
+ prefs.field = copy_qstring(v.toString()); \
+ else \
prefs.field = copy_string(default_prefs.field)
#define SAVE_OR_REMOVE_SPECIAL(_setting, _default, _compare, _value) \