MCPcopy Create free account
hub / github.com/KDE/kdevelop / checkFilters

Method checkFilters

plugins/projectfilter/projectfilterconfigpage.cpp:165–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165void 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
189void ProjectFilterConfigPage::checkFiltersAndEmitChanged()
190{

Callers

nothing calls this directly

Calls 5

endsWithMethod · 0.80
setMessageTypeMethod · 0.80
filtersMethod · 0.45
isEmptyMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected