diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2018-12-27 04:37:23 -0600 |
|---|---|---|
| committer | LostDragonist <lost.dragonist@gmail.com> | 2018-12-27 04:37:23 -0600 |
| commit | b397e0bc5d16de286075b09f2c95b3d059f9368b (patch) | |
| tree | 946d885576184ebad66a12b35285cc0237f7b85f /src/mainwindow.cpp | |
| parent | 4cc371ab8443b620fd05740eeec9e25ab2cec4d5 (diff) | |
Simplify code for visible counter changes
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c4c007f8..d11bf4b4 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3175,11 +3175,7 @@ void MainWindow::updateModCount() }
}
- if (m_ModListSortProxy->isFilterActive()) {
- ui->activeModsCounter->display(visActiveCount);
- } else {
- ui->activeModsCounter->display(activeCount);
- }
+ ui->activeModsCounter->display(visActiveCount);
ui->activeModsCounter->setToolTip(tr("<table cellspacing=\"5\">"
"<tr><th>Type</th><th>All</th><th>Visible</th>"
"<tr><td>Enabled mods: </td><td align=right>%1 / %2</td><td align=right>%3 / %4</td></tr>"
@@ -3215,7 +3211,7 @@ void MainWindow::updatePluginCount() for (QString plugin : list->pluginNames()) {
bool active = list->isEnabled(plugin);
- bool visible = plugin.contains(filter, Qt::CaseInsensitive);
+ bool visible = m_PluginListSortProxy->filterMatchesPlugin(plugin);
if (list->isMaster(plugin)) {
masterCount++;
activeMasterCount += active;
@@ -3234,11 +3230,7 @@ void MainWindow::updatePluginCount() int activeCount = activeMasterCount + activeLightMasterCount + activeRegularCount;
int totalCount = masterCount + lightMasterCount + regularCount;
- if (!filter.isEmpty()) {
- ui->activePluginsCounter->display(activeVisibleCount);
- } else {
- ui->activePluginsCounter->display(activeCount);
- }
+ ui->activePluginsCounter->display(activeVisibleCount);
ui->activePluginsCounter->setToolTip(tr("<table cellspacing=\"4\">"
"<tr><th>Type</th><th>Active</th><th>Total</th></tr>"
"<tr><td>Active plugins:</td><td align=right>%1</td><td align=right>%2</td></tr>"
|
