Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display usernames instead of ids #1539

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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