Skip to content

Commit 37a9cd2

Browse files
author
Paweł Salawa
committed
#5583 Fixed table labels on Database List to enforce the lazy-loaded table schemas to be loaded at once when this option is enabled.
1 parent 2e9a86d commit 37a9cd2

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
- BUGFIX: Improved Code Assistant suggestions when SQL editor contains more than one query.
7373
- BUGFIX: #5089 User-defined functions now follow database renaming in case the function was explicitly registered for the database.
7474
- BUGFIX: #5584 Fixed user-defined collations.
75+
- BUGFIX: #5583 Fixed table labels on Database List to enforce the lazy-loaded table schemas to be loaded at once when this option is enabled.
7576

7677
### 3.4.21
7778
- ADDED: #5466 Support foreign keys with implicit columns (proper values in FK combobox columns).

SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ DbTreeModel::DbTreeModel()
3838
connect(CFG, SIGNAL(massSaveBegins()), this, SLOT(massSaveBegins()));
3939
connect(CFG, SIGNAL(massSaveCommitted()), this, SLOT(massSaveCommitted()));
4040
connect(CFG_UI.DbList.ShowSystemObjects, SIGNAL(changed(QVariant)), this, SLOT(markSchemaReloadingRequired()));
41+
connect(CFG_UI.DbList.ShowRegularTableLabels, SIGNAL(changed(QVariant)), this, SLOT(markSchemaReloadingRequired()));
4142

4243
dbOrganizer = new DbObjectOrganizer(confirmReferencedTables, resolveNameConflict, confirmConversion, confirmConversionErrors);
4344
dbOrganizer->setAutoDelete(false);
@@ -606,6 +607,16 @@ void DbTreeModel::refreshSchema(Db* db, QStandardItem *item)
606607
QList<QStandardItem*> viewItems = refreshSchemaViews(views, sort);
607608
refreshSchemaBuild(item, tableItems, viewItems);
608609
populateChildItemsWithDb(item, db);
610+
611+
if (CFG_UI.DbList.ShowRegularTableLabels.get())
612+
{
613+
for (QStandardItem*& item : tableItems)
614+
loadTableSchema(dynamic_cast<DbTreeItem*>(item));
615+
616+
for (QStandardItem*& item : viewItems)
617+
loadViewSchema(dynamic_cast<DbTreeItem*>(item));
618+
}
619+
609620
restoreExpandedState(expandedState, item);
610621
restoreSelectionState(selectionState);
611622
}

SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.ui

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
<item>
361361
<widget class="QCheckBox" name="regularTableLabelsCheck">
362362
<property name="toolTip">
363-
<string>For regular tables labels will show number of columns, indexes and triggers for each of tables.</string>
363+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Shows number of columns, indexes and triggers next to each table name.&lt;/p&gt;&lt;p&gt;Requires loading full schema for all tables. For databases with hundreds or thousands of tables, this can significantly impact performance.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
364364
</property>
365365
<property name="text">
366366
<string>Display labels for regular tables</string>
@@ -474,8 +474,8 @@
474474
<rect>
475475
<x>0</x>
476476
<y>0</y>
477-
<width>432</width>
478-
<height>731</height>
477+
<width>456</width>
478+
<height>754</height>
479479
</rect>
480480
</property>
481481
<layout class="QVBoxLayout" name="verticalLayout_34">
@@ -2330,8 +2330,8 @@
23302330
<rect>
23312331
<x>0</x>
23322332
<y>0</y>
2333-
<width>366</width>
2334-
<height>353</height>
2333+
<width>389</width>
2334+
<height>363</height>
23352335
</rect>
23362336
</property>
23372337
<layout class="QVBoxLayout" name="verticalLayout_31">
@@ -2786,7 +2786,7 @@ p, li { white-space: pre-wrap; }
27862786
hr { height: 1px; border-width: 0; }
27872787
li.unchecked::marker { content: &quot;\2610&quot;; }
27882788
li.checked::marker { content: &quot;\2612&quot;; }
2789-
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
2789+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
27902790
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Abcdefgh&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
27912791
</property>
27922792
</widget>
@@ -2877,8 +2877,8 @@ li.checked::marker { content: &quot;\2612&quot;; }
28772877
<rect>
28782878
<x>0</x>
28792879
<y>0</y>
2880-
<width>224</width>
2881-
<height>481</height>
2880+
<width>235</width>
2881+
<height>493</height>
28822882
</rect>
28832883
</property>
28842884
<layout class="QVBoxLayout" name="verticalLayout_9">

0 commit comments

Comments
 (0)