| 163 | } |
| 164 | |
| 165 | void ProjectFilterConfigPage::checkFilters() |
| 166 | { |
| 167 | // check for errors, only show one error at once |
| 168 | QString errorText; |
| 169 | const auto filters = m_model->filters(); |
| 170 | for (const auto& filter : filters) { |
| 171 | if (filter.pattern.isEmpty()) { |
| 172 | errorText = i18n("A filter with an empty pattern will match all items. Use <code>\"*\"</code> to make this explicit."); |
| 173 | break; |
| 174 | } else if (filter.pattern.endsWith(QLatin1Char('/')) && filter.targets == Filter::Files) { |
| 175 | errorText = i18n("A filter ending on <code>\"/\"</code> can never match a file."); |
| 176 | break; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | if (!errorText.isEmpty()) { |
| 181 | m_ui->messageWidget->setMessageType(KMessageWidget::Error); |
| 182 | m_ui->messageWidget->setText(errorText); |
| 183 | m_ui->messageWidget->animatedShow(); |
| 184 | } else { |
| 185 | m_ui->messageWidget->animatedHide(); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | void ProjectFilterConfigPage::checkFiltersAndEmitChanged() |
| 190 | { |
nothing calls this directly
no test coverage detected