From 4369e31a495e384ccc94bfe813100f10e3a87d57 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 19 Oct 2015 18:32:34 +0200 Subject: [PATCH] Folder Model: don't try to fetch data if the account is disconnected Now that it expands automatically, it would do lots of query to the server when the account is disconnected. (all resulting in 401) --- src/gui/folderstatusmodel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 5cfa63683..d0e4905eb 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -466,6 +466,9 @@ bool FolderStatusModel::hasChildren(const QModelIndex& parent) const bool FolderStatusModel::canFetchMore(const QModelIndex& parent) const { + if (_accountState->state() != AccountState::Connected) { + return false; + } auto info = infoForIndex(parent); if (!info || info->_fetched || info->_fetching) return false; -- 2.30.2