subsurface/core/settings/qPrefPrivate.cpp
jan Iversen f1648d297b 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>
2018-07-25 08:35:04 -07:00

18 lines
362 B
C++

// SPDX-License-Identifier: GPL-2.0
#include "qPrefPrivate.h"
qPrefPrivate::qPrefPrivate(QObject *parent) : QObject(parent)
{
}
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);
}