Commit 24d119d8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

we can use as_const

parent eb8fe15c
Pipeline #77139 passed with stage
in 8 minutes and 50 seconds
......@@ -1192,7 +1192,7 @@ void DatabaseInterface::insertTracksList(const DataTypes::ListTrackDataType &tra
if (!d->mInsertedArtists.isEmpty()) {
DataTypes::ListArtistDataType newArtists;
for (auto newArtistData : qAsConst(d->mInsertedArtists)) {
for (auto newArtistData : std::as_const(d->mInsertedArtists)) {
newArtists.push_back({{DataTypes::DatabaseIdRole, newArtistData.first},
{DataTypes::TitleRole, newArtistData.second},
{DataTypes::ElementTypeRole, ElisaUtils::Artist}});
......@@ -1204,7 +1204,7 @@ void DatabaseInterface::insertTracksList(const DataTypes::ListTrackDataType &tra
if (!d->mInsertedAlbums.isEmpty()) {
DataTypes::ListAlbumDataType newAlbums;
for (auto albumId : qAsConst(d->mInsertedAlbums)) {
for (auto albumId : std::as_const(d->mInsertedAlbums)) {
d->mModifiedAlbumIds.remove(albumId);
newAlbums.push_back(internalOneAlbumPartialData(albumId));
}
......@@ -1213,14 +1213,14 @@ void DatabaseInterface::insertTracksList(const DataTypes::ListTrackDataType &tra
Q_EMIT albumsAdded(newAlbums);
}
for (auto albumId : qAsConst(d->mModifiedAlbumIds)) {
for (auto albumId : std::as_const(d->mModifiedAlbumIds)) {
Q_EMIT albumModified({{DataTypes::DatabaseIdRole, albumId}}, albumId);
}
if (!d->mInsertedTracks.isEmpty()) {
DataTypes::ListTrackDataType newTracks;
for (auto trackId : qAsConst(d->mInsertedTracks)) {
for (auto trackId : std::as_const(d->mInsertedTracks)) {
newTracks.push_back(internalOneTrackPartialData(trackId));
d->mModifiedTrackIds.remove(trackId);
}
......@@ -1229,7 +1229,7 @@ void DatabaseInterface::insertTracksList(const DataTypes::ListTrackDataType &tra
Q_EMIT tracksAdded(newTracks);
}
for (auto trackId : qAsConst(d->mModifiedTrackIds)) {
for (auto trackId : std::as_const(d->mModifiedTrackIds)) {
Q_EMIT trackModified(internalOneTrackPartialData(trackId));
}
......@@ -1255,7 +1255,7 @@ void DatabaseInterface::removeTracksList(const QList<QUrl> &removedTracks)
if (!d->mInsertedArtists.isEmpty()) {
DataTypes::ListArtistDataType newArtists;
for (auto newArtistData : qAsConst(d->mInsertedArtists)) {
for (auto newArtistData : std::as_const(d->mInsertedArtists)) {
newArtists.push_back({{DataTypes::DatabaseIdRole, newArtistData.first},
{DataTypes::TitleRole, newArtistData.second},
{DataTypes::ElementTypeRole, ElisaUtils::Artist}});
......
......@@ -59,7 +59,7 @@ void ElisaConfigurationDialog::setRootPath(const QStringList &rootPath)
if (mRootPath.isEmpty()) {
auto systemMusicPaths = QStandardPaths::standardLocations(QStandardPaths::MusicLocation);
for (const auto &musicPath : qAsConst(systemMusicPaths)) {
for (const auto &musicPath : std::as_const(systemMusicPaths)) {
mRootPath.push_back(musicPath);
}
}
......
......@@ -212,7 +212,7 @@ auto MusicListenersManager::initializeRootPath()
{
auto initialRootPath = QStringList{};
auto systemMusicPaths = QStandardPaths::standardLocations(QStandardPaths::MusicLocation);
for (const auto &musicPath : qAsConst(systemMusicPaths)) {
for (const auto &musicPath : std::as_const(systemMusicPaths)) {
initialRootPath.push_back(musicPath);
}
......@@ -340,7 +340,7 @@ void MusicListenersManager::configChanged()
//resolve symlinks
QStringList allRootPaths;
for (const auto &onePath : qAsConst(inputRootPath)) {
for (const auto &onePath : std::as_const(inputRootPath)) {
auto workPath = onePath;
if (workPath.startsWith(QLatin1String("file:/"))) {
auto urlPath = QUrl{workPath};
......
......@@ -294,7 +294,7 @@ void DidlParser::browseFinished(UpnpControlAbstractServiceReply *self)
void DidlParser::groupNewTracksByAlbums()
{
d->mNewTracksByAlbums.clear();
for(const auto &newTrack : qAsConst(d->mNewMusicTracks)) {
for(const auto &newTrack : std::as_const(d->mNewMusicTracks)) {
d->mNewTracksByAlbums[newTrack.album()].push_back(newTrack);
}
}
......
......@@ -651,7 +651,7 @@ void UpnpContentDirectoryModel::contentChanged(const QString &parentId)
qCDebug(orgKdeElisaUpnp()) << "UpnpContentDirectoryModel::contentChanged" << parentId << parentInternalId;
for(const auto &oneUpnpTrack : qAsConst(d->mDidlParser.newMusicTracks())) {
for(const auto &oneUpnpTrack : std::as_const(d->mDidlParser.newMusicTracks())) {
d->mAllTrackData[d->mLastInternalId] = oneUpnpTrack;
d->mUpnpIds[oneUpnpTrack[DataTypes::IdRole].toString()] = d->mLastInternalId;
d->mChilds[parentInternalId].push_back(d->mLastInternalId);
......
......@@ -115,7 +115,7 @@ void UpnpDiscoverAllMusic::removedDevice(const UpnpDiscoveryResult &removedServi
void UpnpDiscoverAllMusic::networkChanged()
{
for (const auto &oneService : qAsConst(d->mAllServices)) {
for (const auto &oneService : std::as_const(d->mAllServices)) {
Q_EMIT removedUpnpContentDirectoryService(oneService.title());
}
......
......@@ -412,7 +412,7 @@ QString ViewManager::buildViewId() const
const auto &entryTypeMetaEnum = QMetaEnum::fromType<ElisaUtils::PlayListEntryType>();
QString viewId;
for (const auto &oneView : qAsConst(d->mViewParametersStack)) {
for (const auto &oneView : std::as_const(d->mViewParametersStack)) {
viewId += QString::fromLatin1(entryTypeMetaEnum.valueToKey(oneView.mDataType)) + QStringLiteral("::");
}
......
Supports Markdown
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