Change bool/int condition

This commit is contained in:
Jonas Kvinge
2021-06-22 13:54:58 +02:00
parent 58a5367015
commit 584f5e5935
34 changed files with 61 additions and 61 deletions

View File

@@ -49,7 +49,7 @@ PlaylistGeneratorInserter::PlaylistGeneratorInserter(TaskManager *task_manager,
PlaylistItemList PlaylistGeneratorInserter::Generate(PlaylistGeneratorPtr generator, int dynamic_count) {
if (dynamic_count) {
if (dynamic_count > 0) {
return generator->GenerateMore(dynamic_count);
}
else {

View File

@@ -77,7 +77,7 @@ PlaylistItemList PlaylistQueryGenerator::GenerateMore(const int count) {
SmartPlaylistSearch search_copy = search_;
search_copy.id_not_in_ = previous_ids_;
if (count) {
if (count > 0) {
search_copy.limit_ = count;
}

View File

@@ -94,7 +94,7 @@ QString SmartPlaylistSearch::ToSql(const QString &songs_table) const {
}
// Add limit
if (first_item_) {
if (first_item_ > 0) {
sql += QString(" LIMIT %1 OFFSET %2").arg(limit_).arg(first_item_);
}
else if (limit_ != -1) {

View File

@@ -130,7 +130,7 @@ void SmartPlaylistsModel::Init() {
}
// Save the defaults if there are any unwritten ones
if (unwritten_defaults) {
if (unwritten_defaults > 0) {
// How many items are stored already?
int playlist_index = s.beginReadArray(backend_->songs_table());
s.endArray();