Skip to content

Commit 66da5c7

Browse files
authored
Fix Add Space/Folder button (#10340)
1 parent df0bb7f commit 66da5c7

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

changelog/unreleased/10340

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Bugfix: Display `Add a Space` instead of `Add Folder Sync Connection` with oCIS
2+
3+
We fixed a bug where the wrong text was displayed on the "add" button.
4+
5+
https://github.com/owncloud/client/pull/10340

src/gui/folderstatusmodel.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,15 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
138138

139139
const Columns column = static_cast<Columns>(index.column());
140140
const auto itemType = classify(index);
141-
if (column == Columns::ItemType) {
141+
switch (column) {
142+
case Columns::ItemType:
142143
return itemType;
144+
case Columns::IsUsingSpaces:
145+
return _accountState->supportsSpaces();
146+
default:
147+
break;
143148
}
149+
144150
switch (itemType) {
145151
case AddButton: {
146152
if (role == Qt::ToolTipRole) {
@@ -267,12 +273,12 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
267273
return tr("Local folder: %1").arg(f->shortGuiLocalPath());
268274
case Columns::IsReady:
269275
return f->isReady();
270-
case Columns::IsUsingSpaces:
271-
return _accountState->supportsSpaces();
272276
case Columns::IsDeployed:
273277
return f->isDeployed();
274278
case Columns::Priority:
275279
return f->priority() + 1; // add one to have a higher prio than the hacked add button
280+
case Columns::IsUsingSpaces: // handled before
281+
[[fallthrough]];
276282
case Columns::ItemType: // handled before
277283
[[fallthrough]];
278284
case Columns::ColumnCount:

0 commit comments

Comments
 (0)