Seems things happen a bit different here, maybe because of paint events.
For #4229 #4202
}
}
+ _model->setAccountState(0); // Else it might access during destruction. This should be better handled by it having a QSharedPointer
auto manager = AccountManager::instance();
manager->deleteAccount(_accountState);
manager->save();
auto folders = FolderMan::instance()->map();
foreach (auto f, folders) {
+ if (!accountState)
+ break;
if (f->accountState() != accountState)
continue;
SubFolderInfo info;
Qt::ItemFlags FolderStatusModel::flags ( const QModelIndex &index ) const
{
+ if (!_accountState) {
+ return 0;
+ }
switch (classify(index)) {
case AddButton: {
Qt::ItemFlags ret;
bool FolderStatusModel::canFetchMore(const QModelIndex& parent) const
{
+ if (!_accountState) {
+ return false;
+ }
if (_accountState->state() != AccountState::Connected) {
return false;
}