dea582e396d945749075fed0e68a49c669fc5ce7
[quassel.git] / src / common / networkconfig.cpp
1 /***************************************************************************
2  *   Copyright (C) 2005-09 by the Quassel Project                          *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
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) version 3.                                           *
9  *                                                                         *
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.                          *
14  *                                                                         *
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  ***************************************************************************/
20
21 #include "networkconfig.h"
22
23 NetworkConfig::NetworkConfig(const QString &objectName, QObject *parent)
24 : SyncableObject(objectName, parent),
25   _pingTimeoutEnabled(true),
26   _pingInterval(30),
27   _maxPingCount(6),
28   _autoWhoEnabled(true),
29   _autoWhoInterval(90),
30   _autoWhoNickLimit(200),
31   _autoWhoDelay(5)
32 {
33
34 }
35
36 void NetworkConfig::setPingTimeoutEnabled(bool enabled) {
37   if(_pingTimeoutEnabled == enabled)
38     return;
39
40   _pingTimeoutEnabled = enabled;
41   emit pingTimeoutEnabledSet(enabled);
42 }
43
44 void NetworkConfig::setPingInterval(int interval) {
45   if(_pingInterval == interval)
46     return;
47
48   _pingInterval = interval;
49   emit pingIntervalSet(interval);
50 }
51
52 void NetworkConfig::setMaxPingCount(int count) {
53   if(_maxPingCount == count)
54     return;
55
56   _maxPingCount = count;
57   emit maxPingCountSet(count);
58 }
59
60 void NetworkConfig::setAutoWhoEnabled(bool enabled) {
61   if(_autoWhoEnabled == enabled)
62     return;
63
64   _autoWhoEnabled = enabled;
65   emit autoWhoEnabledSet(enabled);
66 }
67
68 void NetworkConfig::setAutoWhoInterval(int interval) {
69   if(_autoWhoInterval == interval)
70     return;
71
72   _autoWhoInterval = interval;
73   emit autoWhoIntervalSet(interval);
74 }
75
76 void NetworkConfig::setAutoWhoNickLimit(int nickLimit) {
77   if(_autoWhoNickLimit == nickLimit)
78     return;
79
80   _autoWhoNickLimit = nickLimit;
81   emit autoWhoNickLimitSet(nickLimit);
82 }
83
84 void NetworkConfig::setAutoWhoDelay(int delay) {
85   if(_autoWhoDelay == delay)
86     return;
87
88   _autoWhoDelay = delay;
89   emit autoWhoDelaySet(delay);
90 }