1 /***************************************************************************
2 * Copyright (C) 2005-07 by The Quassel IRC Development Team *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
22 #include "clientsettings.h"
24 #include <QStringList>
26 ClientSettings::ClientSettings(QString g) : Settings(g) {
31 ClientSettings::~ClientSettings() {
36 QStringList ClientSettings::sessionKeys() {
37 return Client::sessionDataKeys();
40 void ClientSettings::setSessionValue(const QString &key, const QVariant &data) {
41 Client::storeSessionData(key, data);
44 QVariant ClientSettings::sessionValue(const QString &key, const QVariant &def) {
45 return Client::retrieveSessionData(key, def);
48 /***********************************************************************************************/
50 AccountSettings::AccountSettings() : ClientSettings("Accounts") {
55 QStringList AccountSettings::knownAccounts() {
56 return localChildGroups();
59 QString AccountSettings::lastAccount() {
60 return localValue("LastAccount", "").toString();
63 void AccountSettings::setLastAccount(const QString &account) {
64 setLocalValue("LastAccount", account);
67 QString AccountSettings::autoConnectAccount() {
68 return localValue("AutoConnectAccount", "").toString();
71 void AccountSettings::setAutoConnectAccount(const QString &account) {
72 setLocalValue("AutoConnectAccount", account);
75 void AccountSettings::setValue(const QString &account, const QString &key, const QVariant &data) {
76 setLocalValue(QString("%1/%2").arg(account).arg(key), data);
79 QVariant AccountSettings::value(const QString &account, const QString &key, const QVariant &def) {
80 return localValue(QString("%1/%2").arg(account).arg(key), def);
83 void AccountSettings::removeAccount(const QString &account) {
84 removeLocalKey(account);