diff options
author | jan Iversen <jani@apache.org> | 2018-07-18 20:47:59 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-07-25 08:35:04 -0700 |
commit | f1648d297b174024bf772cbd6b482185532e0812 (patch) | |
tree | fd6b7bcc3346cdf0581d8ca91c8529516385517a /core/settings/qPrefPrivate.cpp | |
parent | 597aa75348f8282e9a9d6349dd06192740fccd1f (diff) | |
download | subsurface-f1648d297b174024bf772cbd6b482185532e0812.tar.gz |
core: qPref replace COPY_TXT with copy_txt in qPrefPrivate
Add copy_txt function to qPrefPrivate class
Remove macro COPY_TXT from qPrefPrivate.h
Replace use of COPY_TXT with copy_txt in qPref classes
copy_txt is only once, COPY_TXT was expanded approx. 160 times, so
this commit saves space (and removes a macro).
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/settings/qPrefPrivate.cpp')
-rw-r--r-- | core/settings/qPrefPrivate.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/settings/qPrefPrivate.cpp b/core/settings/qPrefPrivate.cpp index 53b99c4e5..32b00ee79 100644 --- a/core/settings/qPrefPrivate.cpp +++ b/core/settings/qPrefPrivate.cpp @@ -9,3 +9,10 @@ qPrefPrivate *qPrefPrivate::instance() static qPrefPrivate *self = new qPrefPrivate; return self; } + +void qPrefPrivate::copy_txt(const char **name, const QString& string) +{ + free((void *)*name); + *name = copy_qstring(string); +} + |