mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-18 20:02:17 +03:00
Set if the file owner should be displayed and the file owner display name on propfind in sharemodel
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
77c6dd6e33
commit
b687f1b2c2
1 changed files with 16 additions and 1 deletions
|
@ -219,11 +219,19 @@ void ShareModel::resetData()
|
||||||
_fetchOngoing = false;
|
_fetchOngoing = false;
|
||||||
_hasInitialShareFetchCompleted = false;
|
_hasInitialShareFetchCompleted = false;
|
||||||
_sharees.clear();
|
_sharees.clear();
|
||||||
|
_displayFileOwner = false;
|
||||||
|
_fileOwnerDisplayName.clear();
|
||||||
|
_sharedWithMeExpires = false;
|
||||||
|
_sharedWithMeRemainingTimeString.clear();
|
||||||
|
|
||||||
Q_EMIT sharePermissionsChanged();
|
Q_EMIT sharePermissionsChanged();
|
||||||
Q_EMIT fetchOngoingChanged();
|
Q_EMIT fetchOngoingChanged();
|
||||||
Q_EMIT hasInitialShareFetchCompletedChanged();
|
Q_EMIT hasInitialShareFetchCompletedChanged();
|
||||||
Q_EMIT shareesChanged();
|
Q_EMIT shareesChanged();
|
||||||
|
Q_EMIT displayFileOwnerChanged();
|
||||||
|
Q_EMIT fileOwnerDisplayNameChanged();
|
||||||
|
Q_EMIT sharedWithMeExpiresChanged();
|
||||||
|
Q_EMIT sharedWithMeRemainingTimeStringChanged();
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
@ -318,7 +326,9 @@ void ShareModel::updateData()
|
||||||
auto job = new PropfindJob(_accountState->account(), _sharePath);
|
auto job = new PropfindJob(_accountState->account(), _sharePath);
|
||||||
job->setProperties(QList<QByteArray>() << "http://open-collaboration-services.org/ns:share-permissions"
|
job->setProperties(QList<QByteArray>() << "http://open-collaboration-services.org/ns:share-permissions"
|
||||||
<< "http://owncloud.org/ns:fileid" // numeric file id for fallback private link generation
|
<< "http://owncloud.org/ns:fileid" // numeric file id for fallback private link generation
|
||||||
<< "http://owncloud.org/ns:privatelink");
|
<< "http://owncloud.org/ns:privatelink"
|
||||||
|
<< "http://owncloud.org/ns:owner-id"
|
||||||
|
<< "http://owncloud.org/ns:owner-display-name");
|
||||||
job->setTimeout(10 * 1000);
|
job->setTimeout(10 * 1000);
|
||||||
connect(job, &PropfindJob::result, this, &ShareModel::slotPropfindReceived);
|
connect(job, &PropfindJob::result, this, &ShareModel::slotPropfindReceived);
|
||||||
connect(job, &PropfindJob::finishedWithError, this, [&](const QNetworkReply *reply) {
|
connect(job, &PropfindJob::finishedWithError, this, [&](const QNetworkReply *reply) {
|
||||||
|
@ -455,6 +465,11 @@ void ShareModel::slotPropfindReceived(const QVariantMap &result)
|
||||||
const auto privateLinkUrl = result["privatelink"].toString();
|
const auto privateLinkUrl = result["privatelink"].toString();
|
||||||
_fileRemoteId = result["fileid"].toByteArray();
|
_fileRemoteId = result["fileid"].toByteArray();
|
||||||
|
|
||||||
|
_displayFileOwner = result["owner-id"].toString() != _accountState->account()->davUser();
|
||||||
|
Q_EMIT displayFileOwnerChanged();
|
||||||
|
_fileOwnerDisplayName = result["owner-display-name"].toString();
|
||||||
|
Q_EMIT fileOwnerDisplayNameChanged();
|
||||||
|
|
||||||
if (!privateLinkUrl.isEmpty()) {
|
if (!privateLinkUrl.isEmpty()) {
|
||||||
qCInfo(lcShareModel) << "Received private link url for" << _sharePath << privateLinkUrl;
|
qCInfo(lcShareModel) << "Received private link url for" << _sharePath << privateLinkUrl;
|
||||||
_privateLinkUrl = privateLinkUrl;
|
_privateLinkUrl = privateLinkUrl;
|
||||||
|
|
Loading…
Reference in a new issue