Skip to content

Commit 1e6dceb

Browse files
committed
[dbmanager] Fixes various signal bugs after 8bda5c
Fixes some unreported glitches after new signals migration. Also fixes #14649
1 parent 170c955 commit 1e6dceb

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

python/plugins/db_manager/db_model.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
***************************************************************************/
2121
"""
2222

23-
from PyQt.QtCore import Qt, QObject, qDebug, QByteArray, QMimeData, QDataStream, QIODevice, QFileInfo, QAbstractItemModel, QModelIndex, pyqtSignal
23+
from functools import partial
24+
from PyQt.QtCore import Qt, QObject, qDebug, QByteArray, QMimeData, QDataStream, QIODevice, QFileInfo, QAbstractItemModel, QModelIndex, pyqtSignal, pyqtSlot
2425
from PyQt.QtWidgets import QApplication, QMessageBox
2526
from PyQt.QtGui import QIcon
2627

@@ -302,7 +303,7 @@ def __init__(self, parent=None):
302303
for dbtype in supportedDbTypes():
303304
dbpluginclass = createDbPlugin(dbtype)
304305
item = PluginItem(dbpluginclass, self.rootItem)
305-
item.itemChanged.connect(self.refreshItem)
306+
item.itemChanged.connect(partial(self.refreshItem, item))
306307

307308
def refreshItem(self, item):
308309
if isinstance(item, TreeItem):
@@ -486,7 +487,7 @@ def _refreshIndex(self, index, force=False):
486487
if prevPopulated or force:
487488
if item.populate():
488489
for child in item.childItems:
489-
child.itemChanged.connect(self.refreshItem)
490+
child.itemChanged.connect(partial(self.refreshItem, item))
490491
self._onDataChanged(index)
491492
else:
492493
self.notPopulated.emit(index)

python/plugins/db_manager/db_plugins/spatialite/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def runVacuumActionSlot(self, item, action, parent):
148148
self.runVacuum()
149149

150150
def runVacuum(self):
151-
self.database().aboutToChange()
151+
self.database().aboutToChange.emit()
152152
self.database().connector.runVacuum()
153153
self.database().refresh()
154154

python/plugins/db_manager/dlg_create_table.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from PyQt.QtCore import Qt, QModelIndex
2626
from PyQt.QtWidgets import QItemDelegate, QComboBox, QDialog, QPushButton, QDialogButtonBox, QMessageBox, QApplication
27-
from PyQt.QtCore import QItemSelectionModel
27+
from PyQt.QtCore import QItemSelectionModel, pyqtSignal
2828

2929
from .db_plugins.data_model import TableFieldsModel
3030
from .db_plugins.plugin import DbError, ConnectionError
@@ -37,6 +37,8 @@ class TableFieldsDelegate(QItemDelegate):
3737

3838
""" delegate with some special item editors """
3939

40+
columnNameChanged = pyqtSignal()
41+
4042
def __init__(self, field_types, parent=None):
4143
QItemDelegate.__init__(self, parent)
4244
self.fieldTypes = field_types

0 commit comments

Comments
 (0)