config-file-variant-wrapper.cpp 1.57 KB
Newer Older
1 2
/*
 * %kadu copyright begin%
3 4
 * Copyright 2012 Wojciech Treter (juzefwt@gmail.com)
 * Copyright 2010, 2011 Rafał Malinowski (rafal.przemyslaw.malinowski@gmail.com)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 * Copyright 2012 Bartosz Brachaczek (b.brachaczek@gmail.com)
 * %kadu copyright end%
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#include <QtCore/QVariant>

24
#include "configuration/deprecated-configuration-api.h"
25
#include "kadu-application.h"
26 27 28

#include "config-file-variant-wrapper.h"

29 30
ConfigFileVariantWrapper::ConfigFileVariantWrapper(const QString &group, const QString &name) :
		Group(group), Name(name)
31 32 33 34 35 36 37 38 39
{
}

ConfigFileVariantWrapper::~ConfigFileVariantWrapper()
{
}

QVariant ConfigFileVariantWrapper::get(const QVariant &defaultValue) const
{
40
	return KaduApplication::instance()->deprecatedConfigurationApi()->readEntry(Group, Name, defaultValue.toString());
41 42 43 44
}

void ConfigFileVariantWrapper::set(const QVariant &value)
{
45
	KaduApplication::instance()->deprecatedConfigurationApi()->writeEntry(Group, Name, value.toString());
46
}