Merge pull request #43 from QuasarApp/task_38

Fixing: add const reference into getOwnerName.
This commit is contained in:
Igor loschinin 2021-04-19 23:03:46 +03:00 committed by GitHub
commit 6a3025b2ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -13,19 +13,19 @@ Owner::Owner() {
}
void Owner::setName(const QString &ownerName) {
Owner::name = ownerName;
name = ownerName;
}
QString Owner::getOwnerName() {
return Owner::name;
const QString &Owner::getOwnerName() const {
return name;
}
void Owner::setTimeRange(const QString &interval) {
timeRange = interval;
}
QString Owner::getTimeRange() {
return Owner::timeRange;
const QString &Owner::getTimeRange() const {
return timeRange;
}
};

View File

@ -30,7 +30,7 @@ public:
* @brief getOwnerName The method allows you to get information about the owner.
* @return the owner name.
*/
QString getOwnerName();
const QString& getOwnerName() const;
/**
* @brief setTimeRange A method that allows you to set the time interval for using a file.
@ -42,7 +42,7 @@ public:
* @brief getTimeRange The method changes the timestamp of the usage.
* @return the time interval when the file was modified
*/
QString getTimeRange();
const QString& getTimeRange() const;
private:
QString name;
QString timeRange;