| 152 | } |
| 153 | |
| 154 | FilterSelection FilterSelectionWidget::CurrentSelection() |
| 155 | { |
| 156 | FilterSelection s; |
| 157 | const int idx = currentIndex(); |
| 158 | const auto name = currentText(); |
| 159 | if (idx == -1 || name.isEmpty()) { |
| 160 | return s; |
| 161 | } |
| 162 | |
| 163 | if (idx < _allEndIdx) { |
| 164 | s._type = FilterSelection::Type::ALL; |
| 165 | } else if (idx < _variablesEndIdx) { |
| 166 | s._type = FilterSelection::Type::VARIABLE; |
| 167 | s._variable = GetWeakVariableByQString(name); |
| 168 | } else if (idx < _filterEndIdx) { |
| 169 | s._type = FilterSelection::Type::SOURCE; |
| 170 | s._filter = GetWeakSourceByQString(name); |
| 171 | s._filterName = name.toStdString(); |
| 172 | } |
| 173 | return s; |
| 174 | } |
| 175 | |
| 176 | void FilterSelectionWidget::Reset() |
| 177 | { |
nothing calls this directly
no test coverage detected