Changeset View
Changeset View
Standalone View
Standalone View
src/file/indexcleaner.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 47 | auto shouldDelete = [&](quint64 id) { | |||
---|---|---|---|---|---|
65 | QString mimetype = mimeDb.mimeTypeForFile(url, QMimeDatabase::MatchExtension).name(); | 65 | QString mimetype = mimeDb.mimeTypeForFile(url, QMimeDatabase::MatchExtension).name(); | ||
66 | if (!m_config->shouldMimeTypeBeIndexed(mimetype)) { | 66 | if (!m_config->shouldMimeTypeBeIndexed(mimetype)) { | ||
67 | qDebug() << "mimetype should not be indexed: " << url << mimetype; | 67 | qDebug() << "mimetype should not be indexed: " << url << mimetype; | ||
68 | return true; | 68 | return true; | ||
69 | } | 69 | } | ||
70 | 70 | | |||
71 | return false; | 71 | return false; | ||
72 | }; | 72 | }; | ||
73 | 73 | tr.removeRecursively(0, shouldDelete); | |||
74 | const auto includeFolders = m_config->includeFolders(); | | |||
75 | for (const QString& folder : includeFolders) { | | |||
76 | quint64 id = filePathToId(QFile::encodeName(folder)); | | |||
77 | tr.removeRecursively(id, shouldDelete); | | |||
78 | } | | |||
79 | tr.commit(); | 74 | tr.commit(); | ||
80 | 75 | | |||
81 | Q_EMIT done(); | 76 | Q_EMIT done(); | ||
82 | } | 77 | } |