Skip to content

Commit 8be2c54

Browse files
committed
Don't simplify table/index/... names when using them internally
See issue sqlitebrowser#773.
1 parent 1180540 commit 8be2c54

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/DbStructureModel.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ QVariant DbStructureModel::data(const QModelIndex& index, int role) const
3939
// Depending on the role either return the text or the icon
4040
if(role == Qt::DisplayRole)
4141
return Settings::getSettingsValue("db", "hideschemalinebreaks").toBool() ? item->text(index.column()).replace("\n", " ").simplified() : item->text(index.column());
42+
else if(role == Qt::EditRole)
43+
return item->text(index.column());
4244
else if(role == Qt::ToolTipRole)
4345
return item->text(index.column()); // Don't modify the text when it's supposed to be shown in a tooltip
4446
else if(role == Qt::DecorationRole)

src/MainWindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,8 @@ void MainWindow::compact()
729729
void MainWindow::deleteObject()
730730
{
731731
// Get name and type of object to delete
732-
QString table = ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), 0)).toString();
733-
QString type = ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), 1)).toString();
732+
QString table = ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), 0), Qt::EditRole).toString();
733+
QString type = ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), 1), Qt::EditRole).toString();
734734

735735
// Ask user if he really wants to delete that table
736736
if(QMessageBox::warning(this, QApplication::applicationName(), tr("Are you sure you want to delete the %1 '%2'?\nAll data associated with the %1 will be lost.").arg(type).arg(table),

0 commit comments

Comments
 (0)