Commit 6d24ce6a authored by Urs Fleisch's avatar Urs Fleisch

Use midRef(), leftRef(), rightRef() where possible.

parent 39eb5d3d
......@@ -199,7 +199,7 @@ QStringList splitArgs(const QString& str)
return QStringList();
c = str.at(pos++);
} while (c != QLatin1Char('\''));
param += str.mid(spos, pos - spos - 1);
param += str.midRef(spos, pos - spos - 1);
} else if (c == QLatin1Char('"')) {
for (;;) {
if (pos >= str.size())
......
......@@ -195,7 +195,7 @@ void FormatConfig::formatString(QString& str) const
++j;
}
if (j > i) {
newstr.append(str.mid(i, j - i));
newstr.append(str.midRef(i, j - i));
i = j - 1;
continue;
}
......
......@@ -86,7 +86,7 @@ QString FrameTableModel::getDisplayName(const QString& str)
// probably "TXXX - User defined text information\nDescription" or
// "WXXX - User defined URL link\nDescription"
return str.mid(nlPos + 1);
} else if (str.mid(4, 3) == QLatin1String(" - ")) {
} else if (str.midRef(4, 3) == QLatin1String(" - ")) {
// probably "ID3-ID - Description"
return str.left(4);
} else {
......
......@@ -628,11 +628,11 @@ FrameCollection::const_iterator FrameCollection::searchByName(
int len = ucName.length();
for (it = begin(); it != end(); ++it) {
QString ucFrameName(it->getName().toUpper().remove(QLatin1Char('/')));
if (ucName == ucFrameName.left(len)) {
if (ucName == ucFrameName.leftRef(len)) {
break;
}
int nlPos = ucFrameName.indexOf(QLatin1Char('\n'));
if (nlPos > 0 && ucName == ucFrameName.mid(nlPos + 1, len)) {
if (nlPos > 0 && ucName == ucFrameName.midRef(nlPos + 1, len)) {
// Description in TXXX, WXXX, COMM, PRIV matches
break;
}
......
......@@ -33,7 +33,7 @@ bool Utils::hasIllegalFileNameCharacters(const QString& fileName)
{
static const char illegalChars[] = "<>:\"|?*";
QString fileNameWithoutDrive(
(QDir::isAbsolutePath(fileName) && fileName.mid(1, 2) == QLatin1String(":/"))
(QDir::isAbsolutePath(fileName) && fileName.midRef(1, 2) == QLatin1String(":/"))
? fileName.mid(3) : fileName);
for (const char* chPtr = illegalChars; *chPtr; ++chPtr) {
if (fileNameWithoutDrive.contains(QLatin1Char(*chPtr))) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment