Formatting
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user