diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-09-15 17:43:22 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-09-15 18:20:01 +0300 |
commit | c2c81a777f01bfa9d2f4e20d02d9c928823a3635 (patch) | |
tree | ff0e44f68fcf23d3d37c996d10fd8b82a7e3fa92 /src/gui/accountsettings.cpp | |
parent | 65b67b3ff594b5b9baa6f52108510afff1c99f7c (diff) |
Ensure the folder is properly set up
Diffstat (limited to 'src/gui/accountsettings.cpp')
-rw-r--r-- | src/gui/accountsettings.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 498b197ca..ecf973c10 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -242,7 +242,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos) { QTreeView *tv = ui->_folderList; QModelIndex index = tv->indexAt(pos); - if (!index.isValid()) { + if (!index.isValid() || !(index.flags() & Qt::ItemIsEnabled)) { return; } @@ -284,7 +284,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos) bool folderConnected = _model->data(index, FolderStatusDelegate::FolderAccountConnected).toBool(); auto folderMan = FolderMan::instance(); QPointer<Folder> folder = folderMan->folder(alias); - if (!folder) + if (!folder || !OC_ENSURE(folder->ok())) return; QMenu *menu = new QMenu(tv); |