mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Fix possible crash when loading project files
This fixes a crash when loading project files that haven't set the current tab to the Browse Data tab. See issue #1019.
This commit is contained in:
@@ -1964,11 +1964,14 @@ bool MainWindow::loadProject(QString filename, bool readOnly)
|
||||
QByteArray temp = QByteArray::fromBase64(attrData.toUtf8());
|
||||
QDataStream stream(temp);
|
||||
stream >> browseTableSettings;
|
||||
populateTable(); // Refresh view
|
||||
ui->dataTable->sortByColumn(browseTableSettings[ui->comboBrowseTable->currentText()].sortOrderIndex,
|
||||
browseTableSettings[ui->comboBrowseTable->currentText()].sortOrderMode);
|
||||
showRowidColumn(browseTableSettings[ui->comboBrowseTable->currentText()].showRowid);
|
||||
unlockViewEditing(!browseTableSettings[ui->comboBrowseTable->currentText()].unlockViewPk.isEmpty(), browseTableSettings[ui->comboBrowseTable->currentText()].unlockViewPk);
|
||||
if(ui->mainTab->currentIndex() == BrowseTab)
|
||||
{
|
||||
populateTable(); // Refresh view
|
||||
ui->dataTable->sortByColumn(browseTableSettings[ui->comboBrowseTable->currentText()].sortOrderIndex,
|
||||
browseTableSettings[ui->comboBrowseTable->currentText()].sortOrderMode);
|
||||
showRowidColumn(browseTableSettings[ui->comboBrowseTable->currentText()].showRowid);
|
||||
unlockViewEditing(!browseTableSettings[ui->comboBrowseTable->currentText()].unlockViewPk.isEmpty(), browseTableSettings[ui->comboBrowseTable->currentText()].unlockViewPk);
|
||||
}
|
||||
xml.skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user