Fix some compiler warnings

This commit is contained in:
Jonas Kvinge
2018-09-12 22:51:10 +02:00
parent 27e3448dda
commit fc8a27f55b
6 changed files with 7 additions and 15 deletions

View File

@@ -1036,7 +1036,7 @@ void Song::BindToQuery(QSqlQuery *query) const {
query->bindValue(":samplerate", intval(d->samplerate_)); query->bindValue(":samplerate", intval(d->samplerate_));
query->bindValue(":bitdepth", intval(d->bitdepth_)); query->bindValue(":bitdepth", intval(d->bitdepth_));
query->bindValue(":source", notnullintval(d->source_)); query->bindValue(":source", d->source_);
query->bindValue(":directory_id", notnullintval(d->directory_id_)); query->bindValue(":directory_id", notnullintval(d->directory_id_));
if (Application::kIsPortable && Utilities::UrlOnSameDriveAsStrawberry(d->url_)) { if (Application::kIsPortable && Utilities::UrlOnSameDriveAsStrawberry(d->url_)) {

View File

@@ -431,7 +431,7 @@ QString NativeSeparatorsDelegate::displayText(const QVariant &value, const QLoca
} }
SongSourceDelegate::SongSourceDelegate(QObject *parent, Player *player) : PlaylistDelegateBase(parent), player_(player) {} SongSourceDelegate::SongSourceDelegate(QObject *parent) : PlaylistDelegateBase(parent) {}
QString SongSourceDelegate::displayText(const QVariant &value, const QLocale&) const { QString SongSourceDelegate::displayText(const QVariant &value, const QLocale&) const {
return QString(); return QString();

View File

@@ -172,14 +172,13 @@ class NativeSeparatorsDelegate : public PlaylistDelegateBase {
class SongSourceDelegate : public PlaylistDelegateBase { class SongSourceDelegate : public PlaylistDelegateBase {
public: public:
SongSourceDelegate(QObject *parent, Player *player); SongSourceDelegate(QObject *parent);
QString displayText(const QVariant &value, const QLocale &locale) const; QString displayText(const QVariant &value, const QLocale &locale) const;
void paint(QPainter *paint, const QStyleOptionViewItem &option, const QModelIndex &index) const; void paint(QPainter *paint, const QStyleOptionViewItem &option, const QModelIndex &index) const;
private: private:
QPixmap LookupPixmap(const Song::Source &type, const QSize &size) const; QPixmap LookupPixmap(const Song::Source &type, const QSize &size) const;
Player *player_;
mutable QPixmapCache cache_; mutable QPixmapCache cache_;
}; };

View File

@@ -232,12 +232,7 @@ void PlaylistView::SetItemDelegates(CollectionBackend *backend) {
setItemDelegateForColumn(Playlist::Column_Filename, new NativeSeparatorsDelegate(this)); setItemDelegateForColumn(Playlist::Column_Filename, new NativeSeparatorsDelegate(this));
setItemDelegateForColumn(Playlist::Column_LastPlayed, new LastPlayedItemDelegate(this)); setItemDelegateForColumn(Playlist::Column_LastPlayed, new LastPlayedItemDelegate(this));
if (app_ && app_->player()) { setItemDelegateForColumn(Playlist::Column_Source, new SongSourceDelegate(this));
setItemDelegateForColumn(Playlist::Column_Source, new SongSourceDelegate(this, app_->player()));
}
else {
header_->HideSection(Playlist::Column_Source);
}
} }

View File

@@ -163,7 +163,6 @@ void TidalService::HandleAuthReply(QNetworkReply *reply, int search_id) {
login_sent_ = false; login_sent_ = false;
//int http_status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (reply->error() != QNetworkReply::NoError) { if (reply->error() != QNetworkReply::NoError) {
if (reply->error() < 200) { if (reply->error() < 200) {
// This is a network error, there is nothing more to do. // This is a network error, there is nothing more to do.
@@ -308,7 +307,6 @@ QJsonObject TidalService::ExtractJsonObj(QNetworkReply *reply, bool sendlogin) {
QByteArray data; QByteArray data;
//int http_status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (reply->error() == QNetworkReply::NoError) { if (reply->error() == QNetworkReply::NoError) {
data = reply->readAll(); data = reply->readAll();
} }
@@ -450,8 +448,8 @@ void TidalService::CancelSearch() {
} }
void TidalService::ClearSearch() { void TidalService::ClearSearch() {
search_id_ = 0; search_id_ = 0;
search_text_ = QString(); search_text_.clear();
search_error_ = QString(); search_error_.clear();
albums_requested_ = 0; albums_requested_ = 0;
songs_requested_ = 0; songs_requested_ = 0;
albums_received_ = 0; albums_received_ = 0;

View File

@@ -57,7 +57,7 @@ class TidalService : public InternetService {
void CancelSearch(); void CancelSearch();
const bool login_sent() { return login_sent_; } const bool login_sent() { return login_sent_; }
const bool authenticated() { return (!session_id_.isEmpty() && !user_id_ == 0 && !country_code_.isEmpty()); } const bool authenticated() { return (!session_id_.isEmpty() && !country_code_.isEmpty()); }
signals: signals:
void Login(const int search_id = 0); void Login(const int search_id = 0);