| 117 | } |
| 118 | |
| 119 | void TwitchCategorySelection::SetCategory(const TwitchCategory &id) |
| 120 | { |
| 121 | // If the list is populated already try to find id ... |
| 122 | int index = findData(id.id); |
| 123 | if (index != -1) { |
| 124 | setCurrentIndex(index); |
| 125 | return; |
| 126 | } |
| 127 | |
| 128 | if (id.id == -1) { |
| 129 | setCurrentIndex(-1); |
| 130 | return; |
| 131 | } |
| 132 | |
| 133 | // ... otherwise just add a dummy entry with the category name |
| 134 | addItem(QString::fromStdString(id.name), id.id); |
| 135 | setCurrentIndex(findData(id.id)); |
| 136 | } |
| 137 | |
| 138 | void TwitchCategorySelection::SelectionChanged(int index) |
| 139 | { |
no outgoing calls
no test coverage detected