[Pkg-owncloud-commits] [owncloud-client] 451/484: Account removal: More crash fixes for Windows
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Dec 16 00:38:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit c24a8ba20823fccaed05a93e2a95d12732dd3c10
Author: Markus Goetz <markus at woboq.com>
Date: Tue Dec 1 19:21:52 2015 +0100
Account removal: More crash fixes for Windows
Seems things happen a bit different here, maybe because of paint events.
For #4229 #4202
---
src/gui/accountsettings.cpp | 1 +
src/gui/folderstatusmodel.cpp | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index ff63691..836a156 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -689,6 +689,7 @@ void AccountSettings::slotDeleteAccount()
}
}
+ _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();
diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index 14d0bf1..86be5e9 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -53,6 +53,8 @@ void FolderStatusModel::setAccountState(const AccountState* accountState)
auto folders = FolderMan::instance()->map();
foreach (auto f, folders) {
+ if (!accountState)
+ break;
if (f->accountState() != accountState)
continue;
SubFolderInfo info;
@@ -74,6 +76,9 @@ void FolderStatusModel::setAccountState(const AccountState* accountState)
Qt::ItemFlags FolderStatusModel::flags ( const QModelIndex &index ) const
{
+ if (!_accountState) {
+ return 0;
+ }
switch (classify(index)) {
case AddButton: {
Qt::ItemFlags ret;
@@ -479,6 +484,9 @@ bool FolderStatusModel::hasChildren(const QModelIndex& parent) const
bool FolderStatusModel::canFetchMore(const QModelIndex& parent) const
{
+ if (!_accountState) {
+ return false;
+ }
if (_accountState->state() != AccountState::Connected) {
return false;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list