mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-02 10:36:45 +01:00
Replace typedef with using
This commit is contained in:
parent
61204e8d35
commit
b22320c48f
@ -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<void(double *magnitudes, int size)> OutputCallback;
|
||||
using OutputCallback = std::function<void(double *magnitudes, int size)>;
|
||||
|
||||
struct GstFastSpectrum {
|
||||
GstAudioFilter parent;
|
||||
|
@ -82,8 +82,8 @@ class AbstractMessageHandler : public _MessageHandlerBase {
|
||||
AbstractMessageHandler(QIODevice *device, QObject *parent);
|
||||
~AbstractMessageHandler() override { AbstractMessageHandler::AbortAll(); }
|
||||
|
||||
typedef MT MessageType;
|
||||
typedef MessageReply<MT> ReplyType;
|
||||
using MessageType = MT;
|
||||
using ReplyType = MessageReply<MT>;
|
||||
|
||||
// Serialises the message and writes it to the socket.
|
||||
// This version MUST be called from the thread in which the AbstractMessageHandler was created.
|
||||
|
@ -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().
|
||||
|
@ -49,7 +49,7 @@ class QTimerEvent;
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
typedef std::vector<float> Scope;
|
||||
using Scope = std::vector<float>;
|
||||
|
||||
class Base : public QWidget {
|
||||
Q_OBJECT
|
||||
|
@ -72,7 +72,7 @@ class CollectionBackendInterface : public QObject {
|
||||
Song::FileType filetype;
|
||||
QString cue_path;
|
||||
};
|
||||
typedef QList<Album> AlbumList;
|
||||
using AlbumList = QList<Album>;
|
||||
|
||||
virtual QString songs_table() const = 0;
|
||||
virtual QString fts_table() const = 0;
|
||||
|
@ -308,7 +308,7 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
||||
|
||||
AlbumCoverLoaderOptions cover_loader_options_;
|
||||
|
||||
typedef QPair<CollectionItem*, QString> ItemAndCacheKey;
|
||||
using ItemAndCacheKey = QPair<CollectionItem*, QString>;
|
||||
QMap<quint64, ItemAndCacheKey> pending_art_;
|
||||
QSet<QString> pending_cache_keys_;
|
||||
};
|
||||
|
@ -40,7 +40,7 @@ struct Directory {
|
||||
};
|
||||
Q_DECLARE_METATYPE(Directory)
|
||||
|
||||
typedef QList<Directory> DirectoryList;
|
||||
using DirectoryList = QList<Directory>;
|
||||
Q_DECLARE_METATYPE(DirectoryList)
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ struct Subdirectory {
|
||||
};
|
||||
Q_DECLARE_METATYPE(Subdirectory)
|
||||
|
||||
typedef QList<Subdirectory> SubdirectoryList;
|
||||
using SubdirectoryList = QList<Subdirectory>;
|
||||
Q_DECLARE_METATYPE(SubdirectoryList)
|
||||
|
||||
#endif // DIRECTORY_H
|
||||
|
@ -63,11 +63,7 @@ struct tag_group_by {};
|
||||
|
||||
class GroupByDialogPrivate {
|
||||
private:
|
||||
typedef multi_index_container<
|
||||
Mapping,
|
||||
indexed_by<
|
||||
ordered_unique<tag<tag_index>, member<Mapping, int, &Mapping::combo_box_index> >,
|
||||
ordered_unique<tag<tag_group_by>, member<Mapping, CollectionModel::GroupBy, &Mapping::group_by> > > > MappingContainer;
|
||||
using MappingContainer = multi_index_container<Mapping, indexed_by<ordered_unique<tag<tag_index>, member<Mapping, int, &Mapping::combo_box_index>>, ordered_unique<tag<tag_group_by>, member<Mapping, CollectionModel::GroupBy, &Mapping::group_by>>>>;
|
||||
|
||||
public:
|
||||
MappingContainer mapping_;
|
||||
|
@ -71,13 +71,7 @@ struct tag_by_pointer {};
|
||||
|
||||
class MergedProxyModelPrivate {
|
||||
private:
|
||||
typedef multi_index_container<
|
||||
Mapping*,
|
||||
indexed_by<
|
||||
hashed_unique<tag<tag_by_source>,
|
||||
member<Mapping, QModelIndex, &Mapping::source_index> >,
|
||||
ordered_unique<tag<tag_by_pointer>, identity<Mapping*> > > >
|
||||
MappingContainer;
|
||||
using MappingContainer = multi_index_container<Mapping *, indexed_by<hashed_unique<tag<tag_by_source>, member<Mapping, QModelIndex, &Mapping::source_index>>, ordered_unique<tag<tag_by_pointer>, identity<Mapping *>>>>;
|
||||
|
||||
public:
|
||||
MappingContainer mappings_;
|
||||
|
@ -45,8 +45,8 @@ class Application;
|
||||
class Song;
|
||||
class Playlist;
|
||||
|
||||
typedef QList<QVariantMap> TrackMetadata;
|
||||
typedef QList<QDBusObjectPath> Track_Ids;
|
||||
using TrackMetadata = QList<QVariantMap>;
|
||||
using Track_Ids = QList<QDBusObjectPath>;
|
||||
Q_DECLARE_METATYPE(TrackMetadata)
|
||||
|
||||
struct MprisPlaylist {
|
||||
@ -54,7 +54,7 @@ struct MprisPlaylist {
|
||||
QString name;
|
||||
QString icon; // Uri
|
||||
};
|
||||
typedef QList<MprisPlaylist> MprisPlaylistList;
|
||||
using MprisPlaylistList = QList<MprisPlaylist>;
|
||||
Q_DECLARE_METATYPE(MprisPlaylist)
|
||||
Q_DECLARE_METATYPE(MprisPlaylistList)
|
||||
|
||||
|
@ -44,7 +44,7 @@ class MultiSortFilterProxy : public QSortFilterProxyModel {
|
||||
private:
|
||||
int Compare(const QVariant &left, const QVariant &right) const;
|
||||
|
||||
typedef QPair<int, Qt::SortOrder> SortSpec;
|
||||
using SortSpec = QPair<int, Qt::SortOrder>;
|
||||
QList<SortSpec> sorting_;
|
||||
};
|
||||
|
||||
|
@ -55,7 +55,7 @@ class MusicStorage {
|
||||
Transcode_Unsupported = 3,
|
||||
};
|
||||
|
||||
typedef std::function<void(float progress)> ProgressFunction;
|
||||
using ProgressFunction = std::function<void(float progress)>;
|
||||
|
||||
struct CopyJob {
|
||||
CopyJob() : overwrite_(false), remove_original_(false), albumcover_(false) {}
|
||||
|
@ -20,7 +20,7 @@
|
||||
template<typename CFT>
|
||||
class ScopedCFTypeRef {
|
||||
public:
|
||||
typedef CFT element_type;
|
||||
using element_type = CFT;
|
||||
|
||||
explicit ScopedCFTypeRef(CFT object = nullptr) : object_(object) {}
|
||||
|
||||
|
@ -405,8 +405,8 @@ class Song {
|
||||
QSharedDataPointer<Private> d;
|
||||
};
|
||||
|
||||
typedef QList<Song> SongList;
|
||||
typedef QMap<QString, Song> SongMap;
|
||||
using SongList = QList<Song>;
|
||||
using SongMap = QMap<QString, Song>;
|
||||
|
||||
Q_DECLARE_METATYPE(Song)
|
||||
Q_DECLARE_METATYPE(SongList)
|
||||
|
@ -53,6 +53,6 @@ class SqlRow {
|
||||
|
||||
};
|
||||
|
||||
typedef QList<SqlRow> SqlRowList;
|
||||
using SqlRowList = QList<SqlRow>;
|
||||
|
||||
#endif // SQLROW_H
|
||||
|
@ -45,8 +45,8 @@ class TagReaderClient : public QObject {
|
||||
public:
|
||||
explicit TagReaderClient(QObject *parent = nullptr);
|
||||
|
||||
typedef AbstractMessageHandler<spb::tagreader::Message> HandlerType;
|
||||
typedef HandlerType::ReplyType ReplyType;
|
||||
using HandlerType = AbstractMessageHandler<spb::tagreader::Message>;
|
||||
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
|
||||
|
@ -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<CoverProviderSearchResult> CoverProviderSearchResults;
|
||||
using CoverProviderSearchResults = QList<CoverProviderSearchResult>;
|
||||
Q_DECLARE_METATYPE(QList<CoverProviderSearchResult>)
|
||||
|
||||
// This class searches for album covers for a given query or artist/album and returns URLs. It's NOT thread-safe.
|
||||
|
@ -75,6 +75,9 @@ class CoverProvider : public QObject {
|
||||
void SearchFinished(int, CoverProviderSearchResults);
|
||||
|
||||
protected:
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
Application *app_;
|
||||
NetworkAccessManager *network_;
|
||||
QString name_;
|
||||
|
@ -66,9 +66,6 @@ DeezerCoverProvider::~DeezerCoverProvider() {
|
||||
|
||||
bool DeezerCoverProvider::StartSearch(const QString &artist, const QString &album, const QString &title, const int id) {
|
||||
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> 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) {
|
||||
|
@ -151,7 +151,7 @@ QNetworkReply *DiscogsCoverProvider::CreateRequest(QUrl url, const ParamList &pa
|
||||
QStringList query_items;
|
||||
|
||||
// Encode the arguments
|
||||
typedef QPair<QByteArray, QByteArray> EncodedParam;
|
||||
using EncodedParam = QPair<QByteArray, QByteArray>;
|
||||
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);
|
||||
|
@ -77,9 +77,6 @@ class DiscogsCoverProvider : public JsonCoverProvider {
|
||||
};
|
||||
|
||||
private:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
|
||||
void SendSearchRequest(std::shared_ptr<DiscogsCoverSearchContext> search);
|
||||
void SendReleaseRequest(const DiscogsCoverReleaseContext &release);
|
||||
QNetworkReply *CreateRequest(QUrl url, const ParamList ¶ms_provided = ParamList());
|
||||
|
@ -65,9 +65,6 @@ LastFmCoverProvider::~LastFmCoverProvider() {
|
||||
|
||||
bool LastFmCoverProvider::StartSearch(const QString &artist, const QString &album, const QString &title, const int id) {
|
||||
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
|
||||
if (artist.isEmpty() && album.isEmpty() && title.isEmpty()) return false;
|
||||
|
||||
QString method;
|
||||
|
@ -59,9 +59,6 @@ class QobuzCoverProvider : public JsonCoverProvider {
|
||||
void Error(const QString &error, const QVariant &debug = QVariant()) override;
|
||||
|
||||
private:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
|
||||
static const int kLimit;
|
||||
|
||||
QobuzService *service_;
|
||||
|
@ -69,9 +69,6 @@ class SpotifyCoverProvider : public JsonCoverProvider {
|
||||
void RequestAccessToken(const QString &code = QString(), const QUrl &redirect_url = QUrl());
|
||||
|
||||
private:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
|
||||
static const char *kSettingsGroup;
|
||||
static const char *kClientIDB64;
|
||||
static const char *kClientSecretB64;
|
||||
|
@ -63,9 +63,6 @@ TidalCoverProvider::~TidalCoverProvider() {
|
||||
|
||||
bool TidalCoverProvider::StartSearch(const QString &artist, const QString &album, const QString &title, const int id) {
|
||||
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
|
||||
if (!service_ || !service_->authenticated()) return false;
|
||||
|
||||
if (artist.isEmpty() && album.isEmpty() && title.isEmpty()) return false;
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
Q_DECLARE_METATYPE(QList<QByteArray>)
|
||||
|
||||
typedef QMap<QString, QVariantMap> InterfacesAndProperties;
|
||||
typedef QMap<QDBusObjectPath, InterfacesAndProperties> ManagedObjectList;
|
||||
using InterfacesAndProperties = QMap<QString, QVariantMap>;
|
||||
using ManagedObjectList = QMap<QDBusObjectPath, InterfacesAndProperties>;
|
||||
|
||||
Q_DECLARE_METATYPE(InterfacesAndProperties)
|
||||
Q_DECLARE_METATYPE(ManagedObjectList)
|
||||
|
@ -53,7 +53,7 @@ class DeviceDatabaseBackend : public QObject {
|
||||
MusicStorage::TranscodeMode transcode_mode_;
|
||||
Song::FileType transcode_format_;
|
||||
};
|
||||
typedef QList<Device> DeviceList;
|
||||
using DeviceList = QList<Device>;
|
||||
|
||||
static const int kDeviceSchemaVersion;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -37,6 +37,6 @@ Q_DECLARE_FLAGS(TrackChangeFlags, TrackChangeType)
|
||||
|
||||
} // namespace Engine
|
||||
|
||||
typedef Engine::Base EngineBase;
|
||||
using EngineBase = Engine::Base;
|
||||
|
||||
#endif // ENGINE_FWD_H
|
||||
|
@ -47,7 +47,7 @@ namespace Engine {
|
||||
|
||||
struct SimpleMetaBundle;
|
||||
|
||||
typedef std::vector<int16_t> Scope;
|
||||
using Scope = std::vector<int16_t>;
|
||||
|
||||
class Base : public QObject {
|
||||
Q_OBJECT
|
||||
@ -63,7 +63,7 @@ class Base : public QObject {
|
||||
QString description;
|
||||
QString iconname;
|
||||
};
|
||||
typedef QList<OutputDetails> OutputDetailsList;
|
||||
using OutputDetailsList = QList<OutputDetails>;
|
||||
|
||||
virtual bool Init() = 0;
|
||||
virtual State state() const = 0;
|
||||
@ -160,7 +160,7 @@ class Base : public QObject {
|
||||
QString description;
|
||||
QString iconname;
|
||||
};
|
||||
typedef QList<PluginDetails> PluginDetailsList;
|
||||
using PluginDetailsList = QList<PluginDetails>;
|
||||
|
||||
EngineType type_;
|
||||
bool volume_control_;
|
||||
|
@ -835,7 +835,7 @@ std::shared_ptr<GstEnginePipeline> 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;
|
||||
|
@ -81,7 +81,7 @@ class InternetSearchView : public QWidget {
|
||||
Song metadata_;
|
||||
QString pixmap_cache_key_;
|
||||
};
|
||||
typedef QList<Result> ResultList;
|
||||
using ResultList = QList<Result>;
|
||||
|
||||
void Init(Application *app, InternetService *service);
|
||||
|
||||
|
@ -53,7 +53,7 @@ struct LyricsSearchResult {
|
||||
QString lyrics;
|
||||
float score;
|
||||
};
|
||||
typedef QList<LyricsSearchResult> LyricsSearchResults;
|
||||
using LyricsSearchResults = QList<LyricsSearchResult>;
|
||||
|
||||
Q_DECLARE_METATYPE(LyricsSearchResult)
|
||||
Q_DECLARE_METATYPE(QList<LyricsSearchResult>)
|
||||
|
@ -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<QString, QString> Param;
|
||||
typedef QList<Param> 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<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
NetworkAccessManager *network_;
|
||||
QString name_;
|
||||
bool enabled_;
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
class QPainter;
|
||||
|
||||
typedef QVector<QColor> ColorVector;
|
||||
using ColorVector = QVector<QColor>;
|
||||
|
||||
class MoodbarRenderer {
|
||||
public:
|
||||
|
@ -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<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
const ParamList params = ParamList() << Param("format", "json")
|
||||
<< Param("client", kClientId)
|
||||
|
@ -87,7 +87,7 @@ class MusicBrainzClient : public QObject {
|
||||
int track_;
|
||||
int year_;
|
||||
};
|
||||
typedef QList<Result> ResultList;
|
||||
using ResultList = QList<Result>;
|
||||
|
||||
// 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<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
struct Request {
|
||||
Request() : id(0), number(0) {}
|
||||
|
@ -59,7 +59,7 @@ class Organize : public QObject {
|
||||
Song song_;
|
||||
QString new_filename_;
|
||||
};
|
||||
typedef QList<NewSongInfo> NewSongInfoList;
|
||||
using NewSongInfoList = QList<NewSongInfo>;
|
||||
|
||||
explicit Organize(TaskManager *task_manager, std::shared_ptr<MusicStorage> 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;
|
||||
|
@ -69,7 +69,7 @@ class ShuffleItems;
|
||||
class SortItems;
|
||||
} // namespace PlaylistUndoCommands
|
||||
|
||||
typedef QMap<int, Qt::Alignment> ColumnAlignmentMap;
|
||||
using ColumnAlignmentMap = QMap<int, Qt::Alignment>;
|
||||
Q_DECLARE_METATYPE(Qt::Alignment)
|
||||
Q_DECLARE_METATYPE(ColumnAlignmentMap)
|
||||
|
||||
|
@ -63,7 +63,7 @@ class PlaylistBackend : public QObject {
|
||||
QString dynamic_backend;
|
||||
QByteArray dynamic_data;
|
||||
};
|
||||
typedef QList<Playlist> PlaylistList;
|
||||
using PlaylistList = QList<Playlist>;
|
||||
|
||||
static const int kSongTableJoins;
|
||||
|
||||
|
@ -131,8 +131,8 @@ class PlaylistItem : public std::enable_shared_from_this<PlaylistItem> {
|
||||
|
||||
Q_DISABLE_COPY(PlaylistItem)
|
||||
};
|
||||
typedef std::shared_ptr<PlaylistItem> PlaylistItemPtr;
|
||||
typedef QList<PlaylistItemPtr> PlaylistItemList;
|
||||
using PlaylistItemPtr = std::shared_ptr<PlaylistItem>;
|
||||
using PlaylistItemList = QList<PlaylistItemPtr>;
|
||||
|
||||
Q_DECLARE_METATYPE(PlaylistItemPtr)
|
||||
Q_DECLARE_METATYPE(PlaylistItemList)
|
||||
|
@ -59,8 +59,8 @@ class QobuzBaseRequest : public QObject {
|
||||
};
|
||||
|
||||
protected:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
QNetworkReply *CreateRequest(const QString &ressource_name, const ParamList ¶ms_provided);
|
||||
QByteArray GetReplyData(QNetworkReply *reply);
|
||||
|
@ -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<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
void SendSearch();
|
||||
void LoginError(const QString &error = QString(), const QVariant &debug = QVariant());
|
||||
|
@ -36,7 +36,7 @@ struct RadioChannel {
|
||||
|
||||
Song ToSong() const;
|
||||
};
|
||||
typedef QList<RadioChannel> RadioChannelList;
|
||||
using RadioChannelList = QList<RadioChannel>;
|
||||
|
||||
Q_DECLARE_METATYPE(RadioChannel)
|
||||
|
||||
|
@ -88,7 +88,7 @@ class RadioModel : public SimpleTreeModel<RadioItem> {
|
||||
|
||||
private:
|
||||
static const int kTreeIconSize;
|
||||
typedef QPair<RadioItem*, QString> ItemAndCacheKey;
|
||||
using ItemAndCacheKey = QPair<RadioItem*, QString>;
|
||||
|
||||
Application *app_;
|
||||
AlbumCoverLoaderOptions cover_loader_options_;
|
||||
|
@ -48,8 +48,8 @@ class LastFMImport : public QObject {
|
||||
void AbortAll();
|
||||
|
||||
private:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
struct GetRecentTracksRequest {
|
||||
explicit GetRecentTracksRequest(const int _page) : page(_page) {}
|
||||
|
@ -50,8 +50,8 @@ class ScrobblerCacheItem : public QObject {
|
||||
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<ScrobblerCacheItem> ScrobblerCacheItemPtr;
|
||||
typedef QList<ScrobblerCacheItemPtr> ScrobblerCacheItemList;
|
||||
using ScrobblerCacheItemPtr = std::shared_ptr<ScrobblerCacheItem>;
|
||||
using ScrobblerCacheItemList = QList<ScrobblerCacheItemPtr>;
|
||||
|
||||
Q_DECLARE_METATYPE(ScrobblerCacheItemPtr)
|
||||
Q_DECLARE_METATYPE(ScrobblerCacheItemList)
|
||||
|
@ -56,9 +56,9 @@ class ScrobblerService : public QObject {
|
||||
virtual void Submitted() = 0;
|
||||
virtual bool IsSubmitted() const { return false; }
|
||||
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QPair<QByteArray, QByteArray> EncodedParam;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using EncodedParam = QPair<QByteArray, QByteArray>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
QJsonObject ExtractJsonObj(const QByteArray &data, const bool ignore_empty = false);
|
||||
|
||||
|
@ -27,6 +27,6 @@
|
||||
|
||||
class PlaylistGenerator;
|
||||
|
||||
typedef std::shared_ptr<PlaylistGenerator> PlaylistGeneratorPtr;
|
||||
using PlaylistGeneratorPtr = std::shared_ptr<PlaylistGenerator>;
|
||||
|
||||
#endif // PLAYLISTGENERATOR_FWD_H
|
||||
|
@ -33,7 +33,7 @@
|
||||
class SmartPlaylistSearch {
|
||||
|
||||
public:
|
||||
typedef QList<SmartPlaylistSearchTerm> TermList;
|
||||
using TermList = QList<SmartPlaylistSearchTerm>;
|
||||
|
||||
// These values are persisted, so add to the end of the enum only
|
||||
enum SearchType { Type_And = 0, Type_Or, Type_All, };
|
||||
|
@ -134,7 +134,7 @@ class SmartPlaylistSearchTerm {
|
||||
|
||||
};
|
||||
|
||||
typedef QList<SmartPlaylistSearchTerm::Operator> OperatorList;
|
||||
using OperatorList = QList<SmartPlaylistSearchTerm::Operator>;
|
||||
|
||||
QDataStream &operator<<(QDataStream &s, const SmartPlaylistSearchTerm &term);
|
||||
QDataStream &operator>>(QDataStream &s, SmartPlaylistSearchTerm &term);
|
||||
|
@ -58,8 +58,8 @@ class SmartPlaylistsModel : public SimpleTreeModel<SmartPlaylistsItem> {
|
||||
LastRole
|
||||
};
|
||||
|
||||
typedef QList<PlaylistGeneratorPtr> GeneratorList;
|
||||
typedef QList<GeneratorList> DefaultGenerators;
|
||||
using GeneratorList = QList<PlaylistGeneratorPtr>;
|
||||
using DefaultGenerators = QList<GeneratorList>;
|
||||
|
||||
PlaylistGeneratorPtr CreateGenerator(const QModelIndex &idx) const;
|
||||
void AddGenerator(PlaylistGeneratorPtr gen);
|
||||
|
@ -49,8 +49,8 @@ class SubsonicBaseRequest : public QObject {
|
||||
explicit SubsonicBaseRequest(SubsonicService *service, QObject *parent = nullptr);
|
||||
|
||||
protected:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
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);
|
||||
|
@ -155,6 +155,9 @@ void SubsonicService::SendPingWithCredentials(QUrl url, const QString &username,
|
||||
ping_redirects_ = 0;
|
||||
}
|
||||
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
ParamList params = ParamList() << Param("c", kClientName)
|
||||
<< Param("v", kApiVersion)
|
||||
<< Param("f", "json")
|
||||
|
@ -101,9 +101,6 @@ class SubsonicService : public InternetService {
|
||||
void SongsResultsReceived(const SongMap &songs, const QString &error);
|
||||
|
||||
private:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
|
||||
void PingError(const QString &error = QString(), const QVariant &debug = QVariant());
|
||||
|
||||
static const char *kSongsTable;
|
||||
|
@ -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<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
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);
|
||||
|
@ -48,9 +48,6 @@ class SubsonicUrlHandler : public UrlHandler {
|
||||
LoadResult StartLoading(const QUrl &url) override;
|
||||
|
||||
private:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
|
||||
SubsonicService *service_;
|
||||
|
||||
};
|
||||
|
@ -59,8 +59,8 @@ class TidalBaseRequest : public QObject {
|
||||
};
|
||||
|
||||
protected:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
QNetworkReply *CreateRequest(const QString &ressource_name, const ParamList ¶ms_provided);
|
||||
QByteArray GetReplyData(QNetworkReply *reply, const bool send_login);
|
||||
|
@ -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<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
void LoadSession();
|
||||
void RequestAccessToken(const QString &code = QString());
|
||||
|
@ -140,7 +140,7 @@ class Transcoder : public QObject {
|
||||
static GstBusSyncReply BusCallbackSync(GstBus*, GstMessage *msg, gpointer data);
|
||||
|
||||
private:
|
||||
typedef QList<std::shared_ptr<JobState>> JobStateList;
|
||||
using JobStateList = QList<std::shared_ptr<JobState>>;
|
||||
|
||||
int max_threads_;
|
||||
QList<Job> queued_jobs_;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user