| 55 | } |
| 56 | |
| 57 | void PluginListView::updatePluginCount() |
| 58 | { |
| 59 | int activeMasterCount = 0; |
| 60 | int activeMediumMasterCount = 0; |
| 61 | int activeLightMasterCount = 0; |
| 62 | int activeRegularCount = 0; |
| 63 | int masterCount = 0; |
| 64 | int mediumMasterCount = 0; |
| 65 | int lightMasterCount = 0; |
| 66 | int regularCount = 0; |
| 67 | int activeVisibleCount = 0; |
| 68 | |
| 69 | PluginList* list = m_core->pluginList(); |
| 70 | QString filter = ui.filter->text(); |
| 71 | |
| 72 | for (QString plugin : list->pluginNames()) { |
| 73 | bool active = list->isEnabled(plugin); |
| 74 | bool visible = m_sortProxy->filterMatchesPlugin(plugin); |
| 75 | if (list->isMediumFlagged(plugin)) { |
| 76 | mediumMasterCount++; |
| 77 | activeMediumMasterCount += active; |
| 78 | activeVisibleCount += visible && active; |
| 79 | } else if (list->hasLightExtension(plugin) || list->isLightFlagged(plugin)) { |
| 80 | lightMasterCount++; |
| 81 | activeLightMasterCount += active; |
| 82 | activeVisibleCount += visible && active; |
| 83 | } else if (list->hasMasterExtension(plugin) || list->isMasterFlagged(plugin)) { |
| 84 | masterCount++; |
| 85 | activeMasterCount += active; |
| 86 | activeVisibleCount += visible && active; |
| 87 | } else { |
| 88 | regularCount++; |
| 89 | activeRegularCount += active; |
| 90 | activeVisibleCount += visible && active; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | int activeCount = activeMasterCount + activeMediumMasterCount + |
| 95 | activeLightMasterCount + activeRegularCount; |
| 96 | int totalCount = masterCount + mediumMasterCount + lightMasterCount + regularCount; |
| 97 | |
| 98 | ui.counter->display(activeVisibleCount); |
| 99 | ui.counter->setToolTip( |
| 100 | tr("<table cellspacing=\"6\">" |
| 101 | "<tr><th>Type</th><th>Active </th><th>Total</th></tr>" |
| 102 | "<tr><td>All plugins:</td><td align=right>%1 </td><td " |
| 103 | "align=right>%2</td></tr>" |
| 104 | "<tr><td>ESMs:</td><td align=right>%3 </td><td align=right>%4</td></tr>" |
| 105 | "<tr><td>ESPs:</td><td align=right>%7 </td><td align=right>%8</td></tr>" |
| 106 | "<tr><td>ESMs+ESPs:</td><td align=right>%9 </td><td " |
| 107 | "align=right>%10</td></tr>" |
| 108 | "<tr><td>ESHs:</td><td align=right>%11 </td><td align=right>%12</td></tr>" |
| 109 | "<tr><td>ESLs:</td><td align=right>%5 </td><td align=right>%6</td></tr>" |
| 110 | "</table>") |
| 111 | .arg(activeCount) |
| 112 | .arg(totalCount) |
| 113 | .arg(activeMasterCount) |
| 114 | .arg(masterCount) |
no test coverage detected