From 6cfac1b0f105e85b044491449d2ef902e8be940a Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Fri, 26 Jul 2019 14:26:00 +0200 Subject: [PATCH] Fix right click action "Browse Table" for tables with whitespace Fix a crash when using the "Browse Table" action in the right click menu in the Database Structure tab. It crashed whenever the table name or the schema name started or ended with a space character. --- src/MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index d6571939..9561c07f 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -3369,8 +3369,8 @@ void MainWindow::switchToBrowseDataTab(QString tableToBrowse) if(!ui->dbTreeWidget->selectionModel()->hasSelection()) return; - sqlb::ObjectIdentifier obj(ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), DbStructureModel::ColumnSchema)).toString().toStdString(), - ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), DbStructureModel::ColumnName)).toString().toStdString()); + sqlb::ObjectIdentifier obj(ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), DbStructureModel::ColumnSchema), Qt::EditRole).toString().toStdString(), + ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), DbStructureModel::ColumnName), Qt::EditRole).toString().toStdString()); tableToBrowse = QString::fromStdString(obj.toDisplayString()); }