Add missing const
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
#include <memory>
|
||||
|
||||
#include <QWizardPage>
|
||||
@@ -183,7 +184,7 @@ void SmartPlaylistQueryWizardPlugin::SetGenerator(PlaylistGeneratorPtr g) {
|
||||
qDeleteAll(search_page_->terms_);
|
||||
search_page_->terms_.clear();
|
||||
|
||||
for (const SmartPlaylistSearchTerm &term : search.terms_) {
|
||||
for (const SmartPlaylistSearchTerm &term : std::as_const(search.terms_)) {
|
||||
AddSearchTerm();
|
||||
search_page_->terms_.last()->SetTerm(term);
|
||||
}
|
||||
@@ -290,7 +291,7 @@ SmartPlaylistSearch SmartPlaylistQueryWizardPlugin::MakeSearch() const {
|
||||
ret.search_type_ = static_cast<SmartPlaylistSearch::SearchType>(search_page_->ui_->type->currentIndex());
|
||||
|
||||
// Search terms
|
||||
for (SmartPlaylistSearchTermWidget *widget : search_page_->terms_) {
|
||||
for (SmartPlaylistSearchTermWidget *widget : std::as_const(search_page_->terms_)) {
|
||||
SmartPlaylistSearchTerm term = widget->Term();
|
||||
if (term.is_valid()) ret.terms_ << term;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,8 @@ void SmartPlaylistSearchTermWidget::FieldChanged(int index) {
|
||||
// Populate the operator combo box
|
||||
if (type != current_field_type_) {
|
||||
ui_->op->clear();
|
||||
for (const SmartPlaylistSearchTerm::Operator op : SmartPlaylistSearchTerm::OperatorsForType(type)) {
|
||||
const SmartPlaylistSearchTerm::OperatorList operators = SmartPlaylistSearchTerm::OperatorsForType(type);
|
||||
for (const SmartPlaylistSearchTerm::Operator op : operators) {
|
||||
const int i = ui_->op->count();
|
||||
ui_->op->addItem(SmartPlaylistSearchTerm::OperatorText(type, op));
|
||||
ui_->op->setItemData(i, QVariant::fromValue(op));
|
||||
|
||||
Reference in New Issue
Block a user