tests: Convert ExpressionMatchTests into a GTest-based test case
[quassel.git] / src / common / networkconfig.cpp
1 /***************************************************************************
2  *   Copyright (C) 2005-2018 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 NetworkConfig::NetworkConfig(const QString &objectName, QObject *parent)
24     : SyncableObject(objectName, parent)
25 {
26 }
27
28
29 void NetworkConfig::setPingTimeoutEnabled(bool enabled)
30 {
31     if (_pingTimeoutEnabled == enabled)
32         return;
33
34     _pingTimeoutEnabled = enabled;
35     SYNC(ARG(enabled))
36     emit pingTimeoutEnabledSet(enabled);
37 }
38
39
40 void NetworkConfig::setPingInterval(int interval)
41 {
42     if (_pingInterval == interval)
43         return;
44
45     _pingInterval = interval;
46     SYNC(ARG(interval))
47     emit pingIntervalSet(interval);
48 }
49
50
51 void NetworkConfig::setMaxPingCount(int count)
52 {
53     if (_maxPingCount == count)
54         return;
55
56     _maxPingCount = count;
57     SYNC(ARG(count))
58 }
59
60
61 void NetworkConfig::setAutoWhoEnabled(bool enabled)
62 {
63     if (_autoWhoEnabled == enabled)
64         return;
65
66     _autoWhoEnabled = enabled;
67     SYNC(ARG(enabled))
68     emit autoWhoEnabledSet(enabled);
69 }
70
71
72 void NetworkConfig::setAutoWhoInterval(int interval)
73 {
74     if (_autoWhoInterval == interval)
75         return;
76
77     _autoWhoInterval = interval;
78     SYNC(ARG(interval))
79     emit autoWhoIntervalSet(interval);
80 }
81
82
83 void NetworkConfig::setAutoWhoNickLimit(int nickLimit)
84 {
85     if (_autoWhoNickLimit == nickLimit)
86         return;
87
88     _autoWhoNickLimit = nickLimit;
89     SYNC(ARG(nickLimit))
90 }
91
92
93 void NetworkConfig::setAutoWhoDelay(int delay)
94 {
95     if (_autoWhoDelay == delay)
96         return;
97
98     _autoWhoDelay = delay;
99     SYNC(ARG(delay))
100     emit autoWhoDelaySet(delay);
101 }
102
103
104 void NetworkConfig::setStandardCtcp(bool enabled)
105 {
106     if (_standardCtcp == enabled)
107         return;
108
109     _standardCtcp = enabled;
110     SYNC(ARG(enabled))
111     emit standardCtcpSet(enabled);
112 }