From 19ddb1c9566e13ca0cf9f208637d7b7c80b4bbc5 Mon Sep 17 00:00:00 2001 From: mappu Date: Thu, 25 May 2017 19:53:35 +1200 Subject: [PATCH] select parent when deleting bucket (maybe fixes a crash?) --- qbolt/mainwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qbolt/mainwindow.cpp b/qbolt/mainwindow.cpp index 7faa026..1c928f5 100644 --- a/qbolt/mainwindow.cpp +++ b/qbolt/mainwindow.cpp @@ -366,6 +366,8 @@ void MainWindow::on_actionDelete_bucket_triggered() return; } + QTreeWidgetItem* parent = itm->parent(); + // One level down browse.pop_back(); @@ -379,9 +381,9 @@ void MainWindow::on_actionDelete_bucket_triggered() } // Refresh bucket list - refreshBucketTree(itm->parent()); // sub-tree only - ui->bucketTree->expandItem(itm->parent()); - + refreshBucketTree(parent); // sub-tree only + ui->bucketTree->expandItem(parent); + ui->bucketTree->setCurrentItem(parent); } void MainWindow::on_AddDataButton_clicked()