| 190 | } |
| 191 | |
| 192 | void BaseFileDataProvider::setFilterText(const QString& text) |
| 193 | { |
| 194 | int pathLength; |
| 195 | KTextEditorHelpers::extractCursor(text, &pathLength); |
| 196 | QString path(text.mid(0, pathLength)); |
| 197 | if (path.startsWith(QLatin1String("./")) || path.startsWith(QLatin1String("../"))) { |
| 198 | // assume we want to filter relative to active document's url |
| 199 | IDocument* doc = ICore::self()->documentController()->activeDocument(); |
| 200 | if (doc) { |
| 201 | path = Path(Path(doc->url()).parent(), path).pathOrUrl(); |
| 202 | } |
| 203 | } |
| 204 | setFilter(path.split(QLatin1Char('/'), Qt::SkipEmptyParts)); |
| 205 | } |
| 206 | |
| 207 | uint BaseFileDataProvider::itemCount() const |
| 208 | { |