Fix minor code issues

This commit is contained in:
Jonas Kvinge
2019-09-15 20:27:32 +02:00
parent 83e10aac27
commit 2d67279180
147 changed files with 644 additions and 329 deletions

View File

@@ -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();

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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: