Replace typedef with using
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user