diff --git a/ext/gstmoodbar/gstfastspectrum.h b/ext/gstmoodbar/gstfastspectrum.h index 41df6b9c..7de68809 100644 --- a/ext/gstmoodbar/gstfastspectrum.h +++ b/ext/gstmoodbar/gstfastspectrum.h @@ -47,7 +47,7 @@ class QMutex; typedef void (*GstFastSpectrumInputData)(const guint8 *in, double *out, guint len, double max_value, guint op, guint nfft); -typedef std::function OutputCallback; +using OutputCallback = std::function; struct GstFastSpectrum { GstAudioFilter parent; diff --git a/ext/libstrawberry-common/core/messagehandler.h b/ext/libstrawberry-common/core/messagehandler.h index 8e18c137..0791dee4 100644 --- a/ext/libstrawberry-common/core/messagehandler.h +++ b/ext/libstrawberry-common/core/messagehandler.h @@ -82,8 +82,8 @@ class AbstractMessageHandler : public _MessageHandlerBase { AbstractMessageHandler(QIODevice *device, QObject *parent); ~AbstractMessageHandler() override { AbstractMessageHandler::AbortAll(); } - typedef MT MessageType; - typedef MessageReply ReplyType; + using MessageType = MT; + using ReplyType = MessageReply; // Serialises the message and writes it to the socket. // This version MUST be called from the thread in which the AbstractMessageHandler was created. diff --git a/ext/libstrawberry-common/core/workerpool.h b/ext/libstrawberry-common/core/workerpool.h index f12d0399..2ca1b407 100644 --- a/ext/libstrawberry-common/core/workerpool.h +++ b/ext/libstrawberry-common/core/workerpool.h @@ -76,8 +76,8 @@ class WorkerPool : public _WorkerPoolBase { explicit WorkerPool(QObject *parent = nullptr); ~WorkerPool() override; - typedef typename HandlerType::MessageType MessageType; - typedef typename HandlerType::ReplyType ReplyType; + using MessageType = typename HandlerType::MessageType; + using ReplyType = typename HandlerType::ReplyType; // Sets the name of the worker executable. This is looked for first in the current directory, and then in $PATH. // You must call this before calling Start(). diff --git a/src/analyzer/analyzerbase.h b/src/analyzer/analyzerbase.h index ebea39b6..79739b4e 100644 --- a/src/analyzer/analyzerbase.h +++ b/src/analyzer/analyzerbase.h @@ -49,7 +49,7 @@ class QTimerEvent; namespace Analyzer { -typedef std::vector Scope; +using Scope = std::vector; class Base : public QWidget { Q_OBJECT diff --git a/src/collection/collectionbackend.h b/src/collection/collectionbackend.h index b6b4ff67..eaa8a4e0 100644 --- a/src/collection/collectionbackend.h +++ b/src/collection/collectionbackend.h @@ -72,7 +72,7 @@ class CollectionBackendInterface : public QObject { Song::FileType filetype; QString cue_path; }; - typedef QList AlbumList; + using AlbumList = QList; virtual QString songs_table() const = 0; virtual QString fts_table() const = 0; diff --git a/src/collection/collectionmodel.h b/src/collection/collectionmodel.h index f640171f..2d38a579 100644 --- a/src/collection/collectionmodel.h +++ b/src/collection/collectionmodel.h @@ -308,7 +308,7 @@ class CollectionModel : public SimpleTreeModel { AlbumCoverLoaderOptions cover_loader_options_; - typedef QPair ItemAndCacheKey; + using ItemAndCacheKey = QPair; QMap pending_art_; QSet pending_cache_keys_; }; diff --git a/src/collection/directory.h b/src/collection/directory.h index e1e06e5b..7f3f8498 100644 --- a/src/collection/directory.h +++ b/src/collection/directory.h @@ -40,7 +40,7 @@ struct Directory { }; Q_DECLARE_METATYPE(Directory) -typedef QList DirectoryList; +using DirectoryList = QList; Q_DECLARE_METATYPE(DirectoryList) @@ -53,7 +53,7 @@ struct Subdirectory { }; Q_DECLARE_METATYPE(Subdirectory) -typedef QList SubdirectoryList; +using SubdirectoryList = QList; Q_DECLARE_METATYPE(SubdirectoryList) #endif // DIRECTORY_H diff --git a/src/collection/groupbydialog.cpp b/src/collection/groupbydialog.cpp index e538e5e9..59e13c33 100644 --- a/src/collection/groupbydialog.cpp +++ b/src/collection/groupbydialog.cpp @@ -63,11 +63,7 @@ struct tag_group_by {}; class GroupByDialogPrivate { private: - typedef multi_index_container< - Mapping, - indexed_by< - ordered_unique, member >, - ordered_unique, member > > > MappingContainer; + using MappingContainer = multi_index_container, member>, ordered_unique, member>>>; public: MappingContainer mapping_; diff --git a/src/core/mergedproxymodel.cpp b/src/core/mergedproxymodel.cpp index 73c432b0..74d84920 100644 --- a/src/core/mergedproxymodel.cpp +++ b/src/core/mergedproxymodel.cpp @@ -71,13 +71,7 @@ struct tag_by_pointer {}; class MergedProxyModelPrivate { private: - typedef multi_index_container< - Mapping*, - indexed_by< - hashed_unique, - member >, - ordered_unique, identity > > > - MappingContainer; + using MappingContainer = multi_index_container, member>, ordered_unique, identity>>>; public: MappingContainer mappings_; diff --git a/src/core/mpris2.h b/src/core/mpris2.h index 505d51e9..27dcfaed 100644 --- a/src/core/mpris2.h +++ b/src/core/mpris2.h @@ -45,8 +45,8 @@ class Application; class Song; class Playlist; -typedef QList TrackMetadata; -typedef QList Track_Ids; +using TrackMetadata = QList; +using Track_Ids = QList; Q_DECLARE_METATYPE(TrackMetadata) struct MprisPlaylist { @@ -54,7 +54,7 @@ struct MprisPlaylist { QString name; QString icon; // Uri }; -typedef QList MprisPlaylistList; +using MprisPlaylistList = QList; Q_DECLARE_METATYPE(MprisPlaylist) Q_DECLARE_METATYPE(MprisPlaylistList) diff --git a/src/core/multisortfilterproxy.h b/src/core/multisortfilterproxy.h index d8d57d70..a5676a6f 100644 --- a/src/core/multisortfilterproxy.h +++ b/src/core/multisortfilterproxy.h @@ -44,7 +44,7 @@ class MultiSortFilterProxy : public QSortFilterProxyModel { private: int Compare(const QVariant &left, const QVariant &right) const; - typedef QPair SortSpec; + using SortSpec = QPair; QList sorting_; }; diff --git a/src/core/musicstorage.h b/src/core/musicstorage.h index 8a3592ae..75742f4b 100644 --- a/src/core/musicstorage.h +++ b/src/core/musicstorage.h @@ -55,7 +55,7 @@ class MusicStorage { Transcode_Unsupported = 3, }; - typedef std::function ProgressFunction; + using ProgressFunction = std::function; struct CopyJob { CopyJob() : overwrite_(false), remove_original_(false), albumcover_(false) {} diff --git a/src/core/scoped_cftyperef.h b/src/core/scoped_cftyperef.h index 4f207ae2..0506b5ae 100644 --- a/src/core/scoped_cftyperef.h +++ b/src/core/scoped_cftyperef.h @@ -20,7 +20,7 @@ template class ScopedCFTypeRef { public: - typedef CFT element_type; + using element_type = CFT; explicit ScopedCFTypeRef(CFT object = nullptr) : object_(object) {} diff --git a/src/core/song.h b/src/core/song.h index 6af4e762..752d280a 100644 --- a/src/core/song.h +++ b/src/core/song.h @@ -405,8 +405,8 @@ class Song { QSharedDataPointer d; }; -typedef QList SongList; -typedef QMap SongMap; +using SongList = QList; +using SongMap = QMap; Q_DECLARE_METATYPE(Song) Q_DECLARE_METATYPE(SongList) diff --git a/src/core/sqlrow.h b/src/core/sqlrow.h index 97d0b505..6db2f9e9 100644 --- a/src/core/sqlrow.h +++ b/src/core/sqlrow.h @@ -53,6 +53,6 @@ class SqlRow { }; -typedef QList SqlRowList; +using SqlRowList = QList; #endif // SQLROW_H diff --git a/src/core/tagreaderclient.h b/src/core/tagreaderclient.h index 36ae4dba..60b85457 100644 --- a/src/core/tagreaderclient.h +++ b/src/core/tagreaderclient.h @@ -45,8 +45,8 @@ class TagReaderClient : public QObject { public: explicit TagReaderClient(QObject *parent = nullptr); - typedef AbstractMessageHandler HandlerType; - typedef HandlerType::ReplyType ReplyType; + using HandlerType = AbstractMessageHandler; + using ReplyType = HandlerType::ReplyType; static const char *kWorkerExecutableName; @@ -94,6 +94,6 @@ class TagReaderClient : public QObject { QThread *original_thread_; }; -typedef TagReaderClient::ReplyType TagReaderReply; +using TagReaderReply = TagReaderClient::ReplyType; #endif // TAGREADERCLIENT_H diff --git a/src/covermanager/albumcoverfetcher.h b/src/covermanager/albumcoverfetcher.h index 99611f59..685b8f15 100644 --- a/src/covermanager/albumcoverfetcher.h +++ b/src/covermanager/albumcoverfetcher.h @@ -99,7 +99,7 @@ struct CoverProviderSearchResult { Q_DECLARE_METATYPE(CoverProviderSearchResult) // This is a complete result of a single search request (a list of results, each describing one image, actually). -typedef QList CoverProviderSearchResults; +using CoverProviderSearchResults = QList; Q_DECLARE_METATYPE(QList) // This class searches for album covers for a given query or artist/album and returns URLs. It's NOT thread-safe. diff --git a/src/covermanager/coverprovider.h b/src/covermanager/coverprovider.h index 3b50b1f1..537b6976 100644 --- a/src/covermanager/coverprovider.h +++ b/src/covermanager/coverprovider.h @@ -75,6 +75,9 @@ class CoverProvider : public QObject { void SearchFinished(int, CoverProviderSearchResults); protected: + using Param = QPair; + using ParamList = QList; + Application *app_; NetworkAccessManager *network_; QString name_; diff --git a/src/covermanager/deezercoverprovider.cpp b/src/covermanager/deezercoverprovider.cpp index 94058c6f..f73e4df5 100644 --- a/src/covermanager/deezercoverprovider.cpp +++ b/src/covermanager/deezercoverprovider.cpp @@ -66,9 +66,6 @@ DeezerCoverProvider::~DeezerCoverProvider() { bool DeezerCoverProvider::StartSearch(const QString &artist, const QString &album, const QString &title, const int id) { - typedef QPair Param; - typedef QList Params; - if (artist.isEmpty() && album.isEmpty() && title.isEmpty()) return false; QString resource; @@ -86,9 +83,9 @@ bool DeezerCoverProvider::StartSearch(const QString &artist, const QString &albu } } - const Params params = Params() << Param("output", "json") - << Param("q", query) - << Param("limit", QString::number(kLimit)); + const ParamList params = ParamList() << Param("output", "json") + << Param("q", query) + << Param("limit", QString::number(kLimit)); QUrlQuery url_query; for (const Param ¶m : params) { diff --git a/src/covermanager/discogscoverprovider.cpp b/src/covermanager/discogscoverprovider.cpp index 757a285e..78b86a5b 100644 --- a/src/covermanager/discogscoverprovider.cpp +++ b/src/covermanager/discogscoverprovider.cpp @@ -151,7 +151,7 @@ QNetworkReply *DiscogsCoverProvider::CreateRequest(QUrl url, const ParamList &pa QStringList query_items; // Encode the arguments - typedef QPair EncodedParam; + using EncodedParam = QPair; for (const Param ¶m : params) { EncodedParam encoded_param(QUrl::toPercentEncoding(param.first), QUrl::toPercentEncoding(param.second)); query_items << QString(encoded_param.first + "=" + encoded_param.second); diff --git a/src/covermanager/discogscoverprovider.h b/src/covermanager/discogscoverprovider.h index 54dd56b2..90279900 100644 --- a/src/covermanager/discogscoverprovider.h +++ b/src/covermanager/discogscoverprovider.h @@ -77,9 +77,6 @@ class DiscogsCoverProvider : public JsonCoverProvider { }; private: - typedef QPair Param; - typedef QList ParamList; - void SendSearchRequest(std::shared_ptr search); void SendReleaseRequest(const DiscogsCoverReleaseContext &release); QNetworkReply *CreateRequest(QUrl url, const ParamList ¶ms_provided = ParamList()); diff --git a/src/covermanager/lastfmcoverprovider.cpp b/src/covermanager/lastfmcoverprovider.cpp index 282ac9e1..7d0f306c 100644 --- a/src/covermanager/lastfmcoverprovider.cpp +++ b/src/covermanager/lastfmcoverprovider.cpp @@ -65,9 +65,6 @@ LastFmCoverProvider::~LastFmCoverProvider() { bool LastFmCoverProvider::StartSearch(const QString &artist, const QString &album, const QString &title, const int id) { - typedef QPair Param; - typedef QList ParamList; - if (artist.isEmpty() && album.isEmpty() && title.isEmpty()) return false; QString method; diff --git a/src/covermanager/qobuzcoverprovider.h b/src/covermanager/qobuzcoverprovider.h index 1fbb70b7..cf05ff31 100644 --- a/src/covermanager/qobuzcoverprovider.h +++ b/src/covermanager/qobuzcoverprovider.h @@ -59,9 +59,6 @@ class QobuzCoverProvider : public JsonCoverProvider { void Error(const QString &error, const QVariant &debug = QVariant()) override; private: - typedef QPair Param; - typedef QList ParamList; - static const int kLimit; QobuzService *service_; diff --git a/src/covermanager/spotifycoverprovider.h b/src/covermanager/spotifycoverprovider.h index 98782be2..c2e3a37f 100644 --- a/src/covermanager/spotifycoverprovider.h +++ b/src/covermanager/spotifycoverprovider.h @@ -69,9 +69,6 @@ class SpotifyCoverProvider : public JsonCoverProvider { void RequestAccessToken(const QString &code = QString(), const QUrl &redirect_url = QUrl()); private: - typedef QPair Param; - typedef QList ParamList; - static const char *kSettingsGroup; static const char *kClientIDB64; static const char *kClientSecretB64; diff --git a/src/covermanager/tidalcoverprovider.cpp b/src/covermanager/tidalcoverprovider.cpp index c61ac478..7bf7d707 100644 --- a/src/covermanager/tidalcoverprovider.cpp +++ b/src/covermanager/tidalcoverprovider.cpp @@ -63,9 +63,6 @@ TidalCoverProvider::~TidalCoverProvider() { bool TidalCoverProvider::StartSearch(const QString &artist, const QString &album, const QString &title, const int id) { - typedef QPair Param; - typedef QList ParamList; - if (!service_ || !service_->authenticated()) return false; if (artist.isEmpty() && album.isEmpty() && title.isEmpty()) return false; diff --git a/src/dbus/metatypes.h b/src/dbus/metatypes.h index 37e528b6..db6cb624 100644 --- a/src/dbus/metatypes.h +++ b/src/dbus/metatypes.h @@ -10,8 +10,8 @@ Q_DECLARE_METATYPE(QList) -typedef QMap InterfacesAndProperties; -typedef QMap ManagedObjectList; +using InterfacesAndProperties = QMap; +using ManagedObjectList = QMap; Q_DECLARE_METATYPE(InterfacesAndProperties) Q_DECLARE_METATYPE(ManagedObjectList) diff --git a/src/device/devicedatabasebackend.h b/src/device/devicedatabasebackend.h index 3f928656..3c30ccf6 100644 --- a/src/device/devicedatabasebackend.h +++ b/src/device/devicedatabasebackend.h @@ -53,7 +53,7 @@ class DeviceDatabaseBackend : public QObject { MusicStorage::TranscodeMode transcode_mode_; Song::FileType transcode_format_; }; - typedef QList DeviceList; + using DeviceList = QList; static const int kDeviceSchemaVersion; diff --git a/src/engine/chromaprinter.cpp b/src/engine/chromaprinter.cpp index 27ac6814..8e723ae5 100644 --- a/src/engine/chromaprinter.cpp +++ b/src/engine/chromaprinter.cpp @@ -40,7 +40,7 @@ #include "core/signalchecker.h" #ifndef u_int32_t -typedef unsigned int u_int32_t; +using u_int32_t = unsigned int; #endif static const int kDecodeRate = 11025; diff --git a/src/engine/engine_fwd.h b/src/engine/engine_fwd.h index 44710e38..5868c3f8 100644 --- a/src/engine/engine_fwd.h +++ b/src/engine/engine_fwd.h @@ -37,6 +37,6 @@ Q_DECLARE_FLAGS(TrackChangeFlags, TrackChangeType) } // namespace Engine -typedef Engine::Base EngineBase; +using EngineBase = Engine::Base; #endif // ENGINE_FWD_H diff --git a/src/engine/enginebase.h b/src/engine/enginebase.h index ea05676f..345f9b9a 100644 --- a/src/engine/enginebase.h +++ b/src/engine/enginebase.h @@ -47,7 +47,7 @@ namespace Engine { struct SimpleMetaBundle; -typedef std::vector Scope; +using Scope = std::vector; class Base : public QObject { Q_OBJECT @@ -63,7 +63,7 @@ class Base : public QObject { QString description; QString iconname; }; - typedef QList OutputDetailsList; + using OutputDetailsList = QList; virtual bool Init() = 0; virtual State state() const = 0; @@ -160,7 +160,7 @@ class Base : public QObject { QString description; QString iconname; }; - typedef QList PluginDetailsList; + using PluginDetailsList = QList; EngineType type_; bool volume_control_; diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index 50c4227a..710a2806 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -835,7 +835,7 @@ std::shared_ptr GstEngine::CreatePipeline(const QByteArray &g void GstEngine::UpdateScope(const int chunk_length) { - typedef Engine::Scope::value_type sample_type; + using sample_type = Engine::Scope::value_type; // Prevent dbz or invalid chunk size if (!GST_CLOCK_TIME_IS_VALID(GST_BUFFER_DURATION(latest_buffer_))) return; diff --git a/src/internet/internetsearchview.h b/src/internet/internetsearchview.h index c99d37d6..803abb5f 100644 --- a/src/internet/internetsearchview.h +++ b/src/internet/internetsearchview.h @@ -81,7 +81,7 @@ class InternetSearchView : public QWidget { Song metadata_; QString pixmap_cache_key_; }; - typedef QList ResultList; + using ResultList = QList; void Init(Application *app, InternetService *service); diff --git a/src/lyrics/lyricsfetcher.h b/src/lyrics/lyricsfetcher.h index 18beaa1f..b32ac1df 100644 --- a/src/lyrics/lyricsfetcher.h +++ b/src/lyrics/lyricsfetcher.h @@ -53,7 +53,7 @@ struct LyricsSearchResult { QString lyrics; float score; }; -typedef QList LyricsSearchResults; +using LyricsSearchResults = QList; Q_DECLARE_METATYPE(LyricsSearchResult) Q_DECLARE_METATYPE(QList) diff --git a/src/lyrics/lyricsprovider.h b/src/lyrics/lyricsprovider.h index 4e314216..2ca91c31 100644 --- a/src/lyrics/lyricsprovider.h +++ b/src/lyrics/lyricsprovider.h @@ -39,9 +39,6 @@ class LyricsProvider : public QObject { public: explicit LyricsProvider(const QString &name, const bool enabled, const bool authentication_required, NetworkAccessManager *network, QObject *parent); - typedef QPair Param; - typedef QList ParamList; - QString name() const { return name_; } bool is_enabled() const { return enabled_; } int order() const { return order_; } @@ -65,6 +62,9 @@ class LyricsProvider : public QObject { void SearchFinished(int id, LyricsSearchResults results); protected: + using Param = QPair; + using ParamList = QList; + NetworkAccessManager *network_; QString name_; bool enabled_; diff --git a/src/moodbar/moodbarrenderer.h b/src/moodbar/moodbarrenderer.h index 14f6269f..d5455cd1 100644 --- a/src/moodbar/moodbarrenderer.h +++ b/src/moodbar/moodbarrenderer.h @@ -31,7 +31,7 @@ class QPainter; -typedef QVector ColorVector; +using ColorVector = QVector; class MoodbarRenderer { public: diff --git a/src/musicbrainz/acoustidclient.cpp b/src/musicbrainz/acoustidclient.cpp index 2a7a8355..b5698bdc 100644 --- a/src/musicbrainz/acoustidclient.cpp +++ b/src/musicbrainz/acoustidclient.cpp @@ -65,8 +65,8 @@ void AcoustidClient::SetTimeout(const int msec) { timeouts_->SetTimeout(msec); } void AcoustidClient::Start(const int id, const QString &fingerprint, int duration_msec) { - typedef QPair Param; - typedef QList ParamList; + using Param = QPair; + using ParamList = QList; const ParamList params = ParamList() << Param("format", "json") << Param("client", kClientId) diff --git a/src/musicbrainz/musicbrainzclient.h b/src/musicbrainz/musicbrainzclient.h index c7b26a0d..11778853 100644 --- a/src/musicbrainz/musicbrainzclient.h +++ b/src/musicbrainz/musicbrainzclient.h @@ -87,7 +87,7 @@ class MusicBrainzClient : public QObject { int track_; int year_; }; - typedef QList ResultList; + using ResultList = QList; // Starts a request and returns immediately. Finished() will be emitted later with the same ID. void Start(const int id, const QStringList &mbid); @@ -112,8 +112,8 @@ class MusicBrainzClient : public QObject { void DiscIdRequestFinished(const QString &discid, QNetworkReply *reply); private: - typedef QPair Param; - typedef QList ParamList; + using Param = QPair; + using ParamList = QList; struct Request { Request() : id(0), number(0) {} diff --git a/src/organize/organize.h b/src/organize/organize.h index 6b54a131..3039ce00 100644 --- a/src/organize/organize.h +++ b/src/organize/organize.h @@ -59,7 +59,7 @@ class Organize : public QObject { Song song_; QString new_filename_; }; - typedef QList NewSongInfoList; + using NewSongInfoList = QList; explicit Organize(TaskManager *task_manager, std::shared_ptr destination, const OrganizeFormat &format, const bool copy, const bool overwrite, const bool albumcover, const NewSongInfoList &songs, const bool eject_after, const QString &playlist = QString(), QObject *parent = nullptr); ~Organize() override; diff --git a/src/playlist/playlist.h b/src/playlist/playlist.h index 59b7dc57..01c6e6c4 100644 --- a/src/playlist/playlist.h +++ b/src/playlist/playlist.h @@ -69,7 +69,7 @@ class ShuffleItems; class SortItems; } // namespace PlaylistUndoCommands -typedef QMap ColumnAlignmentMap; +using ColumnAlignmentMap = QMap; Q_DECLARE_METATYPE(Qt::Alignment) Q_DECLARE_METATYPE(ColumnAlignmentMap) diff --git a/src/playlist/playlistbackend.h b/src/playlist/playlistbackend.h index 0e0b3934..ce46d6c0 100644 --- a/src/playlist/playlistbackend.h +++ b/src/playlist/playlistbackend.h @@ -63,7 +63,7 @@ class PlaylistBackend : public QObject { QString dynamic_backend; QByteArray dynamic_data; }; - typedef QList PlaylistList; + using PlaylistList = QList; static const int kSongTableJoins; diff --git a/src/playlist/playlistitem.h b/src/playlist/playlistitem.h index 94d8d013..b5918666 100644 --- a/src/playlist/playlistitem.h +++ b/src/playlist/playlistitem.h @@ -131,8 +131,8 @@ class PlaylistItem : public std::enable_shared_from_this { Q_DISABLE_COPY(PlaylistItem) }; -typedef std::shared_ptr PlaylistItemPtr; -typedef QList PlaylistItemList; +using PlaylistItemPtr = std::shared_ptr; +using PlaylistItemList = QList; Q_DECLARE_METATYPE(PlaylistItemPtr) Q_DECLARE_METATYPE(PlaylistItemList) diff --git a/src/qobuz/qobuzbaserequest.h b/src/qobuz/qobuzbaserequest.h index a051a210..9c66ae6c 100644 --- a/src/qobuz/qobuzbaserequest.h +++ b/src/qobuz/qobuzbaserequest.h @@ -59,8 +59,8 @@ class QobuzBaseRequest : public QObject { }; protected: - typedef QPair Param; - typedef QList ParamList; + using Param = QPair; + using ParamList = QList; QNetworkReply *CreateRequest(const QString &ressource_name, const ParamList ¶ms_provided); QByteArray GetReplyData(QNetworkReply *reply); diff --git a/src/qobuz/qobuzservice.h b/src/qobuz/qobuzservice.h index 08b1e5f0..2cbfee1c 100644 --- a/src/qobuz/qobuzservice.h +++ b/src/qobuz/qobuzservice.h @@ -142,8 +142,8 @@ class QobuzService : public InternetService { void HandleStreamURLSuccess(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: - typedef QPair Param; - typedef QList ParamList; + using Param = QPair; + using ParamList = QList; void SendSearch(); void LoginError(const QString &error = QString(), const QVariant &debug = QVariant()); diff --git a/src/radios/radiochannel.h b/src/radios/radiochannel.h index 734df92d..08371577 100644 --- a/src/radios/radiochannel.h +++ b/src/radios/radiochannel.h @@ -36,7 +36,7 @@ struct RadioChannel { Song ToSong() const; }; -typedef QList RadioChannelList; +using RadioChannelList = QList; Q_DECLARE_METATYPE(RadioChannel) diff --git a/src/radios/radiomodel.h b/src/radios/radiomodel.h index b425544a..944f69a7 100644 --- a/src/radios/radiomodel.h +++ b/src/radios/radiomodel.h @@ -88,7 +88,7 @@ class RadioModel : public SimpleTreeModel { private: static const int kTreeIconSize; - typedef QPair ItemAndCacheKey; + using ItemAndCacheKey = QPair; Application *app_; AlbumCoverLoaderOptions cover_loader_options_; diff --git a/src/scrobbler/lastfmimport.h b/src/scrobbler/lastfmimport.h index 4b868bc0..d692b177 100644 --- a/src/scrobbler/lastfmimport.h +++ b/src/scrobbler/lastfmimport.h @@ -48,8 +48,8 @@ class LastFMImport : public QObject { void AbortAll(); private: - typedef QPair Param; - typedef QList ParamList; + using Param = QPair; + using ParamList = QList; struct GetRecentTracksRequest { explicit GetRecentTracksRequest(const int _page) : page(_page) {} diff --git a/src/scrobbler/scrobblercacheitem.h b/src/scrobbler/scrobblercacheitem.h index b500b58a..52d9497e 100644 --- a/src/scrobbler/scrobblercacheitem.h +++ b/src/scrobbler/scrobblercacheitem.h @@ -50,8 +50,8 @@ class ScrobblerCacheItem : public QObject { }; -typedef std::shared_ptr ScrobblerCacheItemPtr; -typedef QList ScrobblerCacheItemList; +using ScrobblerCacheItemPtr = std::shared_ptr; +using ScrobblerCacheItemList = QList; Q_DECLARE_METATYPE(ScrobblerCacheItemPtr) Q_DECLARE_METATYPE(ScrobblerCacheItemList) diff --git a/src/scrobbler/scrobblerservice.h b/src/scrobbler/scrobblerservice.h index 62404ba6..78250f84 100644 --- a/src/scrobbler/scrobblerservice.h +++ b/src/scrobbler/scrobblerservice.h @@ -56,9 +56,9 @@ class ScrobblerService : public QObject { virtual void Submitted() = 0; virtual bool IsSubmitted() const { return false; } - typedef QPair Param; - typedef QPair EncodedParam; - typedef QList ParamList; + using Param = QPair; + using EncodedParam = QPair; + using ParamList = QList; QJsonObject ExtractJsonObj(const QByteArray &data, const bool ignore_empty = false); diff --git a/src/smartplaylists/playlistgenerator_fwd.h b/src/smartplaylists/playlistgenerator_fwd.h index bb3d58b1..3a801b8b 100644 --- a/src/smartplaylists/playlistgenerator_fwd.h +++ b/src/smartplaylists/playlistgenerator_fwd.h @@ -27,6 +27,6 @@ class PlaylistGenerator; -typedef std::shared_ptr PlaylistGeneratorPtr; +using PlaylistGeneratorPtr = std::shared_ptr; #endif // PLAYLISTGENERATOR_FWD_H diff --git a/src/smartplaylists/smartplaylistsearch.h b/src/smartplaylists/smartplaylistsearch.h index 465309c2..4b9b193b 100644 --- a/src/smartplaylists/smartplaylistsearch.h +++ b/src/smartplaylists/smartplaylistsearch.h @@ -33,7 +33,7 @@ class SmartPlaylistSearch { public: - typedef QList TermList; + using TermList = QList; // These values are persisted, so add to the end of the enum only enum SearchType { Type_And = 0, Type_Or, Type_All, }; diff --git a/src/smartplaylists/smartplaylistsearchterm.h b/src/smartplaylists/smartplaylistsearchterm.h index 89fad37d..d6c40b45 100644 --- a/src/smartplaylists/smartplaylistsearchterm.h +++ b/src/smartplaylists/smartplaylistsearchterm.h @@ -134,7 +134,7 @@ class SmartPlaylistSearchTerm { }; -typedef QList OperatorList; +using OperatorList = QList; QDataStream &operator<<(QDataStream &s, const SmartPlaylistSearchTerm &term); QDataStream &operator>>(QDataStream &s, SmartPlaylistSearchTerm &term); diff --git a/src/smartplaylists/smartplaylistsmodel.h b/src/smartplaylists/smartplaylistsmodel.h index 5a42d32c..fd85f8c5 100644 --- a/src/smartplaylists/smartplaylistsmodel.h +++ b/src/smartplaylists/smartplaylistsmodel.h @@ -58,8 +58,8 @@ class SmartPlaylistsModel : public SimpleTreeModel { LastRole }; - typedef QList GeneratorList; - typedef QList DefaultGenerators; + using GeneratorList = QList; + using DefaultGenerators = QList; PlaylistGeneratorPtr CreateGenerator(const QModelIndex &idx) const; void AddGenerator(PlaylistGeneratorPtr gen); diff --git a/src/subsonic/subsonicbaserequest.h b/src/subsonic/subsonicbaserequest.h index e79f44d4..65b58fd3 100644 --- a/src/subsonic/subsonicbaserequest.h +++ b/src/subsonic/subsonicbaserequest.h @@ -49,8 +49,8 @@ class SubsonicBaseRequest : public QObject { explicit SubsonicBaseRequest(SubsonicService *service, QObject *parent = nullptr); protected: - typedef QPair Param; - typedef QList ParamList; + using Param = QPair; + using ParamList = QList; public: static QUrl CreateUrl(const QUrl &server_url, const SubsonicSettingsPage::AuthMethod auth_method, const QString &username, const QString &password, const QString &ressource_name, const ParamList ¶ms_provided); diff --git a/src/subsonic/subsonicservice.cpp b/src/subsonic/subsonicservice.cpp index f04c8fbd..6441bfa6 100644 --- a/src/subsonic/subsonicservice.cpp +++ b/src/subsonic/subsonicservice.cpp @@ -155,6 +155,9 @@ void SubsonicService::SendPingWithCredentials(QUrl url, const QString &username, ping_redirects_ = 0; } + using Param = QPair; + using ParamList = QList; + ParamList params = ParamList() << Param("c", kClientName) << Param("v", kApiVersion) << Param("f", "json") diff --git a/src/subsonic/subsonicservice.h b/src/subsonic/subsonicservice.h index 84556a39..c7408d4b 100644 --- a/src/subsonic/subsonicservice.h +++ b/src/subsonic/subsonicservice.h @@ -101,9 +101,6 @@ class SubsonicService : public InternetService { void SongsResultsReceived(const SongMap &songs, const QString &error); private: - typedef QPair Param; - typedef QList ParamList; - void PingError(const QString &error = QString(), const QVariant &debug = QVariant()); static const char *kSongsTable; diff --git a/src/subsonic/subsonicurlhandler.cpp b/src/subsonic/subsonicurlhandler.cpp index feb44b42..9be2ca44 100644 --- a/src/subsonic/subsonicurlhandler.cpp +++ b/src/subsonic/subsonicurlhandler.cpp @@ -43,6 +43,8 @@ UrlHandler::LoadResult SubsonicUrlHandler::StartLoading(const QUrl &url) { return LoadResult(url, LoadResult::Error, tr("Missing Subsonic username or password.")); } + using Param = QPair; + using ParamList = QList; const QUrl stream_url = SubsonicBaseRequest::CreateUrl(server_url(), auth_method(), username(), password(), "stream", ParamList() << Param("id", url.path())); return LoadResult(url, LoadResult::TrackAvailable, stream_url); diff --git a/src/subsonic/subsonicurlhandler.h b/src/subsonic/subsonicurlhandler.h index 25d2e1ff..ae4f9115 100644 --- a/src/subsonic/subsonicurlhandler.h +++ b/src/subsonic/subsonicurlhandler.h @@ -48,9 +48,6 @@ class SubsonicUrlHandler : public UrlHandler { LoadResult StartLoading(const QUrl &url) override; private: - typedef QPair Param; - typedef QList ParamList; - SubsonicService *service_; }; diff --git a/src/tidal/tidalbaserequest.h b/src/tidal/tidalbaserequest.h index 784b5a2d..58ecc4fa 100644 --- a/src/tidal/tidalbaserequest.h +++ b/src/tidal/tidalbaserequest.h @@ -59,8 +59,8 @@ class TidalBaseRequest : public QObject { }; protected: - typedef QPair Param; - typedef QList ParamList; + using Param = QPair; + using ParamList = QList; QNetworkReply *CreateRequest(const QString &ressource_name, const ParamList ¶ms_provided); QByteArray GetReplyData(QNetworkReply *reply, const bool send_login); diff --git a/src/tidal/tidalservice.h b/src/tidal/tidalservice.h index 0b442afa..04941e1f 100644 --- a/src/tidal/tidalservice.h +++ b/src/tidal/tidalservice.h @@ -155,8 +155,8 @@ class TidalService : public InternetService { void HandleStreamURLSuccess(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: - typedef QPair Param; - typedef QList ParamList; + using Param = QPair; + using ParamList = QList; void LoadSession(); void RequestAccessToken(const QString &code = QString()); diff --git a/src/transcoder/transcoder.h b/src/transcoder/transcoder.h index 27e99ff6..3cfe496f 100644 --- a/src/transcoder/transcoder.h +++ b/src/transcoder/transcoder.h @@ -140,7 +140,7 @@ class Transcoder : public QObject { static GstBusSyncReply BusCallbackSync(GstBus*, GstMessage *msg, gpointer data); private: - typedef QList> JobStateList; + using JobStateList = QList>; int max_threads_; QList queued_jobs_; diff --git a/src/widgets/stretchheaderview.h b/src/widgets/stretchheaderview.h index ff0e3ae3..9100258e 100644 --- a/src/widgets/stretchheaderview.h +++ b/src/widgets/stretchheaderview.h @@ -40,7 +40,7 @@ class StretchHeaderView : public QHeaderView { public: explicit StretchHeaderView(const Qt::Orientation orientation, QWidget *parent = nullptr); - typedef double ColumnWidthType; + using ColumnWidthType = double; static const int kMinimumColumnWidth; static const int kMagicNumber; diff --git a/src/widgets/volumeslider.h b/src/widgets/volumeslider.h index 16cdbc6b..9b74bdfc 100644 --- a/src/widgets/volumeslider.h +++ b/src/widgets/volumeslider.h @@ -81,10 +81,10 @@ class PrettySlider : public SliderSlider { Q_OBJECT public: - typedef enum { + using SliderMode = enum { Normal, // Same behavior as Slider *unless* there's a moodbar Pretty - } SliderMode; + }; explicit PrettySlider(const Qt::Orientation orientation, const SliderMode mode, QWidget *parent, const uint max = 0);