| 130 | } |
| 131 | |
| 132 | SourceSelection SourceSelectionWidget::CurrentSelection() |
| 133 | { |
| 134 | SourceSelection s; |
| 135 | const int idx = currentIndex(); |
| 136 | const auto name = currentText(); |
| 137 | if (idx == -1 || name.isEmpty()) { |
| 138 | return s; |
| 139 | } |
| 140 | |
| 141 | if (idx < _variablesEndIdx) { |
| 142 | s._type = SourceSelection::Type::VARIABLE; |
| 143 | s._variable = GetWeakVariableByQString(name); |
| 144 | } else if (idx < _sourcesEndIdx) { |
| 145 | s._type = SourceSelection::Type::SOURCE; |
| 146 | s._source = GetWeakSourceByQString(name); |
| 147 | } |
| 148 | return s; |
| 149 | } |
| 150 | |
| 151 | void SourceSelectionWidget::Reset() |
| 152 | { |
nothing calls this directly
no test coverage detected