Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportDesign.h
Show All 33 Lines | |||||
34 | /*! It is used by KReportDesign::setContent(). */ | 34 | /*! It is used by KReportDesign::setContent(). */ | ||
35 | class KREPORT_EXPORT KReportDesignReadingStatus | 35 | class KREPORT_EXPORT KReportDesignReadingStatus | ||
36 | { | 36 | { | ||
37 | public: | 37 | public: | ||
38 | //! Creates an empty status object. | 38 | //! Creates an empty status object. | ||
39 | /*! For empty status objects isError() returns false. */ | 39 | /*! For empty status objects isError() returns false. */ | ||
40 | KReportDesignReadingStatus(); | 40 | KReportDesignReadingStatus(); | ||
41 | 41 | | |||
42 | ~KReportDesignReadingStatus(); | ||||
43 | KReportDesignReadingStatus(const KReportDesignReadingStatus &other); | ||||
44 | KReportDesignReadingStatus operator=(const KReportDesignReadingStatus &other); | ||||
staniek: The return value needs to be `KReportDesignReadingStatus&` | |||||
45 | | ||||
42 | //! @return true if the status is error. | 46 | //! @return true if the status is error. | ||
43 | //! Equivalent of lineNumber >= 0. | 47 | //! Equivalent of errorLineNumber() >= 0 && errorColumnNumber() >= 0. | ||
-> Equivalent of errorLineNumber() >= 0 && errorColumnNumber() >= 0. And let's change implementation accordingly. staniek: ->
`Equivalent of errorLineNumber() >= 0 && errorColumnNumber() >= 0.`
And let's change… | |||||
44 | bool isError() const; | 48 | bool isError() const; | ||
45 | 49 | | |||
46 | //! Error message suitable for displaying to the user, translated. | 50 | //! Error message suitable for displaying to the user, translated. | ||
47 | QString errorMessage; | 51 | QString errorMessage() const; | ||
48 | 52 | | |||
49 | //! Detailed error message, partially translated. | 53 | //! Detailed error message, partially translated. | ||
50 | QString errorDetails; | 54 | QString errorDetails() const; | ||
51 | 55 | | |||
52 | //! Line number (counting from 0) in which the error occured. -1 if there is no error. | 56 | //! Line number (counting from 0) in which the error occured. -1 if there is no error. | ||
53 | int lineNumber; | 57 | int errorLineNumber() const; | ||
54 | 58 | | |||
55 | //! Column number (counting from 0) in which the error occured. -1 if there is no error. | 59 | //! Column number (counting from 0) in which the error occured. -1 if there is no error. | ||
56 | int columnNumber; | 60 | int errorColumnNumber() const; | ||
61 | | ||||
62 | void setErrorMessage(const QString& msg); | ||||
63 | void setErrorDetails(const QString& details); | ||||
staniek: In case of methods that return by value non-const overload is not needed. | |||||
64 | void setErrorLineNumber(int line); | ||||
65 | void setErrorColumnNumber(int column); | ||||
staniek: Symmetry: errorLineNumber | |||||
66 | | ||||
staniek: Same here | |||||
67 | private: | ||||
68 | class Private; | ||||
staniek: Symmetry: errorColumnNumber | |||||
69 | Private * const d; | ||||
staniek: Same here | |||||
57 | }; | 70 | }; | ||
58 | 71 | | |||
59 | //! Sends information about the reading status @a status to debug output @a dbg. | 72 | //! Sends information about the reading status @a status to debug output @a dbg. | ||
60 | KREPORT_EXPORT QDebug operator<<(QDebug dbg, const KReportDesignReadingStatus& status); | 73 | KREPORT_EXPORT QDebug operator<<(QDebug dbg, const KReportDesignReadingStatus& status); | ||
staniek: setErrorLineNumber (similar to what Qt uses in some XML or DOM APIs) | |||||
61 | 74 | | |||
staniek: Symmetry: setErrorColumnNumber | |||||
62 | //! The KReportDesign class represents a report design in .kreport format | 75 | //! The KReportDesign class represents a report design in .kreport format | ||
63 | class KREPORT_EXPORT KReportDesign | 76 | class KREPORT_EXPORT KReportDesign | ||
64 | { | 77 | { | ||
KReportDesignReadingStatus would benefit from a copy ctor and operator=. Actually it's not that hard as the Private class is easily copyable because all its members are values. staniek: KReportDesignReadingStatus would benefit from a copy ctor and operator=. Actually it's not… | |||||
65 | Q_DECLARE_TR_FUNCTIONS(KReportDesign) | 78 | Q_DECLARE_TR_FUNCTIONS(KReportDesign) | ||
66 | public: | 79 | public: | ||
67 | KReportDesign(); | 80 | KReportDesign(); | ||
68 | 81 | | |||
69 | ~KReportDesign(); | 82 | ~KReportDesign(); | ||
70 | 83 | | |||
71 | //! Reads the XML document in .kreport format from the string @a text | 84 | //! Reads the XML document in .kreport format from the string @a text | ||
72 | //! @return true if the content was successfully parsed | 85 | //! @return true if the content was successfully parsed | ||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |
The return value needs to be KReportDesignReadingStatus&