-
Notifications
You must be signed in to change notification settings - Fork 283
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
qt: peers-tab resizeColumnsToContents #338
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,8 @@ QVariant PeerTableModel::data(const QModelIndex& index, int role) const | |
return GUIUtil::formatBytes(rec->nodeStats.nRecvBytes); | ||
case Subversion: | ||
return QString::fromStdString(rec->nodeStats.cleanSubVer); | ||
case Bumper: | ||
return QString::fromStdString(""); | ||
} // no default case, so the compiler can warn about missing cases | ||
assert(false); | ||
} else if (role == Qt::TextAlignmentRole) { | ||
|
@@ -100,10 +102,12 @@ QVariant PeerTableModel::data(const QModelIndex& index, int role) const | |
case Ping: | ||
case Sent: | ||
case Received: | ||
return QVariant(Qt::AlignRight | Qt::AlignVCenter); | ||
case Subversion: | ||
return {}; | ||
} // no default case, so the compiler can warn about missing cases | ||
case Subversion: | ||
return QVariant(Qt::AlignLeft | Qt::AlignVCenter); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this unrelated to what you want to do? |
||
case Bumper: | ||
return QVariant(Qt::AlignCenter); | ||
} | ||
assert(false); | ||
} else if (role == StatsRole) { | ||
return QVariant::fromValue(rec); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,8 @@ bool PeerTableSortProxy::lessThan(const QModelIndex& left_index, const QModelInd | |
return left_stats.nRecvBytes < right_stats.nRecvBytes; | ||
case PeerTableModel::Subversion: | ||
return left_stats.cleanSubVer.compare(right_stats.cleanSubVer) < 0; | ||
case PeerTableModel::Bumper: | ||
return left_stats.nodeid < right_stats.nodeid; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this sorting scheme? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorting by |
||
} // no default case, so the compiler can warn about missing cases | ||
assert(false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this need to be
QString::fromStdString("")