diff --git a/src/file/basicindexingjob.h b/src/file/basicindexingjob.h --- a/src/file/basicindexingjob.h +++ b/src/file/basicindexingjob.h @@ -44,14 +44,6 @@ Document document() { return m_doc; } - /** - * Adds the data for all the extended attributes of \p url - * in the document \p doc - * - * \return Returns true if the \p doc was modified - */ - static bool indexXAttr(const QString& url, Document& doc); - private: static QVector typesForMimeType(const QString& mimeType); diff --git a/src/file/basicindexingjob.cpp b/src/file/basicindexingjob.cpp --- a/src/file/basicindexingjob.cpp +++ b/src/file/basicindexingjob.cpp @@ -41,6 +41,31 @@ { } +namespace { + +void indexXAttr(const QString& url, Document& doc) +{ + KFileMetaData::UserMetaData userMetaData(url); + TermGenerator tg(doc); + + QStringList tags = userMetaData.tags(); + for (const QString& tag : tags) { + tg.indexXattrText(tag, QByteArray("TA")); + doc.addXattrTerm(QByteArray("TAG-") + tag.toUtf8()); + } + + int rating = userMetaData.rating(); + if (rating) { + doc.addXattrTerm(QByteArray("R") + QByteArray::number(rating)); + } + + QString comment = userMetaData.userComment(); + if (!comment.isEmpty()) { + tg.indexXattrText(comment, QByteArray("C")); + } +} +} // namespace + BasicIndexingJob::~BasicIndexingJob() { } @@ -91,29 +116,6 @@ return true; } -bool BasicIndexingJob::indexXAttr(const QString& url, Document& doc) -{ - KFileMetaData::UserMetaData userMetaData(url); - TermGenerator tg(doc); - - QStringList tags = userMetaData.tags(); - for (const QString& tag : tags) { - tg.indexXattrText(tag, QByteArray("TA")); - doc.addXattrTerm(QByteArray("TAG-") + tag.toUtf8()); - } - - int rating = userMetaData.rating(); - if (rating) { - doc.addXattrTerm(QByteArray("R") + QByteArray::number(rating)); - } - - QString comment = userMetaData.userComment(); - if (!comment.isEmpty()) { - tg.indexXattrText(comment, QByteArray("C")); - } - - return (!tags.isEmpty() || rating || !comment.isEmpty()); -} QVector BasicIndexingJob::typesForMimeType(const QString& mimeType) {