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 | | ||||
42 | //! @return true if the status is error. | 44 | //! @return true if the status is error. | ||
staniek: The return value needs to be `KReportDesignReadingStatus&` | |||||
43 | //! Equivalent of lineNumber >= 0. | 45 | //! Equivalent of lineNumber >= 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; | 46 | bool isError() const; | ||
45 | 47 | | |||
46 | //! Error message suitable for displaying to the user, translated. | 48 | QString errorMessage() const; | ||
47 | QString errorMessage; | 49 | QString errorMessage(); | ||
48 | 50 | QString errorDetails() const; | |||
49 | //! Detailed error message, partially translated. | 51 | QString errorDetails(); | ||
staniek: In case of methods that return by value non-const overload is not needed. | |||||
50 | QString errorDetails; | 52 | | ||
51 | 53 | int lineNumber() const; | |||
staniek: Symmetry: errorLineNumber | |||||
52 | //! Line number (counting from 0) in which the error occured. -1 if there is no error. | 54 | int lineNumber(); | ||
staniek: Same here | |||||
53 | int lineNumber; | 55 | | ||
56 | int columnNumber() const; | ||||
staniek: Symmetry: errorColumnNumber | |||||
57 | int columnNumber(); | ||||
staniek: Same here | |||||
58 | | ||||
59 | void setErrorMessage(const QString& msg); | ||||
60 | void setErrorDetails(const QString& details); | ||||
61 | void setErrorLine(int line); | ||||
staniek: setErrorLineNumber (similar to what Qt uses in some XML or DOM APIs) | |||||
62 | void setErrorColumn(int column); | ||||
staniek: Symmetry: setErrorColumnNumber | |||||
54 | 63 | | |||
55 | //! Column number (counting from 0) in which the error occured. -1 if there is no error. | 64 | private: | ||
56 | int columnNumber; | 65 | Q_DISABLE_COPY(KReportDesignReadingStatus) | ||
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… | |||||
66 | class Private; | ||||
67 | Private * const d; | ||||
57 | }; | 68 | }; | ||
58 | 69 | | |||
59 | //! Sends information about the reading status @a status to debug output @a dbg. | 70 | //! Sends information about the reading status @a status to debug output @a dbg. | ||
60 | KREPORT_EXPORT QDebug operator<<(QDebug dbg, const KReportDesignReadingStatus& status); | 71 | KREPORT_EXPORT QDebug operator<<(QDebug dbg, const KReportDesignReadingStatus& status); | ||
61 | 72 | | |||
62 | //! The KReportDesign class represents a report design in .kreport format | 73 | //! The KReportDesign class represents a report design in .kreport format | ||
63 | class KREPORT_EXPORT KReportDesign | 74 | class KREPORT_EXPORT KReportDesign | ||
64 | { | 75 | { | ||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |
The return value needs to be KReportDesignReadingStatus&