diff --git a/src/keyboard_layout_switching.cpp b/src/keyboard_layout_switching.cpp index 2a71192399..b0b509ed7d 100644 --- a/src/keyboard_layout_switching.cpp +++ b/src/keyboard_layout_switching.cpp @@ -282,7 +282,7 @@ ApplicationPolicy::ApplicationPolicy(KWin::Xkb* xkb, KWin::KeyboardLayout* layou const QStringList keyList = m_config.keyList().filter(keyPrefix); for (const QString& key : keyList) { m_layoutsRestored.insert( - key.midRef(keyPrefix.size()).toLatin1(), + QStringView(key).mid(keyPrefix.size()).toLatin1(), m_config.readEntry(key, 0)); } } diff --git a/src/libkwineffects/kwinglplatform.cpp b/src/libkwineffects/kwinglplatform.cpp index 01a4c962c4..858d7b1d40 100644 --- a/src/libkwineffects/kwinglplatform.cpp +++ b/src/libkwineffects/kwinglplatform.cpp @@ -225,7 +225,7 @@ static ChipClass detectRadeonClass(const QByteArray &chipset) const QString chipset16 = QString::fromLatin1(chipset); QString name = extract(chipset16, QStringLiteral("HD [0-9]{4}")); // HD followed by a space and 4 digits if (!name.isEmpty()) { - const int id = name.rightRef(4).toInt(); + const int id = QStringView(name).right(4).toInt(); if (id == 6250 || id == 6310) // Palm return Evergreen; @@ -246,7 +246,7 @@ static ChipClass detectRadeonClass(const QByteArray &chipset) name = extract(chipset16, QStringLiteral("X[0-9]{3,4}")); // X followed by 3-4 digits if (!name.isEmpty()) { - const int id = name.midRef(1, -1).toInt(); + const int id = QStringView(name).mid(1, -1).toInt(); // X1xxx if (id >= 1300) @@ -290,7 +290,7 @@ static ChipClass detectNVidiaClass(const QString &chipset) { QString name = extract(chipset, QStringLiteral("\\bNV[0-9,A-F]{2}\\b")); // NV followed by two hexadecimal digits if (!name.isEmpty()) { - const int id = chipset.midRef(2, -1).toInt(nullptr, 16); // Strip the 'NV' from the id + const int id = QStringView(chipset).mid(2, -1).toInt(nullptr, 16); // Strip the 'NV' from the id switch(id & 0xf0) { case 0x00: @@ -341,7 +341,7 @@ static ChipClass detectNVidiaClass(const QString &chipset) if (!name[name.length() - 1].isDigit()) name.chop(1); - const int id = name.rightRef(4).toInt(); + const int id = QStringView(name).right(4).toInt(); if (id < 6000) return NV30; @@ -360,7 +360,7 @@ static ChipClass detectNVidiaClass(const QString &chipset) if (!name[name.length() - 1].isDigit()) name.chop(1); - const int id = name.rightRef(3).toInt(); + const int id = QStringView(name).right(3).toInt(); if (id >= 100 && id < 600) { if (id >= 400) return GF100;