From 27ca32a1e5a56e09b9cc1d94224d2831004dcf3d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jul 2019 19:32:34 +0900 Subject: Namespace: QMatrixClient -> Quotient (with back comp alias) --- lib/util.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/util.h') diff --git a/lib/util.h b/lib/util.h index d055fa46..d94c7321 100644 --- a/lib/util.h +++ b/lib/util.h @@ -63,7 +63,7 @@ static void qAsConst(const T&&) Q_DECL_EQ_DELETE; # define BROKEN_INITIALIZER_LISTS #endif -namespace QMatrixClient { +namespace Quotient { // The below enables pretty-printing of enums in logs #if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)) # define REGISTER_ENUM(EnumName) Q_ENUM(EnumName) @@ -330,4 +330,6 @@ qreal stringToHueF(const QString& string); /** Extract the serverpart from MXID */ QString serverPart(const QString& mxId); -} // namespace QMatrixClient +} // namespace Quotient +/// \deprecated Use namespace Quotient instead +namespace QMatrixClient = Quotient; \ No newline at end of file -- cgit v1.2.3 From 62674f731b0e46d8a413e26ca1c9da27fd9aae9a Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 5 Aug 2019 10:31:56 +0900 Subject: stringToHueF: pick a safer name for the variable std::string is still a thing, after all. --- lib/util.cpp | 6 +++--- lib/util.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/util.h') diff --git a/lib/util.cpp b/lib/util.cpp index be9656f8..cc18d9ab 100644 --- a/lib/util.cpp +++ b/lib/util.cpp @@ -99,10 +99,10 @@ QString Quotient::cacheLocation(const QString& dirName) return cachePath; } -qreal Quotient::stringToHueF(const QString& string) +qreal Quotient::stringToHueF(const QString& s) { - Q_ASSERT(!string.isEmpty()); - QByteArray hash = QCryptographicHash::hash(string.toUtf8(), + Q_ASSERT(!s.isEmpty()); + QByteArray hash = QCryptographicHash::hash(s.toUtf8(), QCryptographicHash::Sha1); QDataStream dataStream(qToLittleEndian(hash).left(2)); dataStream.setByteOrder(QDataStream::LittleEndian); diff --git a/lib/util.h b/lib/util.h index d94c7321..12d3f8ba 100644 --- a/lib/util.h +++ b/lib/util.h @@ -326,7 +326,7 @@ QString cacheLocation(const QString& dirName); * Naming and range are the same as QColor's hueF method: * https://doc.qt.io/qt-5/qcolor.html#integer-vs-floating-point-precision */ -qreal stringToHueF(const QString& string); +qreal stringToHueF(const QString& s); /** Extract the serverpart from MXID */ QString serverPart(const QString& mxId); -- cgit v1.2.3