@ -117,7 +117,7 @@ auto ModpackListModel::data(const QModelIndex& index, int role) const -> QVarian
|
||||
return {};
|
||||
}
|
||||
|
||||
bool ModpackListModel::setData(const QModelIndex &index, const QVariant &value, [[maybe_unused]] int role)
|
||||
bool ModpackListModel::setData(const QModelIndex& index, const QVariant& value, [[maybe_unused]] int role)
|
||||
{
|
||||
int pos = index.row();
|
||||
if (pos >= modpacks.size() || pos < 0 || !index.isValid())
|
||||
@ -183,24 +183,24 @@ void ModpackListModel::refresh()
|
||||
|
||||
static auto sortFromIndex(int index) -> QString
|
||||
{
|
||||
switch(index){
|
||||
default:
|
||||
case 0:
|
||||
return "relevance";
|
||||
case 1:
|
||||
return "downloads";
|
||||
case 2:
|
||||
return "follows";
|
||||
case 3:
|
||||
return "newest";
|
||||
case 4:
|
||||
return "updated";
|
||||
switch (index) {
|
||||
default:
|
||||
case 0:
|
||||
return "relevance";
|
||||
case 1:
|
||||
return "downloads";
|
||||
case 2:
|
||||
return "follows";
|
||||
case 3:
|
||||
return "newest";
|
||||
case 4:
|
||||
return "updated";
|
||||
}
|
||||
}
|
||||
|
||||
void ModpackListModel::searchWithTerm(const QString& term, const int sort)
|
||||
{
|
||||
if(sort > 5 || sort < 0)
|
||||
if (sort > 5 || sort < 0)
|
||||
return;
|
||||
|
||||
auto sort_str = sortFromIndex(sort);
|
||||
|
Reference in New Issue
Block a user