Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert <krzmbrzl@gmail.com>2020-09-11 19:29:33 +0300
committerRobert <krzmbrzl@gmail.com>2020-09-11 19:29:33 +0300
commitaf7dac72f4063dd8d4dac71973ea51c25896089a (patch)
tree35558695aea94d48fd9e77d164d63fd8b7c76e90 /src/Net.cpp
parent40b28b03c150b453e00c6bc4f8d6957caea59c51 (diff)
FORMAT: Run clang-format 10 on all C/CXX source-files
Diffstat (limited to 'src/Net.cpp')
-rw-r--r--src/Net.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/Net.cpp b/src/Net.cpp
index 047cdbf60..cf2082eb3 100644
--- a/src/Net.cpp
+++ b/src/Net.cpp
@@ -7,10 +7,10 @@
#include "HostAddress.h"
bool Ban::isExpired() const {
- return (iDuration > 0) && static_cast<int>(iDuration - qdtStart.secsTo(QDateTime::currentDateTime().toUTC())) < 0;
+ return (iDuration > 0) && static_cast< int >(iDuration - qdtStart.secsTo(QDateTime::currentDateTime().toUTC())) < 0;
}
-bool Ban::operator <(const Ban &other) const {
+bool Ban::operator<(const Ban &other) const {
// Compare username primarily and address secondarily
const int unameDifference = qsUsername.localeAwareCompare(other.qsUsername);
if (unameDifference == 0)
@@ -19,14 +19,10 @@ bool Ban::operator <(const Ban &other) const {
return unameDifference < 0;
}
-bool Ban::operator ==(const Ban &other) const {
- return (haAddress == other.haAddress)
- && (iMask == other.iMask)
- && (qsUsername == other.qsUsername)
- && (qsHash == other.qsHash)
- && (qsReason == other.qsReason)
- && (qdtStart == other.qdtStart)
- && (iDuration == other.iDuration);
+bool Ban::operator==(const Ban &other) const {
+ return (haAddress == other.haAddress) && (iMask == other.iMask) && (qsUsername == other.qsUsername)
+ && (qsHash == other.qsHash) && (qsReason == other.qsReason) && (qdtStart == other.qdtStart)
+ && (iDuration == other.iDuration);
}
bool Ban::isValid() const {
@@ -34,16 +30,12 @@ bool Ban::isValid() const {
}
QString Ban::toString() const {
- return QString(QLatin1String("Hash: \"%1\", Host: \"%2\", Mask: \"%3\", Username: \"%4\", Reason: \"%5\", BanStart: \"%6\", BanEnd: \"%7\" %8")).arg(
- qsHash,
- haAddress.toString(),
- haAddress.isV6() ? QString::number(iMask) : QString::number(iMask-96),
- qsUsername,
- qsReason,
- qdtStart.toLocalTime().toString(QLatin1String("yyyy-MM-dd hh:mm:ss")),
- qdtStart.toLocalTime().addSecs(iDuration).toString(QLatin1String("yyyy-MM-dd hh:mm:ss")),
- iDuration == 0 ? QLatin1String("(permanent)") : QLatin1String("(temporary)")
- );
+ return QString(QLatin1String("Hash: \"%1\", Host: \"%2\", Mask: \"%3\", Username: \"%4\", Reason: \"%5\", "
+ "BanStart: \"%6\", BanEnd: \"%7\" %8"))
+ .arg(qsHash, haAddress.toString(), haAddress.isV6() ? QString::number(iMask) : QString::number(iMask - 96),
+ qsUsername, qsReason, qdtStart.toLocalTime().toString(QLatin1String("yyyy-MM-dd hh:mm:ss")),
+ qdtStart.toLocalTime().addSecs(iDuration).toString(QLatin1String("yyyy-MM-dd hh:mm:ss")),
+ iDuration == 0 ? QLatin1String("(permanent)") : QLatin1String("(temporary)"));
}
quint32 qHash(const Ban &b) {