Change bool/int condition

This commit is contained in:
Jonas Kvinge
2021-06-22 13:54:58 +02:00
parent 58a5367015
commit 584f5e5935
34 changed files with 61 additions and 61 deletions

View File

@@ -282,13 +282,16 @@ QVariant DeviceManager::data(const QModelIndex &idx, int role) const {
switch (role) {
case Qt::DisplayRole: {
QString text;
if (!info->friendly_name_.isEmpty())
if (!info->friendly_name_.isEmpty()) {
text = info->friendly_name_;
else if (info->BestBackend())
}
else if (info->BestBackend()) {
text = info->BestBackend()->unique_id_;
}
if (info->size_)
if (info->size_ > 0) {
text = text + QString(" (%1)").arg(Utilities::PrettySize(info->size_));
}
if (info->device_.get()) info->device_->Refresh();
return text;
}