Changeset View
Changeset View
Standalone View
Standalone View
src/lib/searchstore.cpp
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Line(s) | 160 | { | |||
---|---|---|---|---|---|
200 | 200 | | |||
201 | if (property == "type" || property == "kind") { | 201 | if (property == "type" || property == "kind") { | ||
202 | EngineQuery q = constructTypeQuery(value.toString()); | 202 | EngineQuery q = constructTypeQuery(value.toString()); | ||
203 | return tr->postingIterator(q); | 203 | return tr->postingIterator(q); | ||
204 | } | 204 | } | ||
205 | else if (property == "includefolder") { | 205 | else if (property == "includefolder") { | ||
206 | const QByteArray folder = QFile::encodeName(QFileInfo(value.toString()).canonicalFilePath()); | 206 | const QByteArray folder = QFile::encodeName(QFileInfo(value.toString()).canonicalFilePath()); | ||
207 | 207 | | |||
208 | Q_ASSERT(!folder.isEmpty()); | 208 | if (folder.isEmpty()) { | ||
209 | Q_ASSERT(folder.startsWith('/')); | 209 | return nullptr; | ||
210 | } | ||||
211 | if (!folder.startsWith('/')) { | ||||
212 | return nullptr; | ||||
213 | } | ||||
210 | 214 | | |||
211 | quint64 id = filePathToId(folder); | 215 | quint64 id = filePathToId(folder); | ||
212 | if (!id) { | 216 | if (!id) { | ||
213 | qDebug() << "Folder" << value.toString() << "does not exist"; | 217 | qDebug() << "Folder" << value.toString() << "does not exist"; | ||
214 | return nullptr; | 218 | return nullptr; | ||
215 | } | 219 | } | ||
216 | 220 | | |||
217 | return tr->docUrlIter(id); | 221 | return tr->docUrlIter(id); | ||
▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines |