common: Disable enum type stream operators for Qt >= 5.14
[quassel.git] / src / common / networkconfig.cpp
1 /***************************************************************************
2  *   Copyright (C) 2005-2019 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 void NetworkConfig::setPingTimeoutEnabled(bool enabled)
28 {
29     if (_pingTimeoutEnabled == enabled)
30         return;
31
32     _pingTimeoutEnabled = enabled;
33     SYNC(ARG(enabled))
34     emit pingTimeoutEnabledSet(enabled);
35 }
36
37 void NetworkConfig::setPingInterval(int interval)
38 {
39     if (_pingInterval == interval)
40         return;
41
42     _pingInterval = interval;
43     SYNC(ARG(interval))
44     emit pingIntervalSet(interval);
45 }
46
47 void NetworkConfig::setMaxPingCount(int count)
48 {
49     if (_maxPingCount == count)
50         return;
51
52     _maxPingCount = count;
53     SYNC(ARG(count))
54 }
55
56 void NetworkConfig::setAutoWhoEnabled(bool enabled)
57 {
58     if (_autoWhoEnabled == enabled)
59         return;
60
61     _autoWhoEnabled = enabled;
62     SYNC(ARG(enabled))
63     emit autoWhoEnabledSet(enabled);
64 }
65
66 void NetworkConfig::setAutoWhoInterval(int interval)
67 {
68     if (_autoWhoInterval == interval)
69         return;
70
71     _autoWhoInterval = interval;
72     SYNC(ARG(interval))
73     emit autoWhoIntervalSet(interval);
74 }
75
76 void NetworkConfig::setAutoWhoNickLimit(int nickLimit)
77 {
78     if (_autoWhoNickLimit == nickLimit)
79         return;
80
81     _autoWhoNickLimit = nickLimit;
82     SYNC(ARG(nickLimit))
83 }
84
85 void NetworkConfig::setAutoWhoDelay(int delay)
86 {
87     if (_autoWhoDelay == delay)
88         return;
89
90     _autoWhoDelay = delay;
91     SYNC(ARG(delay))
92     emit autoWhoDelaySet(delay);
93 }
94
95 void NetworkConfig::setStandardCtcp(bool enabled)
96 {
97     if (_standardCtcp == enabled)
98         return;
99
100     _standardCtcp = enabled;
101     SYNC(ARG(enabled))
102     emit standardCtcpSet(enabled);
103 }