mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-02-09 04:58:27 -06:00
Do not always refresh the table browser dock when opening a database
It does not seem like there is a good reason to always refresh the table browser dock (there is always exactly one at this point) when opening a database file, even when it is not visible. This only generates unnecessary queries to the database.
This commit is contained in:
@@ -566,7 +566,7 @@ bool MainWindow::fileOpen(const QString& fileName, bool openFromProject, bool re
|
||||
else if(ui->mainTab->currentWidget() == ui->pragmas)
|
||||
loadPragmas();
|
||||
|
||||
refreshTableBrowsers(true);
|
||||
refreshTableBrowsers();
|
||||
|
||||
// Update remote dock
|
||||
remoteDock->fileOpened(wFile);
|
||||
@@ -672,14 +672,14 @@ void MainWindow::populateStructure(const std::vector<sqlb::ObjectIdentifier>& ol
|
||||
ui->treeSchemaDock->resizeColumnToContents(DbStructureModel::ColumnName);
|
||||
}
|
||||
|
||||
void MainWindow::refreshTableBrowsers(bool force_refresh)
|
||||
void MainWindow::refreshTableBrowsers()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
for(const auto& d : allTableBrowserDocks())
|
||||
{
|
||||
// When in the Browse Data tab update all docks. Otherwise just update the floating ones because they might
|
||||
// be visible even when another tab is active.
|
||||
if(force_refresh || ui->mainTab->currentWidget() == ui->browser || d->isFloating())
|
||||
if(ui->mainTab->currentWidget() == ui->browser || d->isFloating())
|
||||
{
|
||||
TableBrowser* t = d->tableBrowser();
|
||||
if(t)
|
||||
|
||||
@@ -166,7 +166,7 @@ private slots:
|
||||
void changeTreeSelection();
|
||||
void fileNew();
|
||||
void fileNewInMemoryDatabase(bool open_create_dialog = true);
|
||||
void refreshTableBrowsers(bool force_refresh = false);
|
||||
void refreshTableBrowsers();
|
||||
bool fileClose();
|
||||
bool fileSaveAs();
|
||||
void createTable();
|
||||
|
||||
Reference in New Issue
Block a user