aboutsummaryrefslogtreecommitdiff
path: root/lib/util.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-07-07 19:32:34 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-09 10:18:37 +0900
commit27ca32a1e5a56e09b9cc1d94224d2831004dcf3d (patch)
treef2e8d19705a13e39bd9484d13098f323c8d30194 /lib/util.cpp
parent7a5b359b8823646ce97cbaf05c251cb04c291466 (diff)
downloadlibquotient-27ca32a1e5a56e09b9cc1d94224d2831004dcf3d.tar.gz
libquotient-27ca32a1e5a56e09b9cc1d94224d2831004dcf3d.zip
Namespace: QMatrixClient -> Quotient (with back comp alias)
Diffstat (limited to 'lib/util.cpp')
-rw-r--r--lib/util.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/util.cpp b/lib/util.cpp
index 1919e811..be9656f8 100644
--- a/lib/util.cpp
+++ b/lib/util.cpp
@@ -32,7 +32,7 @@ static const auto RegExpOptions =
| QRegularExpression::UseUnicodePropertiesOption;
// Converts all that looks like a URL into HTML links
-void QMatrixClient::linkifyUrls(QString& htmlEscapedText)
+void Quotient::linkifyUrls(QString& htmlEscapedText)
{
// Note: outer parentheses are a part of C++ raw string delimiters, not of
// the regex (see http://en.cppreference.com/w/cpp/language/string_literal).
@@ -70,7 +70,7 @@ void QMatrixClient::linkifyUrls(QString& htmlEscapedText)
QStringLiteral(R"(\1<a href="https://matrix.to/#/\2">\2</a>)"));
}
-QString QMatrixClient::sanitized(const QString& plainText)
+QString Quotient::sanitized(const QString& plainText)
{
auto text = plainText;
text.remove(QChar(0x202e)); // RLO
@@ -79,7 +79,7 @@ QString QMatrixClient::sanitized(const QString& plainText)
return text;
}
-QString QMatrixClient::prettyPrint(const QString& plainText)
+QString Quotient::prettyPrint(const QString& plainText)
{
auto pt = plainText.toHtmlEscaped();
linkifyUrls(pt);
@@ -88,7 +88,7 @@ QString QMatrixClient::prettyPrint(const QString& plainText)
+ QStringLiteral("</span>");
}
-QString QMatrixClient::cacheLocation(const QString& dirName)
+QString Quotient::cacheLocation(const QString& dirName)
{
const QString cachePath =
QStandardPaths::writableLocation(QStandardPaths::CacheLocation) % '/'
@@ -99,7 +99,7 @@ QString QMatrixClient::cacheLocation(const QString& dirName)
return cachePath;
}
-qreal QMatrixClient::stringToHueF(const QString& string)
+qreal Quotient::stringToHueF(const QString& string)
{
Q_ASSERT(!string.isEmpty());
QByteArray hash = QCryptographicHash::hash(string.toUtf8(),
@@ -118,7 +118,7 @@ static const auto ServerPartRegEx = QStringLiteral(
"(?::(\\d{1,5}))?" // Optional port
);
-QString QMatrixClient::serverPart(const QString& mxId)
+QString Quotient::serverPart(const QString& mxId)
{
static QString re = "^[@!#$+].+?:(" // Localpart and colon
% ServerPartRegEx % ")$";
@@ -135,7 +135,7 @@ QString QMatrixClient::serverPart(const QString& mxId)
# pragma clang diagnostic push
# pragma ide diagnostic ignored "OCSimplifyInspection"
#endif
-using namespace QMatrixClient;
+using namespace Quotient;
int f();
static_assert(std::is_same<fn_return_t<decltype(f)>, int>::value,