Changeset View
Changeset View
Standalone View
Standalone View
src/file/basicindexingjob.cpp
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 49 | { | |||
---|---|---|---|---|---|
55 | } | 55 | } | ||
56 | 56 | | |||
57 | Document doc; | 57 | Document doc; | ||
58 | doc.setId(statBufToId(statBuf)); | 58 | doc.setId(statBufToId(statBuf)); | ||
59 | doc.setUrl(url); | 59 | doc.setUrl(url); | ||
60 | 60 | | |||
61 | QString fileName = url.mid(url.lastIndexOf('/') + 1); | 61 | QString fileName = url.mid(url.lastIndexOf('/') + 1); | ||
62 | 62 | | |||
63 | TermGenerator tg(&doc); | 63 | TermGenerator tg(doc); | ||
64 | tg.indexFileNameText(fileName); | 64 | tg.indexFileNameText(fileName); | ||
65 | tg.indexFileNameText(fileName, QByteArray("F")); | 65 | tg.indexFileNameText(fileName, QByteArray("F")); | ||
66 | tg.indexText(m_mimetype, QByteArray("M")); | 66 | tg.indexText(m_mimetype, QByteArray("M")); | ||
67 | 67 | | |||
68 | // (Content) Modification time, Metadata (e.g. XAttr) change time | 68 | // (Content) Modification time, Metadata (e.g. XAttr) change time | ||
69 | doc.setMTime(statBuf.st_mtime); | 69 | doc.setMTime(statBuf.st_mtime); | ||
70 | doc.setCTime(statBuf.st_ctime); | 70 | doc.setCTime(statBuf.st_ctime); | ||
71 | 71 | | |||
Show All 17 Lines | |||||
89 | 89 | | |||
90 | m_doc = doc; | 90 | m_doc = doc; | ||
91 | return true; | 91 | return true; | ||
92 | } | 92 | } | ||
93 | 93 | | |||
94 | bool BasicIndexingJob::indexXAttr(const QString& url, Document& doc) | 94 | bool BasicIndexingJob::indexXAttr(const QString& url, Document& doc) | ||
95 | { | 95 | { | ||
96 | KFileMetaData::UserMetaData userMetaData(url); | 96 | KFileMetaData::UserMetaData userMetaData(url); | ||
97 | TermGenerator tg(&doc); | 97 | TermGenerator tg(doc); | ||
98 | 98 | | |||
99 | QStringList tags = userMetaData.tags(); | 99 | QStringList tags = userMetaData.tags(); | ||
100 | for (const QString& tag : tags) { | 100 | for (const QString& tag : tags) { | ||
101 | tg.indexXattrText(tag, QByteArray("TA")); | 101 | tg.indexXattrText(tag, QByteArray("TA")); | ||
102 | doc.addXattrTerm(QByteArray("TAG-") + tag.toUtf8()); | 102 | doc.addXattrTerm(QByteArray("TAG-") + tag.toUtf8()); | ||
103 | } | 103 | } | ||
104 | 104 | | |||
105 | int rating = userMetaData.rating(); | 105 | int rating = userMetaData.rating(); | ||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |