| 118 | } |
| 119 | |
| 120 | bool QNapi::needToShowList() { |
| 121 | theBestIdx = 0; |
| 122 | |
| 123 | int i = 0; |
| 124 | bool foundBestIdx = false; |
| 125 | foreach (SubtitleInfo s, listSubtitles()) { |
| 126 | if (s.resolution == SUBTITLE_GOOD) { |
| 127 | theBestIdx = i; |
| 128 | foundBestIdx = true; |
| 129 | break; |
| 130 | } |
| 131 | ++i; |
| 132 | } |
| 133 | |
| 134 | if (config.generalConfig().downloadPolicy() == DP_ALWAYS_SHOW_LIST) |
| 135 | return true; |
| 136 | if (config.generalConfig().downloadPolicy() == DP_NEVER_SHOW_LIST) |
| 137 | return false; |
| 138 | |
| 139 | if (listSubtitles().size() <= 1) return false; |
| 140 | |
| 141 | return !foundBestIdx; |
| 142 | } |
| 143 | |
| 144 | int QNapi::bestIdx() { return theBestIdx; } |
| 145 |
no test coverage detected