Fix minor code issues
This commit is contained in:
@@ -102,8 +102,8 @@ class QobuzRequest : public QobuzBaseRequest {
|
||||
QString filename;
|
||||
};
|
||||
|
||||
const bool IsQuery() { return (type_ == QueryType_Artists || type_ == QueryType_Albums || type_ == QueryType_Songs); }
|
||||
const bool IsSearch() { return (type_ == QueryType_SearchArtists || type_ == QueryType_SearchAlbums || type_ == QueryType_SearchSongs); }
|
||||
bool IsQuery() { return (type_ == QueryType_Artists || type_ == QueryType_Albums || type_ == QueryType_Songs); }
|
||||
bool IsSearch() { return (type_ == QueryType_SearchArtists || type_ == QueryType_SearchAlbums || type_ == QueryType_SearchSongs); }
|
||||
|
||||
void GetArtists();
|
||||
void GetAlbums();
|
||||
|
||||
@@ -456,18 +456,22 @@ void QobuzService::GetArtists() {
|
||||
}
|
||||
|
||||
void QobuzService::ArtistsResultsReceived(const int id, const SongList &songs, const QString &error) {
|
||||
Q_UNUSED(id);
|
||||
emit ArtistsResults(songs, error);
|
||||
}
|
||||
|
||||
void QobuzService::ArtistsUpdateStatusReceived(const int id, const QString &text) {
|
||||
Q_UNUSED(id);
|
||||
emit ArtistsUpdateStatus(text);
|
||||
}
|
||||
|
||||
void QobuzService::ArtistsProgressSetMaximumReceived(const int id, const int max) {
|
||||
Q_UNUSED(id);
|
||||
emit ArtistsProgressSetMaximum(max);
|
||||
}
|
||||
|
||||
void QobuzService::ArtistsUpdateProgressReceived(const int id, const int progress) {
|
||||
Q_UNUSED(id);
|
||||
emit ArtistsUpdateProgress(progress);
|
||||
}
|
||||
|
||||
@@ -505,18 +509,22 @@ void QobuzService::GetAlbums() {
|
||||
}
|
||||
|
||||
void QobuzService::AlbumsResultsReceived(const int id, const SongList &songs, const QString &error) {
|
||||
Q_UNUSED(id);
|
||||
emit AlbumsResults(songs, error);
|
||||
}
|
||||
|
||||
void QobuzService::AlbumsUpdateStatusReceived(const int id, const QString &text) {
|
||||
Q_UNUSED(id);
|
||||
emit AlbumsUpdateStatus(text);
|
||||
}
|
||||
|
||||
void QobuzService::AlbumsProgressSetMaximumReceived(const int id, const int max) {
|
||||
Q_UNUSED(id);
|
||||
emit AlbumsProgressSetMaximum(max);
|
||||
}
|
||||
|
||||
void QobuzService::AlbumsUpdateProgressReceived(const int id, const int progress) {
|
||||
Q_UNUSED(id);
|
||||
emit AlbumsUpdateProgress(progress);
|
||||
}
|
||||
|
||||
@@ -554,18 +562,22 @@ void QobuzService::GetSongs() {
|
||||
}
|
||||
|
||||
void QobuzService::SongsResultsReceived(const int id, const SongList &songs, const QString &error) {
|
||||
Q_UNUSED(id);
|
||||
emit SongsResults(songs, error);
|
||||
}
|
||||
|
||||
void QobuzService::SongsUpdateStatusReceived(const int id, const QString &text) {
|
||||
Q_UNUSED(id);
|
||||
emit SongsUpdateStatus(text);
|
||||
}
|
||||
|
||||
void QobuzService::SongsProgressSetMaximumReceived(const int id, const int max) {
|
||||
Q_UNUSED(id);
|
||||
emit SongsProgressSetMaximum(max);
|
||||
}
|
||||
|
||||
void QobuzService::SongsUpdateProgressReceived(const int id, const int progress) {
|
||||
Q_UNUSED(id);
|
||||
emit SongsUpdateProgress(progress);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class QobuzService : public InternetService {
|
||||
int Search(const QString &query, InternetSearch::SearchType type);
|
||||
void CancelSearch();
|
||||
|
||||
const int max_login_attempts() { return kLoginAttempts; }
|
||||
int max_login_attempts() { return kLoginAttempts; }
|
||||
|
||||
Application *app() { return app_; }
|
||||
QString app_id() { return app_id_; }
|
||||
@@ -84,9 +84,9 @@ class QobuzService : public InternetService {
|
||||
|
||||
QString user_auth_token() { return user_auth_token_; }
|
||||
|
||||
const bool authenticated() { return (!app_id_.isEmpty() && !app_secret_.isEmpty() && !user_auth_token_.isEmpty()); }
|
||||
const bool login_sent() { return login_sent_; }
|
||||
const bool login_attempts() { return login_attempts_; }
|
||||
bool authenticated() { return (!app_id_.isEmpty() && !app_secret_.isEmpty() && !user_auth_token_.isEmpty()); }
|
||||
bool login_sent() { return login_sent_; }
|
||||
bool login_attempts() { return login_attempts_; }
|
||||
|
||||
void GetStreamURL(const QUrl &url);
|
||||
|
||||
|
||||
@@ -61,13 +61,13 @@ QobuzStreamURLRequest::~QobuzStreamURLRequest() {
|
||||
|
||||
}
|
||||
|
||||
void QobuzStreamURLRequest::LoginComplete(bool success, QString error) {
|
||||
void QobuzStreamURLRequest::LoginComplete(const bool success, const QString &error) {
|
||||
|
||||
if (!need_login_) return;
|
||||
need_login_ = false;
|
||||
|
||||
if (!success) {
|
||||
emit StreamURLFinished(original_url_, original_url_, Song::FileType_Stream, -1, -1, -1, errors_.first());
|
||||
emit StreamURLFinished(original_url_, original_url_, Song::FileType_Stream, -1, -1, -1, error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class QobuzStreamURLRequest : public QobuzBaseRequest {
|
||||
void StreamURLFinished(const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration, QString error = QString());
|
||||
|
||||
private slots:
|
||||
void LoginComplete(bool success, QString error = QString());
|
||||
void LoginComplete(const bool success, const QString &error = QString());
|
||||
void StreamURLReceived();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user