From 8fe4f1f0d7f61126bfbea85430e3058a446baa42 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 22 Feb 2016 17:26:09 +0100 Subject: [PATCH] Selective sync: Don't show negative size Relates to issue #4491 --- src/gui/folderstatusmodel.cpp | 2 +- src/gui/selectivesyncdialog.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index f4b06cf38..d7185c354 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -145,7 +145,7 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const case Qt::ToolTipRole: case Qt::DisplayRole: //: Example text: "File.txt (23KB)" - return tr("%1 (%2)").arg(x._name, Utility::octetsToString(x._size)); + return x._size < 0 ? x._name : tr("%1 (%2)").arg(x._name, Utility::octetsToString(x._size)); case Qt::CheckStateRole: return x._checked; case Qt::DecorationRole: diff --git a/src/gui/selectivesyncdialog.cpp b/src/gui/selectivesyncdialog.cpp index 9a6682ff5..cc361cd05 100644 --- a/src/gui/selectivesyncdialog.cpp +++ b/src/gui/selectivesyncdialog.cpp @@ -145,8 +145,10 @@ void SelectiveSyncTreeView::recursiveInsert(QTreeWidgetItem* parent, QStringList } item->setIcon(0, folderIcon); item->setText(0, pathTrail.first()); - item->setText(1, Utility::octetsToString(size)); - item->setData(1, Qt::UserRole, size); + if (size >= 0) { + item->setText(1, Utility::octetsToString(size)); + item->setData(1, Qt::UserRole, size); + } // item->setData(0, Qt::UserRole, pathTrail.first()); item->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator); } -- 2.30.2