Changeset View
Changeset View
Standalone View
Standalone View
src/file/extractor/result.cpp
Show All 26 Lines | |||||
27 | 27 | | |||
28 | #include <QDateTime> | 28 | #include <QDateTime> | ||
29 | #include <KFileMetaData/PropertyInfo> | 29 | #include <KFileMetaData/PropertyInfo> | ||
30 | #include <KFileMetaData/TypeInfo> | 30 | #include <KFileMetaData/TypeInfo> | ||
31 | 31 | | |||
32 | // In order to use it in a vector | 32 | // In order to use it in a vector | ||
33 | Result::Result() | 33 | Result::Result() | ||
34 | : ExtractionResult(QString(), QString()) | 34 | : ExtractionResult(QString(), QString()) | ||
35 | , m_docId(0) | | |||
36 | , m_termGen(nullptr) | 35 | , m_termGen(nullptr) | ||
37 | , m_termGenForText(nullptr) | 36 | , m_termGenForText(nullptr) | ||
38 | { | 37 | { | ||
39 | } | 38 | } | ||
40 | 39 | | |||
41 | Result::Result(const QString& url, const QString& mimetype, const Flags& flags) | 40 | Result::Result(const QString& url, const QString& mimetype, const Flags& flags) | ||
42 | : KFileMetaData::ExtractionResult(url, mimetype, flags) | 41 | : KFileMetaData::ExtractionResult(url, mimetype, flags) | ||
43 | , m_docId(0) | | |||
44 | , m_termGen(nullptr) | 42 | , m_termGen(nullptr) | ||
45 | , m_termGenForText(nullptr) | 43 | , m_termGenForText(nullptr) | ||
46 | { | 44 | { | ||
47 | } | 45 | } | ||
48 | 46 | | |||
49 | void Result::add(KFileMetaData::Property::Property property, const QVariant& value) | 47 | void Result::add(KFileMetaData::Property::Property property, const QVariant& value) | ||
50 | { | 48 | { | ||
51 | int propNum = static_cast<int>(property); | 49 | int propNum = static_cast<int>(property); | ||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | 131 | { | |||
137 | m_termGen.setPosition(1000); | 135 | m_termGen.setPosition(1000); | ||
138 | 136 | | |||
139 | // All document plain text starts from 10000. This is done to avoid | 137 | // All document plain text starts from 10000. This is done to avoid | ||
140 | // clashes with the term positions | 138 | // clashes with the term positions | ||
141 | m_termGenForText.setDocument(&m_doc); | 139 | m_termGenForText.setDocument(&m_doc); | ||
142 | m_termGenForText.setPosition(10000); | 140 | m_termGenForText.setPosition(10000); | ||
143 | } | 141 | } | ||
144 | 142 | | |||
145 | quint64 Result::id() const | | |||
146 | { | | |||
147 | return m_docId; | | |||
148 | } | | |||
149 | | ||||
150 | QVariantMap Result::map() const | 143 | QVariantMap Result::map() const | ||
151 | { | 144 | { | ||
152 | return m_map; | 145 | return m_map; | ||
153 | } | 146 | } |