Store the type of the current tab completion (user or channel) in the TabCompleter...
[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 INIT_SYNCABLE_OBJECT(NetworkConfig)
24 NetworkConfig::NetworkConfig(const QString &objectName, QObject *parent)
25 : SyncableObject(objectName, parent),
26   _pingTimeoutEnabled(true),
27   _pingInterval(30),
28   _maxPingCount(6),
29   _autoWhoEnabled(true),
30   _autoWhoInterval(90),
31   _autoWhoNickLimit(200),
32   _autoWhoDelay(5)
33 {
34
35 }
36
37 void NetworkConfig::setPingTimeoutEnabled(bool enabled) {
38   if(_pingTimeoutEnabled == enabled)
39     return;
40
41   _pingTimeoutEnabled = enabled;
42   SYNC(ARG(enabled))
43   emit pingTimeoutEnabledSet(enabled);
44 }
45
46 void NetworkConfig::setPingInterval(int interval) {
47   if(_pingInterval == interval)
48     return;
49
50   _pingInterval = interval;
51   SYNC(ARG(interval))
52   emit pingIntervalSet(interval);
53 }
54
55 void NetworkConfig::setMaxPingCount(int count) {
56   if(_maxPingCount == count)
57     return;
58
59   _maxPingCount = count;
60   SYNC(ARG(count))
61 }
62
63 void NetworkConfig::setAutoWhoEnabled(bool enabled) {
64   if(_autoWhoEnabled == enabled)
65     return;
66
67   _autoWhoEnabled = enabled;
68   SYNC(ARG(enabled))
69   emit autoWhoEnabledSet(enabled);
70 }
71
72 void NetworkConfig::setAutoWhoInterval(int interval) {
73   if(_autoWhoInterval == interval)
74     return;
75
76   _autoWhoInterval = interval;
77   SYNC(ARG(interval))
78   emit autoWhoIntervalSet(interval);
79 }
80
81 void NetworkConfig::setAutoWhoNickLimit(int nickLimit) {
82   if(_autoWhoNickLimit == nickLimit)
83     return;
84
85   _autoWhoNickLimit = nickLimit;
86   SYNC(ARG(nickLimit))
87 }
88
89 void NetworkConfig::setAutoWhoDelay(int delay) {
90   if(_autoWhoDelay == delay)
91     return;
92
93   _autoWhoDelay = delay;
94   SYNC(ARG(delay))
95   emit autoWhoDelaySet(delay);
96 }