Changeset View
Standalone View
src/file/extractor/result.h
Show All 22 Lines | |||||
23 | #ifndef EXTRACTIONRESULT_H | 23 | #ifndef EXTRACTIONRESULT_H | ||
24 | #define EXTRACTIONRESULT_H | 24 | #define EXTRACTIONRESULT_H | ||
25 | 25 | | |||
26 | #include <KFileMetaData/ExtractionResult> | 26 | #include <KFileMetaData/ExtractionResult> | ||
27 | 27 | | |||
28 | #include "document.h" | 28 | #include "document.h" | ||
29 | #include "termgenerator.h" | 29 | #include "termgenerator.h" | ||
30 | 30 | | |||
31 | /** | ||||
32 | * \class Result result.h | ||||
33 | * | ||||
34 | * \brief The result class is where all the data extracted by | ||||
35 | * the KFileMetaData extractors is saved to. | ||||
bruns: Remove the last part of the sentence - `... is saved to.`. Everything else is an implementation… | |||||
36 | * It implements the KFileMetaData::ExtractionResult interface. | ||||
37 | * The results can be retrieved as a Baloo::Document using | ||||
`The results can be retrieved as a Baloo::Document using \c document() and bruns: `The results can be retrieved as a Baloo::Document using \c document() and
stored in the… | |||||
38 | * \c document() and stored in the database. | ||||
39 | * | ||||
40 | */ | ||||
31 | class Result : public KFileMetaData::ExtractionResult | 41 | class Result : public KFileMetaData::ExtractionResult | ||
32 | { | 42 | { | ||
33 | public: | 43 | public: | ||
34 | Result(); | 44 | Result(); | ||
35 | Result(const QString& url, const QString& mimetype, const Flags& flags = ExtractEverything); | 45 | Result(const QString& url, const QString& mimetype, const Flags& flags = ExtractEverything); | ||
36 | 46 | | |||
37 | void add(KFileMetaData::Property::Property property, const QVariant& value) override; | 47 | void add(KFileMetaData::Property::Property property, const QVariant& value) override; | ||
38 | void append(const QString& text) override; | 48 | void append(const QString& text) override; | ||
bruns: This is no overload, but an override/reimplementation. | |||||
39 | void addType(KFileMetaData::Type::Type type) override; | 49 | void addType(KFileMetaData::Type::Type type) override; | ||
40 | 50 | | |||
51 | /** | ||||
I think a \sa KFileMetaData::Property is sufficient here. Also, its not a property name, that would be something like a QString. bruns: I think a `\sa KFileMetaData::Property` is sufficient here. Also, its not a property //name//… | |||||
Qt uses "Reimplemented from KFileMetaData::ExtractionResult::addtype()`, see e.g. http://doc.qt.io/qt-5/qfile.html#fileName Overriden has a typo, "Overridden" But I think you should remove the (docstring) comment, it should automatically pick up the description from the interface class. bruns: Qt uses "Reimplemented from KFileMetaData::ExtractionResult::addtype()`, see e.g. http://doc.qt. | |||||
52 | * Can be used to add extraction results to an existing | ||||
53 | * Baloo::Document. Has to be called before passing the | ||||
yurchor: This should be `\param`
https://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdp
https… | |||||
yurchor: Same here. | |||||
54 | * Result to KFileMetaData::Extractor::extract(). | ||||
yurchor: Same here. | |||||
55 | * \param doc The Baloo::Document | ||||
56 | */ | ||||
yurchor: Same here. | |||||
41 | void setDocument(const Baloo::Document& doc); | 57 | void setDocument(const Baloo::Document& doc); | ||
The use case is missing here. bruns: The use case is missing here.
`Can be used to add extraction results to an existing Baloo… | |||||
42 | 58 | | |||
59 | /** | ||||
60 | * Returns the Baloo document to which the results from the extractors | ||||
61 | * are saved. | ||||
Thats not correct, see implementation of Result::add(...) QString p = QString::number(propnum) But as m_map/map() is never used outside Result (only in Result::finish), it is best to remove the getter completely. D17312 bruns: Thats not correct, see implementation of `Result::add(...)`
`QString p = QString::number… | |||||
62 | */ | ||||
43 | Baloo::Document& document() { | 63 | Baloo::Document& document() { | ||
44 | return m_doc; | 64 | return m_doc; | ||
45 | } | 65 | } | ||
46 | 66 | | |||
47 | /** | 67 | /** | ||
48 | * Applies the finishing touches on the document, and makes | 68 | * Applies the finishing touches on the document, and makes | ||
49 | * it ready to be pushed into the db | 69 | * it ready to be pushed into the db. | ||
50 | */ | 70 | */ | ||
51 | void finish(); | 71 | void finish(); | ||
52 | 72 | | |||
53 | private: | 73 | private: | ||
74 | /** | ||||
75 | * The document that represents the file that is to be indexed. | ||||
76 | */ | ||||
54 | Baloo::Document m_doc; | 77 | Baloo::Document m_doc; | ||
78 | /** | ||||
79 | * Contains the collection of words of the metadata. | ||||
bruns: Nitpick - missing full stop, also below. | |||||
The TermGenerator's do not contain any data themselves, but
bruns: The TermGenerator's do not contain any data themselves, but
- keep/update the position state… | |||||
Would be nice if you could add that information to the TermGenerator :) astippich: Would be nice if you could add that information to the TermGenerator :) | |||||
80 | */ | ||||
55 | Baloo::TermGenerator m_termGen; | 81 | Baloo::TermGenerator m_termGen; | ||
82 | /** | ||||
83 | * Contains the collection of words of plain text. | ||||
84 | */ | ||||
56 | Baloo::TermGenerator m_termGenForText; | 85 | Baloo::TermGenerator m_termGenForText; | ||
57 | 86 | /** | |||
87 | * Contains all indexed property data from the extractors. | ||||
bruns: Only properties | |||||
88 | */ | ||||
58 | QVariantMap m_map; | 89 | QVariantMap m_map; | ||
59 | }; | 90 | }; | ||
60 | 91 | | |||
61 | #endif // EXTRACTIONRESULT_H | 92 | #endif // EXTRACTIONRESULT_H |
Remove the last part of the sentence - ... is saved to.. Everything else is an implementation detail.