From aaa530e72bd7d6d48710bd5ca452da0c01c09997 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 9 Apr 2023 20:23:42 +0200 Subject: [PATCH] Add const/references to all signal parameters --- src/analyzer/analyzercontainer.h | 2 +- src/collection/collection.h | 2 +- src/collection/collectionbackend.h | 20 +++--- src/collection/collectionfilterwidget.h | 2 +- src/collection/collectionmodel.h | 8 +-- src/collection/collectionview.h | 2 +- src/collection/collectionwatcher.h | 18 ++--- src/collection/groupbydialog.h | 2 +- src/core/application.h | 4 +- src/core/database.h | 4 +- src/core/deletefiles.h | 2 +- src/core/filesystemwatcherinterface.h | 2 +- src/core/macfslistener.h | 2 +- src/core/macsystemtrayicon.h | 2 +- src/core/mainwindow.h | 6 +- src/core/mergedproxymodel.h | 2 +- src/core/mpris2.h | 12 ++-- src/core/player.h | 14 ++-- src/core/qtsystemtrayicon.h | 2 +- src/core/songloader.h | 2 +- src/core/urlhandler.h | 2 +- src/covermanager/albumcoverchoicecontroller.h | 2 +- src/covermanager/albumcoverexporter.h | 2 +- src/covermanager/albumcoverfetcher.h | 8 +-- src/covermanager/albumcoverfetchersearch.h | 4 +- src/covermanager/albumcoverloader.h | 4 +- src/covermanager/albumcovermanager.h | 2 +- src/covermanager/coverprovider.h | 8 +-- src/covermanager/currentalbumcoverloader.h | 4 +- src/device/cddadevice.h | 2 +- src/device/cddasongloader.h | 8 +-- src/device/connecteddevice.h | 8 +-- src/device/devicelister.h | 8 +-- src/device/devicemanager.h | 4 +- src/device/gpodloader.h | 6 +- src/device/mtploader.h | 6 +- src/dialogs/edittagdialog.h | 2 +- src/dialogs/trackselectiondialog.h | 4 +- src/engine/enginebase.h | 14 ++-- src/engine/gstenginepipeline.h | 10 +-- src/equalizer/equalizer.h | 8 +-- src/equalizer/equalizerslider.cpp | 4 +- src/equalizer/equalizerslider.h | 6 +- src/globalshortcuts/globalshortcutsbackend.h | 2 +- src/internet/internetcollectionview.h | 4 +- src/internet/internetsearchview.h | 6 +- src/internet/internetservice.h | 71 +++++++++---------- src/lyrics/lyricsfetcher.h | 4 +- src/lyrics/lyricsfetchersearch.h | 4 +- src/lyrics/lyricsprovider.h | 6 +- src/moodbar/moodbarcontroller.h | 2 +- src/moodbar/moodbarpipeline.h | 2 +- src/musicbrainz/acoustidclient.h | 2 +- src/musicbrainz/musicbrainzclient.h | 4 +- src/musicbrainz/tagfetcher.h | 4 +- src/organize/organize.h | 6 +- src/organize/organizedialog.h | 2 +- src/playlist/playlist.h | 10 +-- src/playlist/playlistcontainer.h | 4 +- src/playlist/playlistheader.h | 4 +- src/playlist/playlistlistmodel.h | 4 +- src/playlist/playlistlistview.h | 2 +- src/playlist/playlistmanager.h | 24 +++---- src/playlist/playlistsequence.h | 4 +- src/playlist/playlisttabbar.h | 12 ++-- src/playlist/playlistview.h | 8 +-- src/playlist/songloaderinserter.h | 4 +- src/qobuz/qobuzfavoriterequest.h | 12 ++-- src/qobuz/qobuzrequest.h | 10 +-- src/qobuz/qobuzstreamurlrequest.h | 4 +- src/queue/queue.h | 6 +- src/radios/radiobackend.h | 2 +- src/radios/radioservice.h | 2 +- src/scrobbler/audioscrobbler.h | 10 +-- src/scrobbler/lastfmimport.h | 10 +-- src/scrobbler/listenbrainzscrobbler.h | 2 +- src/scrobbler/scrobblerservice.h | 2 +- src/scrobbler/scrobblingapi20.h | 2 +- src/settings/qobuzsettingspage.h | 2 +- src/settings/settingsdialog.h | 2 +- src/settings/settingspage.h | 2 +- src/settings/subsonicsettingspage.h | 2 +- src/settings/tidalsettingspage.h | 4 +- src/smartplaylists/playlistgenerator.h | 2 +- .../playlistgeneratorinserter.h | 4 +- src/smartplaylists/smartplaylistsview.h | 2 +- src/subsonic/subsonicrequest.h | 8 +-- src/tidal/tidalfavoriterequest.h | 12 ++-- src/tidal/tidalrequest.h | 10 +-- src/tidal/tidalstreamurlrequest.h | 4 +- src/transcoder/transcoder.h | 4 +- src/widgets/fancytabwidget.h | 4 +- src/widgets/favoritewidget.h | 2 +- src/widgets/fileview.h | 10 +-- src/widgets/fileviewlist.h | 10 +-- src/widgets/multiloadingindicator.h | 2 +- src/widgets/playingwidget.h | 2 +- src/widgets/qsearchfield.h | 2 +- src/widgets/ratingwidget.h | 2 +- src/widgets/sliderslider.h | 2 +- src/widgets/stretchheaderview.h | 2 +- src/widgets/trackslider.h | 4 +- 102 files changed, 296 insertions(+), 297 deletions(-) diff --git a/src/analyzer/analyzercontainer.h b/src/analyzer/analyzercontainer.h index 7e72ace7b..fa919add2 100644 --- a/src/analyzer/analyzercontainer.h +++ b/src/analyzer/analyzercontainer.h @@ -53,7 +53,7 @@ class AnalyzerContainer : public QWidget { static const char *kSettingsFramerate; signals: - void WheelEvent(int delta); + void WheelEvent(const int delta); protected: void mouseReleaseEvent(QMouseEvent*) override; diff --git a/src/collection/collection.h b/src/collection/collection.h index 54ad904cd..1a99948bd 100644 --- a/src/collection/collection.h +++ b/src/collection/collection.h @@ -81,7 +81,7 @@ class SCollection : public QObject { void SongsRatingChanged(const SongList &songs, const bool save_tags = false); signals: - void Error(QString); + void Error(const QString &error); void ExitFinished(); private: diff --git a/src/collection/collectionbackend.h b/src/collection/collectionbackend.h index be8d70be4..fe6316ffd 100644 --- a/src/collection/collectionbackend.h +++ b/src/collection/collectionbackend.h @@ -254,23 +254,23 @@ class CollectionBackend : public CollectionBackendInterface { void ExpireSongs(const int directory_id, const int expire_unavailable_songs_days); signals: - void DirectoryDiscovered(CollectionDirectory, CollectionSubdirectoryList); - void DirectoryDeleted(CollectionDirectory); + void DirectoryDiscovered(const CollectionDirectory &dir, const CollectionSubdirectoryList &subdir); + void DirectoryDeleted(const CollectionDirectory &dir); - void SongsDiscovered(SongList); - void SongsDeleted(SongList); - void SongsStatisticsChanged(SongList, bool = false); + void SongsDiscovered(const SongList &songs); + void SongsDeleted(const SongList &songs); + void SongsStatisticsChanged(const SongList &songs, const bool save_tags = false); void DatabaseReset(); - void TotalSongCountUpdated(int); - void TotalArtistCountUpdated(int); - void TotalAlbumCountUpdated(int); - void SongsRatingChanged(SongList, bool); + void TotalSongCountUpdated(const int count); + void TotalArtistCountUpdated(const int count); + void TotalAlbumCountUpdated(const int count); + void SongsRatingChanged(const SongList &songs, const bool save_tags); void ExitFinished(); - void Error(QString); + void Error(const QString &error); private: struct CompilationInfo { diff --git a/src/collection/collectionfilterwidget.h b/src/collection/collectionfilterwidget.h index 3ea3db8ff..31708aaa8 100644 --- a/src/collection/collectionfilterwidget.h +++ b/src/collection/collectionfilterwidget.h @@ -96,7 +96,7 @@ class CollectionFilterWidget : public QWidget { void UpPressed(); void DownPressed(); void ReturnPressed(); - void Filter(QString text); + void Filter(const QString &text); protected: void keyReleaseEvent(QKeyEvent *e) override; diff --git a/src/collection/collectionmodel.h b/src/collection/collectionmodel.h index 4d90431c2..a5970ff1d 100644 --- a/src/collection/collectionmodel.h +++ b/src/collection/collectionmodel.h @@ -199,10 +199,10 @@ class CollectionModel : public SimpleTreeModel { static QString ContainerKey(const GroupBy group_by, const bool separate_albums_by_grouping, const Song &song); signals: - void TotalSongCountUpdated(int count); - void TotalArtistCountUpdated(int count); - void TotalAlbumCountUpdated(int count); - void GroupingChanged(CollectionModel::Grouping g, bool separate_albums_by_grouping); + void TotalSongCountUpdated(const int count); + void TotalArtistCountUpdated(const int count); + void TotalAlbumCountUpdated(const int count); + void GroupingChanged(const CollectionModel::Grouping g, const bool separate_albums_by_grouping); public slots: void SetFilterMode(CollectionFilterOptions::FilterMode filter_mode); diff --git a/src/collection/collectionview.h b/src/collection/collectionview.h index 848244d1e..a2c98ef40 100644 --- a/src/collection/collectionview.h +++ b/src/collection/collectionview.h @@ -89,7 +89,7 @@ class CollectionView : public AutoExpandingTreeView { void TotalSongCountUpdated_(); void TotalArtistCountUpdated_(); void TotalAlbumCountUpdated_(); - void Error(QString); + void Error(const QString &error); protected: // QWidget diff --git a/src/collection/collectionwatcher.h b/src/collection/collectionwatcher.h index a44b9f66f..61004d39f 100644 --- a/src/collection/collectionwatcher.h +++ b/src/collection/collectionwatcher.h @@ -70,18 +70,18 @@ class CollectionWatcher : public QObject { void RescanSongsAsync(const SongList &songs); signals: - void NewOrUpdatedSongs(SongList); - void SongsMTimeUpdated(SongList); - void SongsDeleted(SongList); - void SongsUnavailable(SongList songs, bool unavailable = true); - void SongsReadded(SongList songs, bool unavailable = false); - void SubdirsDiscovered(CollectionSubdirectoryList subdirs); - void SubdirsMTimeUpdated(CollectionSubdirectoryList subdirs); + void NewOrUpdatedSongs(const SongList &songs); + void SongsMTimeUpdated(const SongList &songs); + void SongsDeleted(const SongList &songs); + void SongsUnavailable(const SongList &songs, const bool unavailable = true); + void SongsReadded(const SongList &songs, const bool unavailable = false); + void SubdirsDiscovered(const CollectionSubdirectoryList &subdirs); + void SubdirsMTimeUpdated(const CollectionSubdirectoryList &subdirs); void CompilationsNeedUpdating(); - void UpdateLastSeen(int directory_id, int expire_unavailable_songs_days); + void UpdateLastSeen(const int directory_id, const int expire_unavailable_songs_days); void ExitFinished(); - void ScanStarted(int task_id); + void ScanStarted(const int task_id); public slots: void AddDirectory(const CollectionDirectory &dir, const CollectionSubdirectoryList &subdirs); diff --git a/src/collection/groupbydialog.h b/src/collection/groupbydialog.h index 983c2e7b3..2f23618b4 100644 --- a/src/collection/groupbydialog.h +++ b/src/collection/groupbydialog.h @@ -49,7 +49,7 @@ class GroupByDialog : public QDialog { void accept() override; signals: - void Accepted(CollectionModel::Grouping g, bool separate_albums_by_grouping); + void Accepted(const CollectionModel::Grouping g, const bool separate_albums_by_grouping); private slots: void Reset(); diff --git a/src/core/application.h b/src/core/application.h index 3667c8bc6..b793f2090 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -118,9 +118,9 @@ class Application : public QObject { void OpenSettingsDialogAtPage(SettingsDialog::Page page); signals: - void ErrorAdded(QString message); + void ErrorAdded(const QString &message); void SettingsChanged(); - void SettingsDialogRequested(SettingsDialog::Page page); + void SettingsDialogRequested(const SettingsDialog::Page page); void ExitFinished(); void ClearPixmapDiskCache(); diff --git a/src/core/database.h b/src/core/database.h index 5de96a70b..4ea1b15ee 100644 --- a/src/core/database.h +++ b/src/core/database.h @@ -88,8 +88,8 @@ class Database : public QObject { signals: void ExitFinished(); - void Error(QString error); - void Errors(QStringList errors); + void Error(const QString &error); + void Errors(const QStringList &errors); private slots: void Exit(); diff --git a/src/core/deletefiles.h b/src/core/deletefiles.h index 6533c20dd..0d359010d 100644 --- a/src/core/deletefiles.h +++ b/src/core/deletefiles.h @@ -48,7 +48,7 @@ class DeleteFiles : public QObject { void Start(const QStringList &filenames); signals: - void Finished(SongList songs_with_errors); + void Finished(const SongList &songs_with_errors); private slots: void ProcessSomeFiles(); diff --git a/src/core/filesystemwatcherinterface.h b/src/core/filesystemwatcherinterface.h index 821457968..d342a7417 100644 --- a/src/core/filesystemwatcherinterface.h +++ b/src/core/filesystemwatcherinterface.h @@ -40,7 +40,7 @@ class FileSystemWatcherInterface : public QObject { static FileSystemWatcherInterface *Create(QObject *parent = nullptr); signals: - void PathChanged(QString path); + void PathChanged(const QString &path); }; #endif diff --git a/src/core/macfslistener.h b/src/core/macfslistener.h index df5a5d593..58279c205 100644 --- a/src/core/macfslistener.h +++ b/src/core/macfslistener.h @@ -45,7 +45,7 @@ class MacFSListener : public FileSystemWatcherInterface { void Clear(); signals: - void PathChanged(QString path); + void PathChanged(const QString &path); private slots: void UpdateStream(); diff --git a/src/core/macsystemtrayicon.h b/src/core/macsystemtrayicon.h index 3ce92440a..ce81cf4f9 100644 --- a/src/core/macsystemtrayicon.h +++ b/src/core/macsystemtrayicon.h @@ -76,7 +76,7 @@ class SystemTrayIcon : public QObject { void ActionChanged(); signals: - void ChangeVolume(int delta); + void ChangeVolume(const int delta); void SeekForward(); void SeekBackward(); void NextTrack(); diff --git a/src/core/mainwindow.h b/src/core/mainwindow.h index 4ecf949a1..377244386 100644 --- a/src/core/mainwindow.h +++ b/src/core/mainwindow.h @@ -132,12 +132,12 @@ class MainWindow : public QMainWindow, public PlatformInterface { bool LoadUrl(const QString &url) override; signals: - void AlbumCoverReady(Song song, QImage image); + void AlbumCoverReady(const Song &song, const QImage &image); void SearchCoverInProgress(); // Signals that stop playing after track was toggled. - void StopAfterToggled(bool stop); + void StopAfterToggled(const bool stop); - void AuthorizationUrlReceived(QUrl url); + void AuthorizationUrlReceived(const QUrl &url); private slots: void FilePathChanged(const QString &path); diff --git a/src/core/mergedproxymodel.h b/src/core/mergedproxymodel.h index bdeed3447..2ab1fa898 100644 --- a/src/core/mergedproxymodel.h +++ b/src/core/mergedproxymodel.h @@ -85,7 +85,7 @@ class MergedProxyModel : public QAbstractProxyModel { QModelIndexList mapToSource(const QModelIndexList &proxy_indexes) const; signals: - void SubModelReset(QModelIndex root, QAbstractItemModel *model); + void SubModelReset(const QModelIndex root, QAbstractItemModel *model); private slots: void SourceModelReset(); diff --git a/src/core/mpris2.h b/src/core/mpris2.h index 7785a2f43..0434210ad 100644 --- a/src/core/mpris2.h +++ b/src/core/mpris2.h @@ -188,18 +188,18 @@ class Mpris2 : public QObject { signals: // Player - void Seeked(qint64 position); + void Seeked(const qint64 position); // TrackList - void TrackListReplaced(Track_Ids Tracks, QDBusObjectPath CurrentTrack); - void TrackAdded(TrackMetadata Metadata, QDBusObjectPath AfterTrack); - void TrackRemoved(QDBusObjectPath trackId); - void TrackMetadataChanged(QDBusObjectPath trackId, TrackMetadata metadata); + void TrackListReplaced(const Track_Ids &tracks, const QDBusObjectPath ¤t_track); + void TrackAdded(const TrackMetadata &metadata, const QDBusObjectPath &after_track); + void TrackRemoved(const QDBusObjectPath &track_id); + void TrackMetadataChanged(const QDBusObjectPath &track_id, const TrackMetadata &metadata); void RaiseMainWindow(); // Playlist - void PlaylistChanged(MprisPlaylist playlist); + void PlaylistChanged(const MprisPlaylist &playlist); private slots: void AlbumCoverLoaded(const Song &song, AlbumCoverLoaderResultPtr result = AlbumCoverLoaderResultPtr()); diff --git a/src/core/player.h b/src/core/player.h index 932b03871..f06ff6cb5 100644 --- a/src/core/player.h +++ b/src/core/player.h @@ -111,20 +111,20 @@ class PlayerInterface : public QObject { // Emitted only when playback is manually resumed void Resumed(); void Stopped(); - void Error(QString message = QString()); + void Error(const QString &message = QString()); void PlaylistFinished(); - void VolumeEnabled(bool); - void VolumeChanged(uint volume); + void VolumeEnabled(const bool volume_enabled); + void VolumeChanged(const uint volume); void TrackSkipped(PlaylistItemPtr old_track); // Emitted when there's a manual change to the current's track position. - void Seeked(qint64 microseconds); + void Seeked(const qint64 microseconds); // Emitted when Player has processed a request to play another song. // This contains the URL of the song and a flag saying whether it was able to play the song. - void SongChangeRequestProcessed(QUrl url, bool valid); + void SongChangeRequestProcessed(const QUrl &url, const bool valid); // The toggle parameter is true when user requests to toggle visibility for Pretty OSD - void ForceShowOSD(Song, bool toggle); + void ForceShowOSD(const Song &song, const bool toggle); void Authenticated(); @@ -193,7 +193,7 @@ class Player : public PlayerInterface { void HandleAuthentication(); signals: - void EngineChanged(Engine::EngineType enginetype); + void EngineChanged(const Engine::EngineType enginetype); private slots: void EngineStateChanged(const Engine::State); diff --git a/src/core/qtsystemtrayicon.h b/src/core/qtsystemtrayicon.h index 7021882a4..d2b95e52d 100644 --- a/src/core/qtsystemtrayicon.h +++ b/src/core/qtsystemtrayicon.h @@ -69,7 +69,7 @@ class SystemTrayIcon : public QSystemTrayIcon { void UpdateIcon(); signals: - void ChangeVolume(int delta); + void ChangeVolume(const int delta); void SeekForward(); void SeekBackward(); void NextTrack(); diff --git a/src/core/songloader.h b/src/core/songloader.h index 5ae3ed936..1bfddab80 100644 --- a/src/core/songloader.h +++ b/src/core/songloader.h @@ -89,7 +89,7 @@ class SongLoader : public QObject { signals: void AudioCDTracksLoadFinished(); - void LoadAudioCDFinished(bool success); + void LoadAudioCDFinished(const bool success); void LoadRemoteFinished(); private slots: diff --git a/src/core/urlhandler.h b/src/core/urlhandler.h index 24054f37a..b5293f0ed 100644 --- a/src/core/urlhandler.h +++ b/src/core/urlhandler.h @@ -91,7 +91,7 @@ class UrlHandler : public QObject { virtual LoadResult StartLoading(const QUrl &url) { return LoadResult(url); } signals: - void AsyncLoadComplete(UrlHandler::LoadResult result); + void AsyncLoadComplete(const UrlHandler::LoadResult &result); }; diff --git a/src/covermanager/albumcoverchoicecontroller.h b/src/covermanager/albumcoverchoicecontroller.h index cbfe8b3c5..3c92e5aef 100644 --- a/src/covermanager/albumcoverchoicecontroller.h +++ b/src/covermanager/albumcoverchoicecontroller.h @@ -158,7 +158,7 @@ class AlbumCoverChoiceController : public QWidget { void SaveEmbeddedCoverAsyncFinished(quint64 id, const bool success, const bool cleared); signals: - void Error(QString); + void Error(const QString &error); void AutomaticCoverSearchDone(); private: diff --git a/src/covermanager/albumcoverexporter.h b/src/covermanager/albumcoverexporter.h index a88738446..30aadab3a 100644 --- a/src/covermanager/albumcoverexporter.h +++ b/src/covermanager/albumcoverexporter.h @@ -49,7 +49,7 @@ class AlbumCoverExporter : public QObject { int request_count() { return static_cast(requests_.size()); } signals: - void AlbumCoversExportUpdate(int exported, int skipped, int all); + void AlbumCoversExportUpdate(const int exported, const int skipped, const int all); private slots: void CoverExported(); diff --git a/src/covermanager/albumcoverfetcher.h b/src/covermanager/albumcoverfetcher.h index 50958eff9..40297e1bc 100644 --- a/src/covermanager/albumcoverfetcher.h +++ b/src/covermanager/albumcoverfetcher.h @@ -118,12 +118,12 @@ class AlbumCoverFetcher : public QObject { void Clear(); signals: - void AlbumCoverFetched(quint64 request_id, AlbumCoverImageResultPtr result, CoverSearchStatistics statistics); - void SearchFinished(quint64 request_id, CoverProviderSearchResults results, CoverSearchStatistics statistics); + void AlbumCoverFetched(const quint64 request_id, AlbumCoverImageResultPtr result, const CoverSearchStatistics &statistics); + void SearchFinished(const quint64 request_id, const CoverProviderSearchResults &results, const CoverSearchStatistics &statistics); private slots: - void SingleSearchFinished(const quint64, const CoverProviderSearchResults &results); - void SingleCoverFetched(const quint64, AlbumCoverImageResultPtr result); + void SingleSearchFinished(const quint64 id, const CoverProviderSearchResults &results); + void SingleCoverFetched(const quint64 id, AlbumCoverImageResultPtr result); void StartRequests(); private: diff --git a/src/covermanager/albumcoverfetchersearch.h b/src/covermanager/albumcoverfetchersearch.h index 73e23c5a8..8b67f04ed 100644 --- a/src/covermanager/albumcoverfetchersearch.h +++ b/src/covermanager/albumcoverfetchersearch.h @@ -66,10 +66,10 @@ class AlbumCoverFetcherSearch : public QObject { signals: // It's the end of search (when there was no fetch-me-a-cover request). - void SearchFinished(quint64, CoverProviderSearchResults results); + void SearchFinished(quint64, const CoverProviderSearchResults &results); // It's the end of search and we've fetched a cover. - void AlbumCoverFetched(const quint64, AlbumCoverImageResultPtr result); + void AlbumCoverFetched(const quint64 id, AlbumCoverImageResultPtr result); private slots: void ProviderSearchResults(const int id, const CoverProviderSearchResults &results); diff --git a/src/covermanager/albumcoverloader.h b/src/covermanager/albumcoverloader.h index a9fe338a3..b5ad1e413 100644 --- a/src/covermanager/albumcoverloader.h +++ b/src/covermanager/albumcoverloader.h @@ -79,8 +79,8 @@ class AlbumCoverLoader : public QObject { signals: void ExitFinished(); - void AlbumCoverLoaded(quint64 id, AlbumCoverLoaderResultPtr result); - void SaveEmbeddedCoverAsyncFinished(quint64 id, bool success, bool cleared); + void AlbumCoverLoaded(const quint64 id, AlbumCoverLoaderResultPtr result); + void SaveEmbeddedCoverAsyncFinished(const quint64 id, const bool success, const bool cleared); protected slots: void Exit(); diff --git a/src/covermanager/albumcovermanager.h b/src/covermanager/albumcovermanager.h index 8d06273f6..500c46abc 100644 --- a/src/covermanager/albumcovermanager.h +++ b/src/covermanager/albumcovermanager.h @@ -147,7 +147,7 @@ class AlbumCoverManager : public QMainWindow { bool ItemHasCover(const AlbumItem &item) const; signals: - void Error(QString); + void Error(const QString &error); void AddToPlaylist(QMimeData *data); private slots: diff --git a/src/covermanager/coverprovider.h b/src/covermanager/coverprovider.h index 537b6976b..187ae400f 100644 --- a/src/covermanager/coverprovider.h +++ b/src/covermanager/coverprovider.h @@ -68,11 +68,11 @@ class CoverProvider : public QObject { virtual void Error(const QString &error, const QVariant &debug = QVariant()) = 0; signals: - void AuthenticationComplete(bool, QStringList = QStringList()); + void AuthenticationComplete(const bool success, const QStringList &errors = QStringList()); void AuthenticationSuccess(); - void AuthenticationFailure(QStringList); - void SearchResults(int, CoverProviderSearchResults); - void SearchFinished(int, CoverProviderSearchResults); + void AuthenticationFailure(const QStringList &errors); + void SearchResults(const int id, const CoverProviderSearchResults &results); + void SearchFinished(const int id, const CoverProviderSearchResults &results); protected: using Param = QPair; diff --git a/src/covermanager/currentalbumcoverloader.h b/src/covermanager/currentalbumcoverloader.h index 5296a2f0e..770008b01 100644 --- a/src/covermanager/currentalbumcoverloader.h +++ b/src/covermanager/currentalbumcoverloader.h @@ -52,8 +52,8 @@ class CurrentAlbumCoverLoader : public QObject { void LoadAlbumCover(const Song &song); signals: - void AlbumCoverLoaded(Song song, AlbumCoverLoaderResultPtr result); - void ThumbnailLoaded(Song song, QUrl thumbnail_uri, const QImage &image); + void AlbumCoverLoaded(const Song &song, AlbumCoverLoaderResultPtr result); + void ThumbnailLoaded(const Song &song, const QUrl &thumbnail_uri, const QImage &image); private slots: void TempAlbumCoverLoaded(const quint64 id, AlbumCoverLoaderResultPtr result); diff --git a/src/device/cddadevice.h b/src/device/cddadevice.h index 5def49bc7..81567fef1 100644 --- a/src/device/cddadevice.h +++ b/src/device/cddadevice.h @@ -56,7 +56,7 @@ class CddaDevice : public ConnectedDevice { static QStringList url_schemes() { return QStringList() << "cdda"; } signals: - void SongsDiscovered(SongList songs); + void SongsDiscovered(const SongList &songs); private slots: void SongsLoaded(const SongList &songs); diff --git a/src/device/cddasongloader.h b/src/device/cddasongloader.h index a75659079..0bac971cb 100644 --- a/src/device/cddasongloader.h +++ b/src/device/cddasongloader.h @@ -57,10 +57,10 @@ class CddaSongLoader : public QObject { QUrl GetUrlFromTrack(const int track_number) const; signals: - void SongsLoadError(QString error); - void SongsLoaded(SongList songs); - void SongsDurationLoaded(SongList songs, QString error = QString()); - void SongsMetadataLoaded(SongList songs); + void SongsLoadError(const QString &error); + void SongsLoaded(const SongList &songs); + void SongsDurationLoaded(const SongList &songs, const QString &error = QString()); + void SongsMetadataLoaded(const SongList &songs); private slots: #ifdef HAVE_MUSICBRAINZ diff --git a/src/device/connecteddevice.h b/src/device/connecteddevice.h index ed6f37aba..b6f146431 100644 --- a/src/device/connecteddevice.h +++ b/src/device/connecteddevice.h @@ -75,10 +75,10 @@ class ConnectedDevice : public QObject, public virtual MusicStorage, public std: void BackendCloseFinished(); signals: - void TaskStarted(int id); - void SongCountUpdated(int count); - void DeviceConnectFinished(QString id, bool success); - void DeviceCloseFinished(QString id); + void TaskStarted(const int id); + void SongCountUpdated(const int count); + void DeviceConnectFinished(const QString &id, const bool success); + void DeviceCloseFinished(const QString &id); protected: void InitBackendDirectory(const QString &mount_point, const bool first_time, const bool rewrite_path = true); diff --git a/src/device/devicelister.h b/src/device/devicelister.h index 10689062a..9580da288 100644 --- a/src/device/devicelister.h +++ b/src/device/devicelister.h @@ -82,10 +82,10 @@ class DeviceLister : public QObject { virtual void Exit(); signals: - void DeviceAdded(QString id); - void DeviceRemoved(QString id); - void DeviceChanged(QString id); - void DeviceMounted(QString id, int request_id, bool success); + void DeviceAdded(const QString &id); + void DeviceRemoved(const QString &id); + void DeviceChanged(const QString &id); + void DeviceMounted(const QString &id, const int request_id, const bool success); void ExitFinished(); protected: diff --git a/src/device/devicemanager.h b/src/device/devicemanager.h index 2dc131ae0..c16345386 100644 --- a/src/device/devicemanager.h +++ b/src/device/devicemanager.h @@ -120,8 +120,8 @@ class DeviceManager : public SimpleTreeModel { signals: void ExitFinished(); - void DeviceConnected(QModelIndex idx); - void DeviceDisconnected(QModelIndex idx); + void DeviceConnected(const QModelIndex idx); + void DeviceDisconnected(const QModelIndex idx); void DeviceCreatedFromDB(DeviceInfo *info); private slots: diff --git a/src/device/gpodloader.h b/src/device/gpodloader.h index 7ce84f844..96508a5ca 100644 --- a/src/device/gpodloader.h +++ b/src/device/gpodloader.h @@ -53,9 +53,9 @@ class GPodLoader : public QObject { void LoadDatabase(); signals: - void Error(QString message); - void TaskStarted(int task_id); - void LoadFinished(Itdb_iTunesDB *db, bool success); + void Error(const QString &message); + void TaskStarted(const int task_id); + void LoadFinished(Itdb_iTunesDB *db, const bool success); private: Itdb_iTunesDB *TryLoad(); diff --git a/src/device/mtploader.h b/src/device/mtploader.h index b6a18119e..336b301f4 100644 --- a/src/device/mtploader.h +++ b/src/device/mtploader.h @@ -49,9 +49,9 @@ class MtpLoader : public QObject { void LoadDatabase(); signals: - void Error(QString message); - void TaskStarted(int task_id); - void LoadFinished(bool success, MtpConnection*); + void Error(const QString &message); + void TaskStarted(const int task_id); + void LoadFinished(const bool success, MtpConnection *connection); private: bool TryLoad(); diff --git a/src/dialogs/edittagdialog.h b/src/dialogs/edittagdialog.h index 76187e346..1d6b7a8b3 100644 --- a/src/dialogs/edittagdialog.h +++ b/src/dialogs/edittagdialog.h @@ -77,7 +77,7 @@ class EditTagDialog : public QDialog { void accept() override; signals: - void Error(QString message); + void Error(const QString &message); protected: bool eventFilter(QObject *o, QEvent *e) override; diff --git a/src/dialogs/trackselectiondialog.h b/src/dialogs/trackselectiondialog.h index 3a4d85d47..c506bacfe 100644 --- a/src/dialogs/trackselectiondialog.h +++ b/src/dialogs/trackselectiondialog.h @@ -54,8 +54,8 @@ class TrackSelectionDialog : public QDialog { void accept() override; signals: - void Error(QString); - void SongChosen(Song original_song, Song new_metadata); + void Error(const QString &error); + void SongChosen(const Song &original_song, const Song &new_metadata); private slots: void UpdateStack(); diff --git a/src/engine/enginebase.h b/src/engine/enginebase.h index 8c730b1ad..64f71f3f4 100644 --- a/src/engine/enginebase.h +++ b/src/engine/enginebase.h @@ -137,23 +137,23 @@ class Base : public QObject { void FadeoutFinishedSignal(); - void StatusText(QString text); - void Error(QString text); + void StatusText(const QString &text); + void Error(const QString &text); // Emitted when there was a fatal error void FatalError(); // Emitted when Engine was unable to play a song with the given QUrl. - void InvalidSongRequested(QUrl url); + void InvalidSongRequested(const QUrl &url); // Emitted when Engine successfully started playing a song with the given QUrl. - void ValidSongRequested(QUrl url); + void ValidSongRequested(const QUrl &url); - void MetaData(Engine::SimpleMetaBundle); + void MetaData(const Engine::SimpleMetaBundle &bundle); // Signals that the engine's state has changed (a stream was stopped for example). // Always use the state from event, because it's not guaranteed that immediate subsequent call to state() won't return a stale value. - void StateChanged(Engine::State); + void StateChanged(const Engine::State state); - void VolumeChanged(uint volume); + void VolumeChanged(const uint volume); protected: diff --git a/src/engine/gstenginepipeline.h b/src/engine/gstenginepipeline.h index 47a989f88..88ea29ae0 100644 --- a/src/engine/gstenginepipeline.h +++ b/src/engine/gstenginepipeline.h @@ -126,16 +126,16 @@ class GstEnginePipeline : public QObject { void SetFaderVolume(const qreal volume); signals: - void Error(int pipeline_id, int domain, int error_code, QString message, QString debug); + void Error(const int pipeline_id, const int domain, const int error_code, const QString &message, const QString &debug); - void EndOfStreamReached(int pipeline_id, bool has_next_track); - void MetadataFound(int pipeline_id, const Engine::SimpleMetaBundle &bundle); + void EndOfStreamReached(const int pipeline_id, const bool has_next_track); + void MetadataFound(const int pipeline_id, const Engine::SimpleMetaBundle &bundle); - void VolumeChanged(uint volume); + void VolumeChanged(const uint volume); void FaderFinished(); void BufferingStarted(); - void BufferingProgress(int percent); + void BufferingProgress(const int percent); void BufferingFinished(); protected: diff --git a/src/equalizer/equalizer.h b/src/equalizer/equalizer.h index 1e132d834..b71a237b0 100644 --- a/src/equalizer/equalizer.h +++ b/src/equalizer/equalizer.h @@ -67,10 +67,10 @@ class Equalizer : public QDialog { float stereo_balance() const; signals: - void StereoBalancerEnabledChanged(bool enabled); - void StereoBalanceChanged(float balance); - void EqualizerEnabledChanged(bool enabled); - void EqualizerParametersChanged(int preamp, QList band_gains); + void StereoBalancerEnabledChanged(const bool enabled); + void StereoBalanceChanged(const float balance); + void EqualizerEnabledChanged(const bool enabled); + void EqualizerParametersChanged(const int preamp, const QList &band_gains); protected: void closeEvent(QCloseEvent*) override; diff --git a/src/equalizer/equalizerslider.cpp b/src/equalizer/equalizerslider.cpp index fa1bc4d90..b7e7900c8 100644 --- a/src/equalizer/equalizerslider.cpp +++ b/src/equalizer/equalizerslider.cpp @@ -56,7 +56,7 @@ EqualizerSlider::~EqualizerSlider() { delete ui_; } -void EqualizerSlider::OnValueChanged(int value) { +void EqualizerSlider::OnValueChanged(const int value) { // Converting % to dB as per GstEnginePipeline::UpdateEqualizer(): float gain = (static_cast(value) < 0) ? static_cast(value) * static_cast(0.24) : static_cast(value) * static_cast(0.12); @@ -70,7 +70,7 @@ int EqualizerSlider::value() const { return ui_->slider->value(); } -void EqualizerSlider::set_value(int value) { +void EqualizerSlider::set_value(const int value) { ui_->slider->setValue(value); } diff --git a/src/equalizer/equalizerslider.h b/src/equalizer/equalizerslider.h index a9ef31b97..68169bfea 100644 --- a/src/equalizer/equalizerslider.h +++ b/src/equalizer/equalizerslider.h @@ -38,13 +38,13 @@ class EqualizerSlider : public QWidget { ~EqualizerSlider() override; int value() const; - void set_value(int value); + void set_value(const int value); signals: - void ValueChanged(int value); + void ValueChanged(const int value); public slots: - void OnValueChanged(int value); + void OnValueChanged(const int value); private: Ui_EqualizerSlider *ui_; diff --git a/src/globalshortcuts/globalshortcutsbackend.h b/src/globalshortcuts/globalshortcutsbackend.h index ce22846c9..b644df645 100644 --- a/src/globalshortcuts/globalshortcutsbackend.h +++ b/src/globalshortcuts/globalshortcutsbackend.h @@ -55,7 +55,7 @@ class GlobalShortcutsBackend : public QObject { bool is_active() const { return active_; } signals: - void RegisterFinished(bool success); + void RegisterFinished(const bool success); protected: virtual bool DoRegister() = 0; diff --git a/src/internet/internetcollectionview.h b/src/internet/internetcollectionview.h index f39f65d56..866b172f8 100644 --- a/src/internet/internetcollectionview.h +++ b/src/internet/internetcollectionview.h @@ -86,8 +86,8 @@ class InternetCollectionView : public AutoExpandingTreeView { void TotalSongCountUpdated_(); void TotalArtistCountUpdated_(); void TotalAlbumCountUpdated_(); - void Error(QString); - void RemoveSongs(SongList songs); + void Error(const QString &error); + void RemoveSongs(const SongList &songs); protected: // QWidget diff --git a/src/internet/internetsearchview.h b/src/internet/internetsearchview.h index c0fcf7bd5..ce1835086 100644 --- a/src/internet/internetsearchview.h +++ b/src/internet/internetsearchview.h @@ -140,9 +140,9 @@ class InternetSearchView : public QWidget { signals: void AddToPlaylist(QMimeData*); - void AddArtistsSignal(SongList); - void AddAlbumsSignal(SongList); - void AddSongsSignal(SongList); + void AddArtistsSignal(const SongList &songs); + void AddAlbumsSignal(const SongList &songs); + void AddSongsSignal(const SongList &songs); private slots: void SwapModels(); diff --git a/src/internet/internetservice.h b/src/internet/internetservice.h index b7f140d33..6a1e770fd 100644 --- a/src/internet/internetservice.h +++ b/src/internet/internetservice.h @@ -85,53 +85,52 @@ class InternetService : public QObject { void ExitFinished(); void RequestLogin(); void RequestLogout(); - void LoginWithCredentials(QString api_token, QString username, QString password); - void LoginWithHostname(QString hostname, int, QString username, QString password); + void LoginWithCredentials(const QString &api_token, const QString &username, const QString &password); void LoginSuccess(); - void LoginFailure(QString failure_reason); - void LoginComplete(bool success, QString error = QString()); + void LoginFailure(const QString &failure_reason); + void LoginComplete(const bool success, const QString &error = QString()); void TestSuccess(); - void TestFailure(QString failure_reason); - void TestComplete(bool success, QString error = QString()); + void TestFailure(const QString &failure_reason); + void TestComplete(const bool success, const QString &error = QString()); - void Error(QString error); - void Results(SongMap songs, QString error); - void UpdateStatus(QString text); - void ProgressSetMaximum(int max); - void UpdateProgress(int max); + void Error(const QString &error); + void Results(const SongMap &songs, const QString &error); + void UpdateStatus(const QString &text); + void ProgressSetMaximum(const int max); + void UpdateProgress(const int max); - void ArtistsResults(SongMap songs, QString error); - void ArtistsUpdateStatus(QString text); - void ArtistsProgressSetMaximum(int max); - void ArtistsUpdateProgress(int max); + void ArtistsResults(const SongMap &songs, const QString &error); + void ArtistsUpdateStatus(const QString &text); + void ArtistsProgressSetMaximum(const int max); + void ArtistsUpdateProgress(const int max); - void AlbumsResults(SongMap songs, QString error); - void AlbumsUpdateStatus(QString text); - void AlbumsProgressSetMaximum(int max); - void AlbumsUpdateProgress(int max); + void AlbumsResults(const SongMap &songs, const QString &error); + void AlbumsUpdateStatus(const QString &text); + void AlbumsProgressSetMaximum(const int max); + void AlbumsUpdateProgress(const int max); - void SongsResults(SongMap songs, QString error); - void SongsUpdateStatus(QString text); - void SongsProgressSetMaximum(int max); - void SongsUpdateProgress(int max); + void SongsResults(const SongMap &songs, const QString &error); + void SongsUpdateStatus(const QString &text); + void SongsProgressSetMaximum(const int max); + void SongsUpdateProgress(const int max); - void SearchResults(int id, SongMap songs, QString error); - void SearchUpdateStatus(int id, QString text); - void SearchProgressSetMaximum(int id, int max); - void SearchUpdateProgress(int id, int max); + void SearchResults(const int id, const SongMap &songs, const QString &error); + void SearchUpdateStatus(const int id, const QString &text); + void SearchProgressSetMaximum(const int id, const int max); + void SearchUpdateProgress(const int id, const int max); - void AddArtists(SongList songs); - void AddAlbums(SongList songs); - void AddSongs(SongList songs); + void AddArtists(const SongList &songs); + void AddAlbums(const SongList &songs); + void AddSongs(const SongList &songs); - void RemoveArtists(SongList songs); - void RemoveAlbums(SongList songs); - void RemoveSongsByList(SongList songs); - void RemoveSongsByMap(SongMap songs); + void RemoveArtists(const SongList &songs); + void RemoveAlbums(const SongList &songs); + void RemoveSongsByList(const SongList &songs); + void RemoveSongsByMap(const SongMap &songs); - void StreamURLFailure(uint id, QUrl original_url, QString error); - void StreamURLSuccess(uint id, QUrl original_url, QUrl stream_url, Song::FileType filetype, int samplerate, int bit_depth, qint64 duration); + void StreamURLFailure(const uint id, const QUrl &original_url, const QString &error); + void StreamURLSuccess(const uint id, const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration); protected: Application *app_; diff --git a/src/lyrics/lyricsfetcher.h b/src/lyrics/lyricsfetcher.h index df8804341..098c6f5d4 100644 --- a/src/lyrics/lyricsfetcher.h +++ b/src/lyrics/lyricsfetcher.h @@ -59,8 +59,8 @@ class LyricsFetcher : public QObject { void AddRequest(const Request &request); signals: - void LyricsFetched(quint64 request_id, QString provider, QString lyrics); - void SearchFinished(quint64 request_id, LyricsSearchResults results); + void LyricsFetched(const quint64 request_id, const QString &provider, const QString &lyrics); + void SearchFinished(const quint64 request_id, const LyricsSearchResults &results); private slots: void SingleSearchFinished(const quint64 request_id, const LyricsSearchResults &results); diff --git a/src/lyrics/lyricsfetchersearch.h b/src/lyrics/lyricsfetchersearch.h index b88cda355..73d611e57 100644 --- a/src/lyrics/lyricsfetchersearch.h +++ b/src/lyrics/lyricsfetchersearch.h @@ -44,8 +44,8 @@ class LyricsFetcherSearch : public QObject { void Cancel(); signals: - void SearchFinished(quint64, LyricsSearchResults results); - void LyricsFetched(quint64, QString provider, QString lyrics); + void SearchFinished(const quint64 id, const LyricsSearchResults &results); + void LyricsFetched(const quint64 id, const QString &provider, const QString &lyrics); private slots: void ProviderSearchFinished(const int id, const LyricsSearchResults &results); diff --git a/src/lyrics/lyricsprovider.h b/src/lyrics/lyricsprovider.h index ac9b5ebc4..57e56821d 100644 --- a/src/lyrics/lyricsprovider.h +++ b/src/lyrics/lyricsprovider.h @@ -60,10 +60,10 @@ class LyricsProvider : public QObject { QString ParseLyricsFromHTML(const QString &content, const QRegularExpression &start_tag, const QRegularExpression &end_tag, const QRegularExpression &lyrics_start, const bool multiple); signals: - void AuthenticationComplete(bool, QStringList = QStringList()); + void AuthenticationComplete(const bool success, const QStringList &errors = QStringList()); void AuthenticationSuccess(); - void AuthenticationFailure(QStringList); - void SearchFinished(int id, LyricsSearchResults results = LyricsSearchResults()); + void AuthenticationFailure(const QStringList &errors); + void SearchFinished(const int id, const LyricsSearchResults &results = LyricsSearchResults()); protected: NetworkAccessManager *network_; diff --git a/src/moodbar/moodbarcontroller.h b/src/moodbar/moodbarcontroller.h index 5494ea94c..c5fc2c3cd 100644 --- a/src/moodbar/moodbarcontroller.h +++ b/src/moodbar/moodbarcontroller.h @@ -36,7 +36,7 @@ class MoodbarController : public QObject { void ReloadSettings(); signals: - void CurrentMoodbarDataChanged(QByteArray data); + void CurrentMoodbarDataChanged(const QByteArray &data); private slots: void CurrentSongChanged(const Song &song); diff --git a/src/moodbar/moodbarpipeline.h b/src/moodbar/moodbarpipeline.h index 3f29dba10..e55f116be 100644 --- a/src/moodbar/moodbarpipeline.h +++ b/src/moodbar/moodbarpipeline.h @@ -47,7 +47,7 @@ class MoodbarPipeline : public QObject { void Start(); signals: - void Finished(bool success); + void Finished(const bool success); private: GstElement *CreateElement(const QString &factory_name); diff --git a/src/musicbrainz/acoustidclient.h b/src/musicbrainz/acoustidclient.h index d685271d1..8c20656c2 100644 --- a/src/musicbrainz/acoustidclient.h +++ b/src/musicbrainz/acoustidclient.h @@ -59,7 +59,7 @@ class AcoustidClient : public QObject { void CancelAll(); signals: - void Finished(int id, QStringList mbid_list, QString error = QString()); + void Finished(const int id, const QStringList &mbid_list, const QString &error = QString()); private slots: void RequestFinished(QNetworkReply *reply, const int id); diff --git a/src/musicbrainz/musicbrainzclient.h b/src/musicbrainz/musicbrainzclient.h index ce0598947..b3deceba8 100644 --- a/src/musicbrainz/musicbrainzclient.h +++ b/src/musicbrainz/musicbrainzclient.h @@ -101,9 +101,9 @@ class MusicBrainzClient : public QObject { signals: // Finished signal emitted when fechting songs tags - void Finished(int id, MusicBrainzClient::ResultList result, QString error = QString()); + void Finished(const int id, const MusicBrainzClient::ResultList &result, const QString &error = QString()); // Finished signal emitted when fechting album's songs tags using DiscId - void DiscIdFinished(QString artist, QString album, MusicBrainzClient::ResultList result, QString error = QString()); + void DiscIdFinished(const QString &artist, const QString &album, const MusicBrainzClient::ResultList &result, const QString &error = QString()); private slots: void FlushRequests(); diff --git a/src/musicbrainz/tagfetcher.h b/src/musicbrainz/tagfetcher.h index 77d5a18ea..b4c15179a 100644 --- a/src/musicbrainz/tagfetcher.h +++ b/src/musicbrainz/tagfetcher.h @@ -48,8 +48,8 @@ class TagFetcher : public QObject { void Cancel(); signals: - void Progress(Song original_song, QString stage); - void ResultAvailable(Song original_song, SongList songs_guessed, QString error = QString()); + void Progress(const Song &original_song, const QString &stage); + void ResultAvailable(const Song &original_song, const SongList &songs_guessed, const QString &error = QString()); private slots: void FingerprintFound(const int index); diff --git a/src/organize/organize.h b/src/organize/organize.h index 4998da20b..7c468c01c 100644 --- a/src/organize/organize.h +++ b/src/organize/organize.h @@ -74,9 +74,9 @@ class Organize : public QObject { void Start(); signals: - void Finished(QStringList files_with_errors, QStringList); - void FileCopied(int database_id); - void SongPathChanged(Song song, QFileInfo new_file, std::optional new_collection_directory_id); + void Finished(const QStringList &files_with_errors, const QStringList&); + void FileCopied(const int database_id); + void SongPathChanged(const Song &song, const QFileInfo &new_file, const std::optional new_collection_directory_id); protected: void timerEvent(QTimerEvent *e) override; diff --git a/src/organize/organizedialog.h b/src/organize/organizedialog.h index f430ff448..fcbb0b3a6 100644 --- a/src/organize/organizedialog.h +++ b/src/organize/organizedialog.h @@ -87,7 +87,7 @@ class OrganizeDialog : public QDialog { void SetLoadingSongs(const bool loading); signals: - void FileCopied(int); + void FileCopied(const int); public slots: void accept() override; diff --git a/src/playlist/playlist.h b/src/playlist/playlist.h index fb47be3b9..942061d6d 100644 --- a/src/playlist/playlist.h +++ b/src/playlist/playlist.h @@ -325,11 +325,11 @@ class Playlist : public QAbstractListModel { signals: void RestoreFinished(); void PlaylistLoaded(); - void CurrentSongChanged(Song metadata); - void SongMetadataChanged(Song metadata); - void EditingFinished(const int playlist_id, QModelIndex idx); - void PlayRequested(QModelIndex idx, Playlist::AutoScroll autoscroll); - void MaybeAutoscroll(Playlist::AutoScroll autoscroll); + void CurrentSongChanged(const Song &metadata); + void SongMetadataChanged(const Song &metadata); + void EditingFinished(const int playlist_id, const QModelIndex idx); + void PlayRequested(const QModelIndex idx, const Playlist::AutoScroll autoscroll); + void MaybeAutoscroll(const Playlist::AutoScroll autoscroll); // Signals that the underlying list of items was changed, meaning that something was added to it, removed from it or the ordering changed. void PlaylistChanged(); diff --git a/src/playlist/playlistcontainer.h b/src/playlist/playlistcontainer.h index eacab4391..96793b5f4 100644 --- a/src/playlist/playlistcontainer.h +++ b/src/playlist/playlistcontainer.h @@ -65,8 +65,8 @@ class PlaylistContainer : public QWidget { bool eventFilter(QObject *objectWatched, QEvent *event) override; signals: - void TabChanged(int id); - void Rename(int id, QString new_name); + void TabChanged(const int id); + void Rename(const int id, const QString &new_name); void UndoRedoActionsChanged(QAction *undo, QAction *redo); void ViewSelectionModelChanged(); diff --git a/src/playlist/playlistheader.h b/src/playlist/playlistheader.h index 18c506807..42e482df7 100644 --- a/src/playlist/playlistheader.h +++ b/src/playlist/playlistheader.h @@ -53,9 +53,9 @@ class PlaylistHeader : public StretchHeaderView { #endif signals: - void SectionVisibilityChanged(int logical, bool visible); + void SectionVisibilityChanged(const int logical, const bool visible); void MouseEntered(); - void SectionRatingLockStatusChanged(bool); + void SectionRatingLockStatusChanged(const bool); private slots: void HideCurrent(); diff --git a/src/playlist/playlistlistmodel.h b/src/playlist/playlistlistmodel.h index 02e58ba81..0e21e0aad 100644 --- a/src/playlist/playlistlistmodel.h +++ b/src/playlist/playlistlistmodel.h @@ -81,8 +81,8 @@ class PlaylistListModel : public QStandardItemModel { bool setData(const QModelIndex &idx, const QVariant &value, int role) override; signals: - void PlaylistPathChanged(int id, QString new_path); - void PlaylistRenamed(int id, QString new_name); + void PlaylistPathChanged(const int id, const QString &new_path); + void PlaylistRenamed(const int id, const QString &new_name); private slots: void RowsChanged(const QModelIndex &begin, const QModelIndex &end); diff --git a/src/playlist/playlistlistview.h b/src/playlist/playlistlistview.h index f8c7fce9f..ba768f840 100644 --- a/src/playlist/playlistlistview.h +++ b/src/playlist/playlistlistview.h @@ -41,7 +41,7 @@ class PlaylistListView : public AutoExpandingTreeView { bool ItemsSelected() const; signals: - void ItemsSelectedChanged(bool); + void ItemsSelectedChanged(const bool); protected: // QWidget diff --git a/src/playlist/playlistmanager.h b/src/playlist/playlistmanager.h index bb0271389..5642efc65 100644 --- a/src/playlist/playlistmanager.h +++ b/src/playlist/playlistmanager.h @@ -117,25 +117,25 @@ class PlaylistManagerInterface : public QObject { void PlaylistManagerInitialized(); void AllPlaylistsLoaded(); - void PlaylistAdded(int id, QString name, bool favorite); - void PlaylistDeleted(int id); - void PlaylistClosed(int id); - void PlaylistRenamed(int id, QString new_name); - void PlaylistFavorited(int id, bool favorite); - void CurrentChanged(Playlist *new_playlist, int scroll_position = 0); + void PlaylistAdded(const int id, const QString &name, const bool favorite); + void PlaylistDeleted(const int id); + void PlaylistClosed(const int id); + void PlaylistRenamed(const int id, const QString &new_name); + void PlaylistFavorited(const int id, const bool favorite); + void CurrentChanged(Playlist *new_playlist, const int scroll_position = 0); void ActiveChanged(Playlist *new_playlist); - void Error(QString message); - void SummaryTextChanged(QString summary); + void Error(const QString &message); + void SummaryTextChanged(const QString &summary); // Forwarded from individual playlists - void CurrentSongChanged(Song song); - void SongMetadataChanged(Song song); + void CurrentSongChanged(const Song &song); + void SongMetadataChanged(const Song &song); // Signals that one of manager's playlists has changed (new items, new ordering etc.) - the argument shows which. void PlaylistChanged(Playlist *playlist); - void EditingFinished(int playlist_id, QModelIndex idx); - void PlayRequested(QModelIndex idx, Playlist::AutoScroll autoscroll); + void EditingFinished(const int playlist_id, const QModelIndex idx); + void PlayRequested(const QModelIndex idx, const Playlist::AutoScroll autoscroll); }; class PlaylistManager : public PlaylistManagerInterface { diff --git a/src/playlist/playlistsequence.h b/src/playlist/playlistsequence.h index a20735ccb..65a2ce437 100644 --- a/src/playlist/playlistsequence.h +++ b/src/playlist/playlistsequence.h @@ -77,8 +77,8 @@ class PlaylistSequence : public QWidget { void CycleRepeatMode(); signals: - void RepeatModeChanged(PlaylistSequence::RepeatMode mode); - void ShuffleModeChanged(PlaylistSequence::ShuffleMode mode); + void RepeatModeChanged(const PlaylistSequence::RepeatMode mode); + void ShuffleModeChanged(const PlaylistSequence::ShuffleMode mode); private slots: void RepeatActionTriggered(QAction *action); diff --git a/src/playlist/playlisttabbar.h b/src/playlist/playlisttabbar.h index 11617f47b..e297e34b1 100644 --- a/src/playlist/playlisttabbar.h +++ b/src/playlist/playlisttabbar.h @@ -72,12 +72,12 @@ class PlaylistTabBar : public QTabBar { void InsertTab(const int id, const int index, const QString &text, const bool favorite); signals: - void CurrentIdChanged(int id); - void Rename(int id, QString name); - void Close(int id); - void Save(int id); - void PlaylistOrderChanged(QList ids); - void PlaylistFavorited(int id, bool favorite); + void CurrentIdChanged(const int id); + void Rename(const int id, const QString &name); + void Close(const int id); + void Save(const int id); + void PlaylistOrderChanged(const QList &ids); + void PlaylistFavorited(const int id, const bool favorite); protected: void contextMenuEvent(QContextMenuEvent *e) override; diff --git a/src/playlist/playlistview.h b/src/playlist/playlistview.h index f0aebfc20..916cac76d 100644 --- a/src/playlist/playlistview.h +++ b/src/playlist/playlistview.h @@ -127,14 +127,14 @@ class PlaylistView : public QTreeView { void edit(const QModelIndex &idx) { QAbstractItemView::edit(idx); } signals: - void PlayItem(QModelIndex idx, Playlist::AutoScroll autoscroll); - void PlayPause(const quint64 offset_nanosec = 0, Playlist::AutoScroll autoscroll = Playlist::AutoScroll::Never); - void RightClicked(QPoint global_pos, QModelIndex idx); + void PlayItem(const QModelIndex idx, const Playlist::AutoScroll autoscroll); + void PlayPause(const quint64 offset_nanosec = 0, const Playlist::AutoScroll autoscroll = Playlist::AutoScroll::Never); + void RightClicked(const QPoint global_pos, const QModelIndex idx); void SeekForward(); void SeekBackward(); void FocusOnFilterSignal(QKeyEvent *event); void BackgroundPropertyChanged(); - void ColumnAlignmentChanged(ColumnAlignmentMap alignment); + void ColumnAlignmentChanged(const ColumnAlignmentMap alignment); protected: // QWidget diff --git a/src/playlist/songloaderinserter.h b/src/playlist/songloaderinserter.h index 7515f9117..80c44f90a 100644 --- a/src/playlist/songloaderinserter.h +++ b/src/playlist/songloaderinserter.h @@ -48,9 +48,9 @@ class SongLoaderInserter : public QObject { void LoadAudioCD(Playlist *destination, int row, bool play_now, bool enqueue, bool enqueue_next); signals: - void Error(QString message); + void Error(const QString &message); void PreloadFinished(); - void EffectiveLoadFinished(SongList songs); + void EffectiveLoadFinished(const SongList &songs); private slots: void DestinationDestroyed(); diff --git a/src/qobuz/qobuzfavoriterequest.h b/src/qobuz/qobuzfavoriterequest.h index c7f49fd96..50287fa9b 100644 --- a/src/qobuz/qobuzfavoriterequest.h +++ b/src/qobuz/qobuzfavoriterequest.h @@ -49,12 +49,12 @@ class QobuzFavoriteRequest : public QobuzBaseRequest { }; signals: - void ArtistsAdded(SongList); - void AlbumsAdded(SongList); - void SongsAdded(SongList); - void ArtistsRemoved(SongList); - void AlbumsRemoved(SongList); - void SongsRemoved(SongList); + void ArtistsAdded(const SongList &songs); + void AlbumsAdded(const SongList &songs); + void SongsAdded(const SongList &songs); + void ArtistsRemoved(const SongList &songs); + void AlbumsRemoved(const SongList &songs); + void SongsRemoved(const SongList &songs); private slots: void AddFavoritesReply(QNetworkReply *reply, const QobuzFavoriteRequest::FavoriteType type, const SongList &songs); diff --git a/src/qobuz/qobuzrequest.h b/src/qobuz/qobuzrequest.h index a419ec048..7e53e17d1 100644 --- a/src/qobuz/qobuzrequest.h +++ b/src/qobuz/qobuzrequest.h @@ -99,11 +99,11 @@ class QobuzRequest : public QobuzBaseRequest { signals: void LoginSuccess(); - void LoginFailure(QString failure_reason); - void Results(int id, SongMap songs, QString error); - void UpdateStatus(int id, QString text); - void UpdateProgress(int id, int max); - void StreamURLFinished(QUrl original_url, QUrl url, Song::FileType, QString error = QString()); + void LoginFailure(const QString &failure_reason); + void Results(const int id, const SongMap &songs, const QString &error); + void UpdateStatus(const int id, const QString &text); + void UpdateProgress(const int id, const int max); + void StreamURLFinished(const QUrl &original_url, const QUrl &url, const Song::FileType filetype, const QString &error = QString()); private slots: void ArtistsReplyReceived(QNetworkReply *reply, const int limit_requested, const int offset_requested); diff --git a/src/qobuz/qobuzstreamurlrequest.h b/src/qobuz/qobuzstreamurlrequest.h index 0d9dcd747..17237d3d8 100644 --- a/src/qobuz/qobuzstreamurlrequest.h +++ b/src/qobuz/qobuzstreamurlrequest.h @@ -54,8 +54,8 @@ class QobuzStreamURLRequest : public QobuzBaseRequest { signals: void TryLogin(); - void StreamURLFailure(uint id, QUrl original_url, QString error); - void StreamURLSuccess(uint id, QUrl original_url, QUrl stream_url, Song::FileType filetype, int samplerate, int bit_depth, qint64 duration); + void StreamURLFailure(const uint id, const QUrl &original_url, const QString &error); + void StreamURLSuccess(const uint id, const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration); private slots: void StreamURLReceived(); diff --git a/src/queue/queue.h b/src/queue/queue.h index 226d42949..ba0a52cb1 100644 --- a/src/queue/queue.h +++ b/src/queue/queue.h @@ -83,9 +83,9 @@ class Queue : public QAbstractProxyModel { void UpdateSummaryText(); signals: - void TotalLengthChanged(quint64 length); - void ItemCountChanged(int count); - void SummaryTextChanged(QString message); + void TotalLengthChanged(const quint64 length); + void ItemCountChanged(const int count); + void SummaryTextChanged(const QString &message); private slots: void SourceDataChanged(const QModelIndex &top_left, const QModelIndex &bottom_right); diff --git a/src/radios/radiobackend.h b/src/radios/radiobackend.h index a37f36997..e8d373ea2 100644 --- a/src/radios/radiobackend.h +++ b/src/radios/radiobackend.h @@ -46,7 +46,7 @@ class RadioBackend : public QObject { void DeleteChannels(); signals: - void NewChannels(RadioChannelList); + void NewChannels(const RadioChannelList &channels); void ExitFinished(); private slots: diff --git a/src/radios/radioservice.h b/src/radios/radioservice.h index 922c76500..5e1cde936 100644 --- a/src/radios/radioservice.h +++ b/src/radios/radioservice.h @@ -52,7 +52,7 @@ class RadioService : public QObject { virtual QUrl Donate() = 0; signals: - void NewChannels(RadioChannelList channels = RadioChannelList()); + void NewChannels(const RadioChannelList &channels = RadioChannelList()); public slots: virtual void GetChannels() = 0; diff --git a/src/scrobbler/audioscrobbler.h b/src/scrobbler/audioscrobbler.h index 95f5d0c20..30e80063d 100644 --- a/src/scrobbler/audioscrobbler.h +++ b/src/scrobbler/audioscrobbler.h @@ -71,11 +71,11 @@ class AudioScrobbler : public QObject { void ErrorReceived(const QString &error); signals: - void ErrorMessage(QString); - void ScrobblingEnabledChanged(bool value); - void ScrobblingOfflineChanged(bool value); - void ScrobbleButtonVisibilityChanged(bool value); - void LoveButtonVisibilityChanged(bool value); + void ErrorMessage(const QString &error); + void ScrobblingEnabledChanged(const bool value); + void ScrobblingOfflineChanged(const bool value); + void ScrobbleButtonVisibilityChanged(const bool value); + void LoveButtonVisibilityChanged(const bool value); private: Application *app_; diff --git a/src/scrobbler/lastfmimport.h b/src/scrobbler/lastfmimport.h index b6b7c64ec..ef636aad2 100644 --- a/src/scrobbler/lastfmimport.h +++ b/src/scrobbler/lastfmimport.h @@ -79,12 +79,12 @@ class LastFMImport : public QObject { void FinishCheck(); signals: - void UpdatePlayCount(QString, QString, int, bool = false); - void UpdateLastPlayed(QString, QString, QString, qint64); - void UpdateTotal(int, int); - void UpdateProgress(int, int); + void UpdatePlayCount(const QString&, const QString&, const int, const bool = false); + void UpdateLastPlayed(const QString&, const QString&, const QString&, const qint64); + void UpdateTotal(const int, const int); + void UpdateProgress(const int, const int); void Finished(); - void FinishedWithError(QString); + void FinishedWithError(const QString&); private slots: void FlushRequests(); diff --git a/src/scrobbler/listenbrainzscrobbler.h b/src/scrobbler/listenbrainzscrobbler.h index d02553f65..aee617229 100644 --- a/src/scrobbler/listenbrainzscrobbler.h +++ b/src/scrobbler/listenbrainzscrobbler.h @@ -72,7 +72,7 @@ class ListenBrainzScrobbler : public ScrobblerService { void Love() override; signals: - void AuthenticationComplete(bool success, QString error = QString()); + void AuthenticationComplete(const bool success, const QString &error = QString()); public slots: void WriteCache() override { cache_->WriteCache(); } diff --git a/src/scrobbler/scrobblerservice.h b/src/scrobbler/scrobblerservice.h index 91a421350..cbfc23f1a 100644 --- a/src/scrobbler/scrobblerservice.h +++ b/src/scrobbler/scrobblerservice.h @@ -72,7 +72,7 @@ class ScrobblerService : public QObject { virtual void WriteCache() = 0; signals: - void ErrorMessage(QString); + void ErrorMessage(const QString &error); private: QString name_; diff --git a/src/scrobbler/scrobblingapi20.h b/src/scrobbler/scrobblingapi20.h index 0b2f298d6..36716fd3a 100644 --- a/src/scrobbler/scrobblingapi20.h +++ b/src/scrobbler/scrobblingapi20.h @@ -70,7 +70,7 @@ class ScrobblingAPI20 : public ScrobblerService { void Love() override; signals: - void AuthenticationComplete(bool success, QString error = QString()); + void AuthenticationComplete(const bool success, const QString &error = QString()); public slots: void WriteCache() override { cache_->WriteCache(); } diff --git a/src/settings/qobuzsettingspage.h b/src/settings/qobuzsettingspage.h index 6e160b3ce..c3cd88dd0 100644 --- a/src/settings/qobuzsettingspage.h +++ b/src/settings/qobuzsettingspage.h @@ -45,7 +45,7 @@ class QobuzSettingsPage : public SettingsPage { bool eventFilter(QObject *object, QEvent *event) override; signals: - void Login(QString username, QString password, QString token); + void Login(const QString &username, const QString &password, const QString &token); private slots: void LoginClicked(); diff --git a/src/settings/settingsdialog.h b/src/settings/settingsdialog.h index d95ffdb94..8c34cbfe0 100644 --- a/src/settings/settingsdialog.h +++ b/src/settings/settingsdialog.h @@ -139,7 +139,7 @@ class SettingsDialog : public QDialog { signals: void ReloadSettings(); - void NotificationPreview(OSDBase::Behaviour, QString, QString); + void NotificationPreview(const OSDBase::Behaviour, const QString&, const QString&); private slots: void CurrentItemChanged(QTreeWidgetItem *item); diff --git a/src/settings/settingspage.h b/src/settings/settingspage.h index c0d2652d1..aa6aea967 100644 --- a/src/settings/settingspage.h +++ b/src/settings/settingspage.h @@ -76,7 +76,7 @@ class SettingsPage : public QWidget { virtual void Cancel() {} signals: - void NotificationPreview(OSDBase::Behaviour, QString, QString); + void NotificationPreview(const OSDBase::Behaviour, const QString&, const QString&); private: SettingsDialog *dialog_; diff --git a/src/settings/subsonicsettingspage.h b/src/settings/subsonicsettingspage.h index b95ae636b..f27278715 100644 --- a/src/settings/subsonicsettingspage.h +++ b/src/settings/subsonicsettingspage.h @@ -53,7 +53,7 @@ class SubsonicSettingsPage : public SettingsPage { bool eventFilter(QObject *object, QEvent *event) override; signals: - void Test(QUrl url, QString username, QString password, SubsonicSettingsPage::AuthMethod auth_method, bool redirect = false); + void Test(const QUrl &url, const QString &username, const QString &password, const SubsonicSettingsPage::AuthMethod auth_method, const bool redirect = false); private slots: void TestClicked(); diff --git a/src/settings/tidalsettingspage.h b/src/settings/tidalsettingspage.h index a979c11a1..04818d486 100644 --- a/src/settings/tidalsettingspage.h +++ b/src/settings/tidalsettingspage.h @@ -53,8 +53,8 @@ class TidalSettingsPage : public SettingsPage { bool eventFilter(QObject *object, QEvent *event) override; signals: - void Authorize(QString client_id); - void Login(QString api_token, QString username, QString password); + void Authorize(const QString &client_id); + void Login(const QString &api_token, const QString &username, const QString &password); private slots: void OAuthClicked(const bool enabled); diff --git a/src/smartplaylists/playlistgenerator.h b/src/smartplaylists/playlistgenerator.h index 489b38073..c9d1c0317 100644 --- a/src/smartplaylists/playlistgenerator.h +++ b/src/smartplaylists/playlistgenerator.h @@ -85,7 +85,7 @@ class PlaylistGenerator : public QObject, public std::enable_shared_from_this urls); - void MoveToCollection(QList urls); - void CopyToDevice(QList urls); - void EditTags(QList urls); + void CopyToCollection(const QList &urls); + void MoveToCollection(const QList &urls); + void CopyToDevice(const QList &urls); + void EditTags(const QList &urls); private slots: void FileUp(); diff --git a/src/widgets/fileviewlist.h b/src/widgets/fileviewlist.h index 925ca9728..13d2bd118 100644 --- a/src/widgets/fileviewlist.h +++ b/src/widgets/fileviewlist.h @@ -47,11 +47,11 @@ class FileViewList : public QListView { signals: void AddToPlaylist(QMimeData *data); - void CopyToCollection(QList urls); - void MoveToCollection(QList urls); - void CopyToDevice(QList urls); - void Delete(QStringList filenames); - void EditTags(QList urls); + void CopyToCollection(const QList &urls); + void MoveToCollection(const QList &urls); + void CopyToDevice(const QList &urls); + void Delete(const QStringList &filenames); + void EditTags(const QList &urls); void Back(); void Forward(); diff --git a/src/widgets/multiloadingindicator.h b/src/widgets/multiloadingindicator.h index ccd1ea711..558b61fed 100644 --- a/src/widgets/multiloadingindicator.h +++ b/src/widgets/multiloadingindicator.h @@ -46,7 +46,7 @@ class MultiLoadingIndicator : public QWidget { QSize sizeHint() const override; signals: - void TaskCountChange(int tasks); + void TaskCountChange(const int tasks); protected: void paintEvent(QPaintEvent*) override; diff --git a/src/widgets/playingwidget.h b/src/widgets/playingwidget.h index 462f4b0c9..8d0201926 100644 --- a/src/widgets/playingwidget.h +++ b/src/widgets/playingwidget.h @@ -68,7 +68,7 @@ class PlayingWidget : public QWidget { bool show_above_status_bar() const { return above_statusbar_action_->isChecked(); } signals: - void ShowAboveStatusBarChanged(bool above); + void ShowAboveStatusBarChanged(const bool above); public slots: void Playing(); diff --git a/src/widgets/qsearchfield.h b/src/widgets/qsearchfield.h index 3c1b9bc36..6a9bc8441 100644 --- a/src/widgets/qsearchfield.h +++ b/src/widgets/qsearchfield.h @@ -36,7 +36,7 @@ class QSearchField : public QWidget { void setFocus(); signals: - void textChanged(QString text); + void textChanged(const QString &text); void editingFinished(); void returnPressed(); diff --git a/src/widgets/ratingwidget.h b/src/widgets/ratingwidget.h index 73f441c6a..e63bcb9a1 100644 --- a/src/widgets/ratingwidget.h +++ b/src/widgets/ratingwidget.h @@ -55,7 +55,7 @@ class RatingWidget : public QWidget { void set_rating(const float rating); signals: - void RatingChanged(float); + void RatingChanged(const float rating); protected: void paintEvent(QPaintEvent*) override; diff --git a/src/widgets/sliderslider.h b/src/widgets/sliderslider.h index 663b91838..fc33fb5e7 100644 --- a/src/widgets/sliderslider.h +++ b/src/widgets/sliderslider.h @@ -42,7 +42,7 @@ class SliderSlider : public QSlider { signals: // We emit this when the user has specifically changed the slider so connect to it if valueChanged() is too generic Qt also emits valueChanged(int) - void SliderReleased(int); + void SliderReleased(const int); protected: virtual void slideEvent(QMouseEvent*); diff --git a/src/widgets/stretchheaderview.h b/src/widgets/stretchheaderview.h index 9100258e0..19b46b8c5 100644 --- a/src/widgets/stretchheaderview.h +++ b/src/widgets/stretchheaderview.h @@ -76,7 +76,7 @@ class StretchHeaderView : public QHeaderView { signals: // Emitted when the stretch mode is changed. - void StretchEnabledChanged(bool enabled); + void StretchEnabledChanged(const bool enabled); protected: // QWidget diff --git a/src/widgets/trackslider.h b/src/widgets/trackslider.h index c8b999402..a435d564e 100644 --- a/src/widgets/trackslider.h +++ b/src/widgets/trackslider.h @@ -65,8 +65,8 @@ class TrackSlider : public QWidget { void Seek(const int gap); signals: - void ValueChanged(int value); - void ValueChangedSeconds(quint64 value); + void ValueChanged(const int value); + void ValueChangedSeconds(const quint64 value); void SeekForward(); void SeekBackward();