diff --git a/src/collection/collectionwatcher.cpp b/src/collection/collectionwatcher.cpp index 7b1b124d1..35e44f6a3 100644 --- a/src/collection/collectionwatcher.cpp +++ b/src/collection/collectionwatcher.cpp @@ -75,7 +75,7 @@ using namespace Qt::StringLiterals; QStringList CollectionWatcher::sValidImages = QStringList() << QStringLiteral("jpg") << QStringLiteral("png") << QStringLiteral("gif") << QStringLiteral("jpeg"); -CollectionWatcher::CollectionWatcher(Song::Source source, QObject *parent) +CollectionWatcher::CollectionWatcher(const Song::Source source, QObject *parent) : QObject(parent), source_(source), backend_(nullptr), @@ -801,7 +801,7 @@ void CollectionWatcher::UpdateCueAssociatedSongs(const QString &file, const QString &matching_cue, const QUrl &art_automatic, const SongList &old_cue_songs, - ScanTransaction *t) { + ScanTransaction *t) const { QHash sections_map; for (const Song &song : old_cue_songs) { @@ -880,7 +880,7 @@ void CollectionWatcher::UpdateNonCueAssociatedSong(const QString &file, } -SongList CollectionWatcher::ScanNewFile(const QString &file, const QString &path, const QString &fingerprint, const QString &matching_cue, QSet *cues_processed) { +SongList CollectionWatcher::ScanNewFile(const QString &file, const QString &path, const QString &fingerprint, const QString &matching_cue, QSet *cues_processed) const { SongList songs; @@ -1115,7 +1115,7 @@ void CollectionWatcher::DirectoryChanged(const QString &subdir) { if (it == subdir_mapping_.constEnd()) { return; } - CollectionDirectory dir = *it; + const CollectionDirectory dir = *it; qLog(Debug) << "Subdir" << subdir << "changed under directory" << dir.path << "id" << dir.id; diff --git a/src/collection/collectionwatcher.h b/src/collection/collectionwatcher.h index 0ab0bc7ce..9e75292be 100644 --- a/src/collection/collectionwatcher.h +++ b/src/collection/collectionwatcher.h @@ -53,7 +53,7 @@ class CollectionWatcher : public QObject { Q_OBJECT public: - explicit CollectionWatcher(Song::Source source, QObject *parent = nullptr); + explicit CollectionWatcher(const Song::Source source, QObject *parent = nullptr); ~CollectionWatcher(); Song::Source source() { return source_; } @@ -199,12 +199,12 @@ class CollectionWatcher : public QObject { void PerformScan(const bool incremental, const bool ignore_mtimes); // Updates the sections of a cue associated and altered (according to mtime) media file during a scan. - void UpdateCueAssociatedSongs(const QString &file, const QString &path, const QString &fingerprint, const QString &matching_cue, const QUrl &art_automatic, const SongList &old_cue_songs, ScanTransaction *t); + void UpdateCueAssociatedSongs(const QString &file, const QString &path, const QString &fingerprint, const QString &matching_cue, const QUrl &art_automatic, const SongList &old_cue_songs, ScanTransaction *t) const; // Updates a single non-cue associated and altered (according to mtime) song during a scan. void UpdateNonCueAssociatedSong(const QString &file, const QString &fingerprint, const SongList &matching_songs, const QUrl &art_automatic, const bool cue_deleted, ScanTransaction *t); // Scans a single media file that's present on the disk but not yet in the collection. // It may result in a multiple files added to the collection when the media file has many sections (like a CUE related media file). - SongList ScanNewFile(const QString &file, const QString &path, const QString &fingerprint, const QString &matching_cue, QSet *cues_processed); + SongList ScanNewFile(const QString &file, const QString &path, const QString &fingerprint, const QString &matching_cue, QSet *cues_processed) const; static void AddChangedSong(const QString &file, const Song &matching_song, const Song &new_song, ScanTransaction *t);