diff options
author | Felix Weilbach <felix.weilbach@nextcloud.com> | 2021-04-15 16:47:10 +0300 |
---|---|---|
committer | Felix Weilbach (Rebase PR Action) <felix.weilbach@t-online.de> | 2021-04-20 10:13:23 +0300 |
commit | 28515285959b6bf3d58f7a1a70a97f8bb98776ce (patch) | |
tree | 394422a1932aee2eaa14a87e945870a597c7e982 /src/gui/sharemanager.cpp | |
parent | 22a3b19e08f685865a2cee8e3ef847697cc8daee (diff) |
Show user/group note on share if already set
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
Diffstat (limited to 'src/gui/sharemanager.cpp')
-rw-r--r-- | src/gui/sharemanager.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gui/sharemanager.cpp b/src/gui/sharemanager.cpp index 5224fc34e..e50390fbf 100644 --- a/src/gui/sharemanager.cpp +++ b/src/gui/sharemanager.cpp @@ -286,9 +286,11 @@ UserGroupShare::UserGroupShare(AccountPtr account, const ShareType shareType, const Permissions permissions, const QSharedPointer<Sharee> shareWith, - const QDate &expireDate) + const QDate &expireDate, + const QString ¬e) : Share(account, id, owner, ownerDisplayName, path, shareType, permissions, shareWith) , _expireDate(expireDate) + , _note(note) { Q_ASSERT(shareType == TypeUser || shareType == TypeGroup); Q_ASSERT(shareWith); @@ -302,6 +304,11 @@ void UserGroupShare::setNote(const QString ¬e) job->setNote(getId(), note); } +QString UserGroupShare::getNote() const +{ + return _note; +} + void UserGroupShare::slotNoteSet(const QJsonDocument &, const QVariant ¬e) { _note = note.toString(); @@ -473,6 +480,11 @@ QSharedPointer<UserGroupShare> ShareManager::parseUserGroupShare(const QJsonObje expireDate = QDate::fromString(data.value("expiration").toString(), "yyyy-MM-dd 00:00:00"); } + QString note; + if (data.value("note").isString()) { + note = data.value("note").toString(); + } + return QSharedPointer<UserGroupShare>(new UserGroupShare(_account, data.value("id").toVariant().toString(), // "id" used to be an integer, support both data.value("uid_owner").toVariant().toString(), @@ -481,7 +493,8 @@ QSharedPointer<UserGroupShare> ShareManager::parseUserGroupShare(const QJsonObje static_cast<Share::ShareType>(data.value("share_type").toInt()), static_cast<Share::Permissions>(data.value("permissions").toInt()), sharee, - expireDate)); + expireDate, + note)); } QSharedPointer<LinkShare> ShareManager::parseLinkShare(const QJsonObject &data) |