Skip to content

Commit

Permalink
[GUI] guarding dashboard txs list filter load from settings against u…
Browse files Browse the repository at this point in the history
…nknown values.

Preventing any possible not expected `transactionType` value stored that doesn't map with any available filter.
  • Loading branch information
furszy committed Jan 29, 2021
1 parent b108c37 commit a3eea8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/qt/pivx/dashboardwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ void DashboardWidget::loadWalletModel()

// Read filter settings
QSettings settings;
int filterByType = settings.value("transactionType", TransactionFilterProxy::ALL_TYPES).toInt();

filter->setTypeFilter(filterByType); // Set filter
quint32 filterByType = settings.value("transactionType", TransactionFilterProxy::ALL_TYPES).toInt();
int filterIndex = ui->comboBoxSortType->findData(filterByType); // Find index
filterByType = (filterIndex == -1) ? TransactionFilterProxy::ALL_TYPES : filterByType;
filter->setTypeFilter(filterByType); // Set filter
ui->comboBoxSortType->setCurrentIndex(filterIndex); // Set item in ComboBox

// Read sort settings
Expand Down

0 comments on commit a3eea8c

Please sign in to comment.