mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Fix expansion of tree view on newly added accounts
The change is based on 97ce20ac02
I removed a few lines of code there which are already part of fetchMore()
Fixes: #7336
This commit is contained in:
parent
57701351f6
commit
8154e50c98
6
changelog/unreleased/7336
Normal file
6
changelog/unreleased/7336
Normal file
@ -0,0 +1,6 @@
|
||||
Bugfix: Expand file tree also when no folders are synced
|
||||
|
||||
We have fixed the behaviour of the folder Widget,
|
||||
when a account was added and none of its folders was selected to be synced, the tree was not expanded.
|
||||
|
||||
https://github.com/owncloud/client/issues/7336
|
||||
@ -589,6 +589,13 @@ void FolderStatusModel::fetchMore(const QModelIndex &parent)
|
||||
QTimer::singleShot(1000, this, &FolderStatusModel::slotShowFetchProgress);
|
||||
}
|
||||
|
||||
void FolderStatusModel::resetAndFetch(const QModelIndex &parent)
|
||||
{
|
||||
auto info = infoForIndex(parent);
|
||||
info->resetSubs(this, parent);
|
||||
fetchMore(parent);
|
||||
}
|
||||
|
||||
void FolderStatusModel::slotGatherPermissions(const QString &href, const QMap<QString, QString> &map)
|
||||
{
|
||||
auto it = map.find("permissions");
|
||||
@ -1090,10 +1097,7 @@ void FolderStatusModel::slotFolderSyncStateChange(Folder *f)
|
||||
if (f->syncResult().folderStructureWasChanged()
|
||||
&& (state == SyncResult::Success || state == SyncResult::Problem)) {
|
||||
// There is a new or a removed folder. reset all data
|
||||
auto &info = _folders[folderIndex];
|
||||
auto idx = index(folderIndex);
|
||||
info.resetSubs(this, idx);
|
||||
fetchMore(idx);
|
||||
resetAndFetch(index(folderIndex));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1200,7 +1204,7 @@ void FolderStatusModel::slotNewBigFolder()
|
||||
return;
|
||||
}
|
||||
|
||||
_folders[folderIndex].resetSubs(this, index(folderIndex));
|
||||
resetAndFetch(index(folderIndex));
|
||||
|
||||
emit suggestExpand(index(folderIndex));
|
||||
emit dirtyChanged();
|
||||
|
||||
@ -52,6 +52,7 @@ public:
|
||||
QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
|
||||
bool canFetchMore(const QModelIndex &parent) const Q_DECL_OVERRIDE;
|
||||
void fetchMore(const QModelIndex &parent) Q_DECL_OVERRIDE;
|
||||
void resetAndFetch(const QModelIndex &parent);
|
||||
bool hasChildren(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
||||
|
||||
struct SubFolderInfo
|
||||
|
||||
Loading…
Reference in New Issue
Block a user