summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnne Jan Brouwer <brouwer@annejan.com>2019-06-05 17:50:10 +0200
committerAnne Jan Brouwer <brouwer@annejan.com>2019-06-05 17:50:26 +0200
commit508266b7076a47f217b4050d73ccbf21a392b89c (patch)
tree5a2a375ff70c418010f198a6cbfb1b03b4ff5bbb /src
parent4cc186f29bf7e208a45b205535680b9cd5005052 (diff)
Minor extra safeguarding
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 1a7f91cb..a52d3c5c 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -700,7 +700,9 @@ void MainWindow::onUsers() {
: currentDir;
UsersDialog d(dir, this);
- d.exec();
+ if (!d.exec()) {
+ ui->treeView->setFocus();
+ }
}
/**
@@ -837,7 +839,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
if (obj == ui->lineEdit && event->type() == QEvent::KeyPress) {
auto *key = dynamic_cast<QKeyEvent *>(event);
- if (key->key() == Qt::Key_Down) {
+ if (key != NULL && key->key() == Qt::Key_Down) {
ui->treeView->setFocus();
}
}