diff --git a/src/api/server-repo.cpp b/src/api/server-repo.cpp index a0f4a13bd..98abca1d9 100644 --- a/src/api/server-repo.cpp +++ b/src/api/server-repo.cpp @@ -35,10 +35,12 @@ ServerRepo ServerRepo::fromJSON(const json_t *json, json_error_t */* error */) repo._virtual = json_is_true(json_object_get(json, "virtual")); if (repo.type == "grepo") { + repo.owner_name = getStringFromJson(json, "share_from_name"); repo.owner = getStringFromJson(json, "share_from"); repo.group_name = getStringFromJson(json, "owner"); repo.group_id = json_integer_value(json_object_get(json, "groupid")); } else { + repo.owner_name = getStringFromJson(json, "owner_name"); repo.owner = getStringFromJson(json, "owner"); repo.group_name = QString(); repo.group_id = 0; diff --git a/src/api/server-repo.h b/src/api/server-repo.h index b377fbec5..b7a4f2d5d 100644 --- a/src/api/server-repo.h +++ b/src/api/server-repo.h @@ -38,6 +38,7 @@ class ServerRepo { QString parent_path; QString type; + QString owner_name; QString owner; QString permission; QString group_name; diff --git a/src/ui/repo-detail-dialog.cpp b/src/ui/repo-detail-dialog.cpp index 63388ab94..e66e7c432 100644 --- a/src/ui/repo-detail-dialog.cpp +++ b/src/ui/repo-detail-dialog.cpp @@ -34,7 +34,7 @@ RepoDetailDialog::RepoDetailDialog(const ServerRepo &repo, QWidget *parent) setWindowIcon(QIcon(":/images/seafile.png")); mTimeLabel->setText(translateCommitTime(repo.mtime)); - mOwnerLabel->setText(repo.owner); + mOwnerLabel->setText(QString("%1 (%2)").arg(repo.owner_name).arg(repo.owner)); mSizeLabel->setText(readableFileSize(repo.size)); LocalRepo lrepo; diff --git a/src/ui/repo-item-delegate.cpp b/src/ui/repo-item-delegate.cpp index 8341254fa..93a9b1cf6 100644 --- a/src/ui/repo-item-delegate.cpp +++ b/src/ui/repo-item-delegate.cpp @@ -309,7 +309,7 @@ void RepoItemDelegate::paintRepoItem(QPainter *painter, // Paint repo sharing owner for private share if (static_cast(item->parent())->categoryIndex() == RepoTreeModel::CAT_INDEX_SHARED_REPOS) - extra_description += tr(", %1").arg(repo.owner.split('@').front()); + extra_description += QString(", %1").arg(repo.owner_name); if (!extra_description.isEmpty()) { int width = option.rect.topRight().x() - 40 - repo_desc_rect.topRight().x(); if (width < 3)