Skip to content

Commit a1da631

Browse files
authored
Fix expansion of selective sync tree (#10058)
Fixes a bug introduced in 8d0dd36.
1 parent 0b63c08 commit a1da631

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

changelog/unreleased/10058

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Bugfix: Fix configuration of selective sync from account settings
2+
3+
We removed a superfluous check which caused the directory tree in the account settings window to no longer expand beyond the first level.
4+
The problem was introduced in 8d0dd36d2.
5+
6+
https://github.com/owncloud/client/pull/10058

src/gui/accountsettings.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,8 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
258258
return;
259259
}
260260

261-
262261
// Only allow removal if the item isn't in "ready" state.
263-
if (classification == FolderStatusModel::RootFolder && !_model->data(index, FolderStatusDelegate::IsReady).toBool() && !_model->folder(index)->isDeployed()) {
262+
if (classification == FolderStatusModel::RootFolder && _model->folder(index)->isReady() && !_model->folder(index)->isDeployed()) {
264263
QMenu *menu = new QMenu(tv);
265264
menu->setAttribute(Qt::WA_DeleteOnClose);
266265
removeFolderAction(menu);

src/gui/folderstatusdelegate.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ class FolderStatusDelegate : public QStyledItemDelegate
4848

4949
AddButton, // 1 = enabled; 2 = disabled
5050
FolderSyncText,
51-
52-
IsReady // boolean
5351
};
5452
void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override;
5553
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override;

src/gui/folderstatusmodel.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,6 @@ QVariant FolderStatusModel::data(const QModelIndex &index, int role) const
281281
return progress._overallSyncString;
282282
case FolderStatusDelegate::FolderSyncText:
283283
return tr("Local folder: %1").arg(f->shortGuiLocalPath());
284-
case FolderStatusDelegate::IsReady:
285-
return f->isReady();
286284
}
287285
return QVariant();
288286
}
@@ -570,9 +568,10 @@ bool FolderStatusModel::canFetchMore(const QModelIndex &parent) const
570568

571569
void FolderStatusModel::fetchMore(const QModelIndex &parent)
572570
{
573-
if (!data(parent, FolderStatusDelegate::IsReady).toBool()) {
571+
if (!folder(parent)->isReady()) {
574572
return;
575573
}
574+
576575
auto info = infoForIndex(parent);
577576

578577
if (!info || info->_fetched || info->_fetchingJob)

0 commit comments

Comments
 (0)