Skip to content

Commit

Permalink
Display usernames instead of ids
Browse files Browse the repository at this point in the history
  • Loading branch information
rumtid committed Jun 7, 2024
1 parent 4116969 commit f6037cd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/api/server-repo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/api/server-repo.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ServerRepo {
QString parent_path;

QString type;
QString owner_name;
QString owner;
QString permission;
QString group_name;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/repo-detail-dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/repo-item-delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void RepoItemDelegate::paintRepoItem(QPainter *painter,
// Paint repo sharing owner for private share
if (static_cast<RepoCategoryItem*>(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)
Expand Down

0 comments on commit f6037cd

Please sign in to comment.