Fix various clazy warnings
This commit is contained in:
@@ -163,7 +163,8 @@ void MoodbarItemDelegate::StartLoadingData(const QUrl &url, Data *data) {
|
||||
|
||||
bool MoodbarItemDelegate::RemoveFromCacheIfIndexesInvalid(const QUrl &url, Data *data) {
|
||||
|
||||
for (const QPersistentModelIndex &idx : data->indexes_) {
|
||||
QSet<QPersistentModelIndex> indexes = data->indexes_;
|
||||
for (const QPersistentModelIndex &idx : indexes) {
|
||||
if (idx.isValid()) {
|
||||
return false;
|
||||
}
|
||||
@@ -278,7 +279,7 @@ void MoodbarItemDelegate::ImageLoaded(const QUrl &url, const QImage &image) {
|
||||
const QSortFilterProxyModel *filter = playlist->proxy();
|
||||
|
||||
// Update all the indices with the new pixmap.
|
||||
for (const QPersistentModelIndex &idx : data->indexes_) {
|
||||
for (const QPersistentModelIndex &idx : qAsConst(data->indexes_)) {
|
||||
if (idx.isValid() && idx.sibling(idx.row(), Playlist::Column_Filename).data().toUrl() == url) {
|
||||
QModelIndex source_index = idx;
|
||||
if (idx.model() == filter) {
|
||||
|
||||
@@ -176,7 +176,8 @@ void MoodbarLoader::RequestFinished(MoodbarPipeline *request, const QUrl &url) {
|
||||
|
||||
// Save the data alongside the original as well if we're configured to.
|
||||
if (save_) {
|
||||
const QString mood_filename(MoodFilenames(url.toLocalFile())[0]);
|
||||
QList<QString> mood_filenames = MoodFilenames(url.toLocalFile());
|
||||
const QString mood_filename(mood_filenames[0]);
|
||||
QFile mood_file(mood_filename);
|
||||
if (mood_file.open(QIODevice::WriteOnly)) {
|
||||
mood_file.write(request->data());
|
||||
|
||||
Reference in New Issue
Block a user