aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/networkaccessmanager.cpp5
-rw-r--r--lib/util.cpp30
2 files changed, 12 insertions, 23 deletions
diff --git a/lib/networkaccessmanager.cpp b/lib/networkaccessmanager.cpp
index 8ee080bf..b9037bcc 100644
--- a/lib/networkaccessmanager.cpp
+++ b/lib/networkaccessmanager.cpp
@@ -50,11 +50,12 @@ void NetworkAccessManager::clearIgnoredSslErrors()
static NetworkAccessManager* createNam()
{
auto nam = new NetworkAccessManager(QCoreApplication::instance());
- // See #109. Once Qt bearer management gets better, this workaround
- // should become unnecessary.
+#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
+ // See #109; in newer Qt, bearer management is deprecated altogether
nam->connect(nam, &QNetworkAccessManager::networkAccessibleChanged, [nam] {
nam->setNetworkAccessible(QNetworkAccessManager::Accessible);
});
+#endif
return nam;
}
diff --git a/lib/util.cpp b/lib/util.cpp
index 61661de8..797f6d69 100644
--- a/lib/util.cpp
+++ b/lib/util.cpp
@@ -126,32 +126,30 @@ QString Quotient::serverPart(const QString& mxId)
% ServerPartRegEx % ")$";
static QRegularExpression parser(
re,
- QRegularExpression::UseUnicodePropertiesOption); // Because Asian
- // digits
+ QRegularExpression::UseUnicodePropertiesOption); // Because Asian digits
return parser.match(mxId).captured(1);
}
// Tests for function_traits<>
-#ifdef Q_CC_CLANG
-# pragma clang diagnostic push
-# pragma ide diagnostic ignored "OCSimplifyInspection"
-#endif
using namespace Quotient;
-int f();
-static_assert(std::is_same<fn_return_t<decltype(f)>, int>::value,
+int f_();
+static_assert(std::is_same<fn_return_t<decltype(f_)>, int>::value,
"Test fn_return_t<>");
-void f1(int, QString);
-static_assert(std::is_same<fn_arg_t<decltype(f1), 1>, QString>::value,
+void f1_(int, QString);
+static_assert(std::is_same<fn_arg_t<decltype(f1_), 1>, QString>::value,
"Test fn_arg_t<>");
struct Fo {
int operator()();
+ static constexpr auto l = [] { return 0.0f; };
};
static_assert(std::is_same<fn_return_t<Fo>, int>::value,
"Test return type of function object");
+static_assert(std::is_same<fn_return_t<decltype(Fo::l)>, float>::value,
+ "Test return type of lambda");
struct Fo1 {
void operator()(int);
@@ -159,20 +157,10 @@ struct Fo1 {
static_assert(std::is_same<fn_arg_t<Fo1>, int>(),
"Test fn_arg_t defaulting to first argument");
-#if (!defined(_MSC_VER) || _MSC_VER >= 1910)
-static auto l = [] { return 1; };
-static_assert(std::is_same<fn_return_t<decltype(l)>, int>::value,
- "Test fn_return_t<> with lambda");
-#endif
-
template <typename T>
-QString ft(T&&)
+static QString ft(T&&)
{
return {};
}
static_assert(std::is_same<fn_arg_t<decltype(ft<QString>)>, QString&&>(),
"Test function templates");
-
-#ifdef Q_CC_CLANG
-# pragma clang diagnostic pop
-#endif