summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2020-06-11 11:36:54 +0200
committerKarsten Heimrich <karsten.heimrich@qt.io>2020-06-11 14:56:56 +0200
commitb38bcac27dd0c7f8845b4f947a0f631edc0bd33d (patch)
tree5653a4bac1deef9978c17c50c69819224eea1a4e /src/plugins
parentba2f42c2548a5175126497d2d69eef95c2a849ba (diff)
Qt6: Port QtMultimedia from QStringRef to QStringView
Task-number: QTBUG-84319 Change-Id: Ic342142dd17591159ee84139157e5ed613b03682 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/alsa/qalsaaudiodeviceinfo.cpp2
-rw-r--r--src/plugins/android/src/mediaplayer/qandroidmetadatareadercontrol.cpp2
-rw-r--r--src/plugins/audiocapture/audiocapturesession.cpp2
-rw-r--r--src/plugins/avfoundation/camera/avfstoragelocation.mm2
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp2
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp2
-rw-r--r--src/plugins/qnx/camera/bbmediastoragelocation.cpp2
7 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/alsa/qalsaaudiodeviceinfo.cpp b/src/plugins/alsa/qalsaaudiodeviceinfo.cpp
index 474fd6bd..5cfcb27e 100644
--- a/src/plugins/alsa/qalsaaudiodeviceinfo.cpp
+++ b/src/plugins/alsa/qalsaaudiodeviceinfo.cpp
@@ -416,7 +416,7 @@ QString QAlsaAudioDeviceInfo::deviceFromCardName(const QString &card)
int idx = 0;
char *name;
- QStringRef shortName = card.midRef(card.indexOf(QLatin1String("="), 0) + 1);
+ QStringView shortName = QStringView{card}.mid(card.indexOf(QLatin1String("="), 0) + 1);
while (snd_card_get_name(idx, &name) == 0) {
if (shortName.compare(QLatin1String(name)) == 0)
diff --git a/src/plugins/android/src/mediaplayer/qandroidmetadatareadercontrol.cpp b/src/plugins/android/src/mediaplayer/qandroidmetadatareadercontrol.cpp
index 66eafc76..1c700302 100644
--- a/src/plugins/android/src/mediaplayer/qandroidmetadatareadercontrol.cpp
+++ b/src/plugins/android/src/mediaplayer/qandroidmetadatareadercontrol.cpp
@@ -211,7 +211,7 @@ void QAndroidMetaDataReaderControl::extractMetadata(QAndroidMetaDataReaderContro
// The genre can be returned as an ID3v2 id, get the name for it in that case
if (string.startsWith('(') && string.endsWith(')')) {
bool ok = false;
- const int genreId = string.midRef(1, string.length() - 2).toInt(&ok);
+ const int genreId = QStringView{string}.mid(1, string.length() - 2).toInt(&ok);
if (ok && genreId >= 0 && genreId <= 125)
string = QLatin1String(qt_ID3GenreNames[genreId]);
}
diff --git a/src/plugins/audiocapture/audiocapturesession.cpp b/src/plugins/audiocapture/audiocapturesession.cpp
index 7ed3313d..9bdb5a92 100644
--- a/src/plugins/audiocapture/audiocapturesession.cpp
+++ b/src/plugins/audiocapture/audiocapturesession.cpp
@@ -247,7 +247,7 @@ QString AudioCaptureSession::generateFileName(const QDir &dir,
int lastClip = 0;
const auto list = dir.entryList(QStringList() << QString("clip_*.%1").arg(ext));
for (const QString &fileName : list) {
- int imgNumber = fileName.midRef(5, fileName.size()-6-ext.length()).toInt();
+ int imgNumber = QStringView{fileName}.mid(5, fileName.size()-6-ext.length()).toInt();
lastClip = qMax(lastClip, imgNumber);
}
diff --git a/src/plugins/avfoundation/camera/avfstoragelocation.mm b/src/plugins/avfoundation/camera/avfstoragelocation.mm
index c74ffe3a..6a1cdca1 100644
--- a/src/plugins/avfoundation/camera/avfstoragelocation.mm
+++ b/src/plugins/avfoundation/camera/avfstoragelocation.mm
@@ -104,7 +104,7 @@ QString AVFStorageLocation::generateFileName(const QString &prefix, const QDir &
//first run, find the maximum clip number during the fist capture
const auto list = dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(ext));
for (const QString &fileName : list) {
- int imgNumber = fileName.midRef(prefix.length(), fileName.size()-prefix.length()-ext.length()-1).toInt();
+ int imgNumber = QStringView{fileName}.mid(prefix.length(), fileName.size()-prefix.length()-ext.length()-1).toInt();
lastClip = qMax(lastClip, imgNumber);
}
}
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp b/src/plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp
index ae2b0201..120c19af 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamerimagecapturecontrol.cpp
@@ -82,7 +82,7 @@ int QGstreamerImageCaptureControl::capture(const QString &fileName)
QDir outputDir = QDir::currentPath();
const auto list = outputDir.entryList(QStringList() << "img_*.jpg");
for (const QString &fileName : list) {
- int imgNumber = fileName.midRef(4, fileName.size()-8).toInt();
+ int imgNumber = QStringView{fileName}.mid(4, fileName.size()-8).toInt();
lastImage = qMax(lastImage, imgNumber);
}
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp b/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
index 640f659b..d7f4ec03 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp
@@ -359,7 +359,7 @@ QString QGstreamerRecorderControl::generateFileName(const QDir &dir, const QStri
int lastClip = 0;
const auto list = dir.entryList(QStringList() << QString("clip_*.%1").arg(ext));
for (const QString &fileName : list) {
- int imgNumber = fileName.midRef(5, fileName.size()-6-ext.length()).toInt();
+ int imgNumber = QStringView{fileName}.mid(5, fileName.size()-6-ext.length()).toInt();
lastClip = qMax(lastClip, imgNumber);
}
diff --git a/src/plugins/qnx/camera/bbmediastoragelocation.cpp b/src/plugins/qnx/camera/bbmediastoragelocation.cpp
index 88f5cb51..c3aaed55 100644
--- a/src/plugins/qnx/camera/bbmediastoragelocation.cpp
+++ b/src/plugins/qnx/camera/bbmediastoragelocation.cpp
@@ -91,7 +91,7 @@ QString BbMediaStorageLocation::generateFileName(const QString &prefix, const QD
// first run, find the maximum media number during the fist capture
const auto list = dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(extension));
for (const QString &fileName : list) {
- const qint64 mediaIndex = fileName.midRef(prefix.length(), fileName.size() - prefix.length() - extension.length() - 1).toInt();
+ const qint64 mediaIndex = QStringView{fileName}.mid(prefix.length(), fileName.size() - prefix.length() - extension.length() - 1).toInt();
lastMediaIndex = qMax(lastMediaIndex, mediaIndex);
}
}