From 638ef4dba6649d4b7bfd80e9ebc207043d7a4aee Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 28 Apr 2025 19:47:28 +0200 Subject: api: remove Qt5 compat usage --- api/plugin-support.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'api') diff --git a/api/plugin-support.hpp b/api/plugin-support.hpp index 77160040..f577f62f 100644 --- a/api/plugin-support.hpp +++ b/api/plugin-support.hpp @@ -17,7 +17,8 @@ #include #include -#include +#include +#include #include #include #include @@ -132,16 +133,16 @@ private: static QString trim_filename(const QString& in_) { - QStringRef in(&in_); + auto in = QStringView{in_}; - const int idx = in.lastIndexOf("/"); + const int idx = in.lastIndexOf(QLatin1StringView{"/"}); if (idx != -1) { in = in.mid(idx + 1); - if (in.startsWith(OPENTRACK_LIBRARY_PREFIX) && - in.endsWith("." OPENTRACK_LIBRARY_EXTENSION)) + if (in.startsWith(QLatin1StringView{OPENTRACK_LIBRARY_PREFIX}) && + in.endsWith(QLatin1StringView{"." OPENTRACK_LIBRARY_EXTENSION})) { constexpr unsigned pfx_len = sizeof(OPENTRACK_LIBRARY_PREFIX) - 1; constexpr unsigned rst_len = sizeof("." OPENTRACK_LIBRARY_EXTENSION) - 1; @@ -159,7 +160,7 @@ private: for (auto name : names) { - if (in.startsWith(name)) + if (in.startsWith(QLatin1StringView{name})) return in.mid((int)std::strlen(name)).toString(); } } -- cgit v1.2.3