1 | /*************************************************************************** |
2 | * Copyright (C) 2005-2014 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 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 | _standardCtcp(false) |
34 | { |
35 | } |
36 | |
37 | |
38 | void NetworkConfig::setPingTimeoutEnabled(bool enabled) |
39 | { |
40 | if (_pingTimeoutEnabled == enabled) |
41 | return; |
42 | |
43 | _pingTimeoutEnabled = enabled; |
44 | SYNC(ARG(enabled)) |
45 | emit pingTimeoutEnabledSet(enabled); |
46 | } |
47 | |
48 | |
49 | void NetworkConfig::setPingInterval(int interval) |
50 | { |
51 | if (_pingInterval == interval) |
52 | return; |
53 | |
54 | _pingInterval = interval; |
55 | SYNC(ARG(interval)) |
56 | emit pingIntervalSet(interval); |
57 | } |
58 | |
59 | |
60 | void NetworkConfig::setMaxPingCount(int count) |
61 | { |
62 | if (_maxPingCount == count) |
63 | return; |
64 | |
65 | _maxPingCount = count; |
66 | SYNC(ARG(count)) |
67 | } |
68 | |
69 | |
70 | void NetworkConfig::setAutoWhoEnabled(bool enabled) |
71 | { |
72 | if (_autoWhoEnabled == enabled) |
73 | return; |
74 | |
75 | _autoWhoEnabled = enabled; |
76 | SYNC(ARG(enabled)) |
77 | emit autoWhoEnabledSet(enabled); |
78 | } |
79 | |
80 | |
81 | void NetworkConfig::setAutoWhoInterval(int interval) |
82 | { |
83 | if (_autoWhoInterval == interval) |
84 | return; |
85 | |
86 | _autoWhoInterval = interval; |
87 | SYNC(ARG(interval)) |
88 | emit autoWhoIntervalSet(interval); |
89 | } |
90 | |
91 | |
92 | void NetworkConfig::setAutoWhoNickLimit(int nickLimit) |
93 | { |
94 | if (_autoWhoNickLimit == nickLimit) |
95 | return; |
96 | |
97 | _autoWhoNickLimit = nickLimit; |
98 | SYNC(ARG(nickLimit)) |
99 | } |
100 | |
101 | |
102 | void NetworkConfig::setAutoWhoDelay(int delay) |
103 | { |
104 | if (_autoWhoDelay == delay) |
105 | return; |
106 | |
107 | _autoWhoDelay = delay; |
108 | SYNC(ARG(delay)) |
109 | emit autoWhoDelaySet(delay); |
110 | } |
111 | |
112 | |
113 | void NetworkConfig::setStandardCtcp(bool enabled) |
114 | { |
115 | if (_standardCtcp == enabled) |
116 | return; |
117 | |
118 | _standardCtcp = enabled; |
119 | SYNC(ARG(enabled)) |
120 | emit standardCtcpSet(enabled); |
121 | } |
122 | |