Formatting

This commit is contained in:
Jonas Kvinge
2021-08-23 21:21:08 +02:00
parent ed7794f396
commit ea2bfbda44
111 changed files with 833 additions and 425 deletions

View File

@@ -96,8 +96,9 @@ PlaylistItemList PlaylistQueryGenerator::GenerateMore(const int count) {
items << PlaylistItemPtr(PlaylistItem::NewFromSong(song));
previous_ids_ << song.id();
if (previous_ids_.count() > GetDynamicFuture() + GetDynamicHistory())
if (previous_ids_.count() > GetDynamicFuture() + GetDynamicHistory()) {
previous_ids_.removeFirst();
}
}
return items;

View File

@@ -331,8 +331,9 @@ void SmartPlaylistQueryWizardPlugin::MoveTermListToBottom(int min, int max) {
Q_UNUSED(min);
// Only scroll to the bottom if a new term is added
if (previous_scrollarea_max_ < max)
if (previous_scrollarea_max_ < max) {
search_page_->ui_->terms_scroll_area->verticalScrollBar()->setValue(max);
}
previous_scrollarea_max_ = max;

View File

@@ -101,22 +101,29 @@ QString SmartPlaylistSearchTerm::ToSql() const {
case Op_EndsWith:
return col + " LIKE '%" + value + "'";
case Op_Equals:
if (TypeOf(field_) == Type_Text)
if (TypeOf(field_) == Type_Text) {
return col + " LIKE '" + value + "'";
else if (TypeOf(field_) == Type_Date || TypeOf(field_) == Type_Time || TypeOf(field_) == Type_Rating)
}
else if (TypeOf(field_) == Type_Date || TypeOf(field_) == Type_Time || TypeOf(field_) == Type_Rating) {
return col + " = " + value;
else
}
else {
return col + " = '" + value + "'";
}
case Op_GreaterThan:
if (TypeOf(field_) == Type_Date || TypeOf(field_) == Type_Time || TypeOf(field_) == Type_Rating)
if (TypeOf(field_) == Type_Date || TypeOf(field_) == Type_Time || TypeOf(field_) == Type_Rating) {
return col + " > " + value;
else
}
else {
return col + " > '" + value + "'";
}
case Op_LessThan:
if (TypeOf(field_) == Type_Date || TypeOf(field_) == Type_Time || TypeOf(field_) == Type_Rating)
if (TypeOf(field_) == Type_Date || TypeOf(field_) == Type_Time || TypeOf(field_) == Type_Rating) {
return col + " < " + value;
else
}
else {
return col + " < '" + value + "'";
}
case Op_NumericDate:
return col + " > " + "DATETIME('now', '-" + value + " " + date + "', 'localtime')";
case Op_NumericDateNot: