[Pkg-owncloud-commits] [owncloud-client] 59/470: Selective sync: Don't show negative size

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:24:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 8fe4f1f0d7f61126bfbea85430e3058a446baa42
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Feb 22 17:26:09 2016 +0100

    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 f4b06cf..d7185c3 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 9a6682f..cc361cd 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);
         }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list