change: preserve search term across different mod providers
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
@ -138,7 +138,16 @@ void ModPage::triggerSearch()
|
||||
updateSelectionButton();
|
||||
}
|
||||
|
||||
listModel->searchWithTerm(ui->searchEdit->text(), ui->sortByBox->currentIndex(), changed);
|
||||
listModel->searchWithTerm(getSearchTerm(), ui->sortByBox->currentIndex(), changed);
|
||||
}
|
||||
|
||||
QString ModPage::getSearchTerm() const
|
||||
{
|
||||
return ui->searchEdit->text();
|
||||
}
|
||||
void ModPage::setSearchTerm(QString term)
|
||||
{
|
||||
ui->searchEdit->setText(term);
|
||||
}
|
||||
|
||||
void ModPage::onSelectionChanged(QModelIndex first, QModelIndex second)
|
||||
|
@ -45,6 +45,11 @@ class ModPage : public QWidget, public BasePage {
|
||||
auto getFilter() const -> const std::shared_ptr<ModFilterWidget::Filter> { return m_filter; }
|
||||
auto getDialog() const -> const ModDownloadDialog* { return dialog; }
|
||||
|
||||
/** Get the current term in the search bar. */
|
||||
auto getSearchTerm() const -> QString;
|
||||
/** Programatically set the term in the search bar. */
|
||||
void setSearchTerm(QString);
|
||||
|
||||
auto getCurrent() -> ModPlatform::IndexedPack& { return current; }
|
||||
void updateModVersions(int prev_count = -1);
|
||||
|
||||
|
Reference in New Issue
Block a user