Account Settings: Hide the add folder button when Theme::singleSyncFolder is set
authorOlivier Goffart <ogoffart@woboq.com>
Wed, 19 Aug 2015 15:59:39 +0000 (17:59 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Wed, 19 Aug 2015 16:00:11 +0000 (18:00 +0200)
src/gui/folderstatusmodel.cpp

index cf4b4933af4578c68dc74c07dbcb1315be32147b..5435d61e9ddd6c318dd1aeba1f59555bc3084fde 100644 (file)
@@ -286,7 +286,11 @@ int FolderStatusModel::columnCount(const QModelIndex&) const
 int FolderStatusModel::rowCount(const QModelIndex& parent) const
 {
     if (!parent.isValid()) {
-        return _folders.count() + 1;
+        if( Theme::instance()->singleSyncFolder() &&  _folders.count() != 0) {
+            // "Add folder" button not visible in the singleSyncFolder configuration.
+            return _folders.count();
+        }
+        return _folders.count() + 1; // +1 for the "add folder" button
     }
     auto info = infoForIndex(parent);
     if (!info)