Skip to content
Permalink
Browse files

[dbmanager] Fixes various signal bugs after 8bda5c

Fixes some unreported glitches after new signals migration.

Also fixes #14649
  • Loading branch information
elpaso committed Apr 14, 2016
1 parent 170c955 commit 1e6dceb7d25d0634f9f452dff2f360bcf901bd2f
@@ -20,7 +20,8 @@
***************************************************************************/
"""

from PyQt.QtCore import Qt, QObject, qDebug, QByteArray, QMimeData, QDataStream, QIODevice, QFileInfo, QAbstractItemModel, QModelIndex, pyqtSignal
from functools import partial
from PyQt.QtCore import Qt, QObject, qDebug, QByteArray, QMimeData, QDataStream, QIODevice, QFileInfo, QAbstractItemModel, QModelIndex, pyqtSignal, pyqtSlot
from PyQt.QtWidgets import QApplication, QMessageBox
from PyQt.QtGui import QIcon

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

def refreshItem(self, item):
if isinstance(item, TreeItem):
@@ -486,7 +487,7 @@ def _refreshIndex(self, index, force=False):
if prevPopulated or force:
if item.populate():
for child in item.childItems:
child.itemChanged.connect(self.refreshItem)
child.itemChanged.connect(partial(self.refreshItem, item))
self._onDataChanged(index)
else:
self.notPopulated.emit(index)
@@ -148,7 +148,7 @@ def runVacuumActionSlot(self, item, action, parent):
self.runVacuum()

def runVacuum(self):
self.database().aboutToChange()
self.database().aboutToChange.emit()
self.database().connector.runVacuum()
self.database().refresh()

@@ -24,7 +24,7 @@

from PyQt.QtCore import Qt, QModelIndex
from PyQt.QtWidgets import QItemDelegate, QComboBox, QDialog, QPushButton, QDialogButtonBox, QMessageBox, QApplication
from PyQt.QtCore import QItemSelectionModel
from PyQt.QtCore import QItemSelectionModel, pyqtSignal

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

""" delegate with some special item editors """

columnNameChanged = pyqtSignal()

def __init__(self, field_types, parent=None):
QItemDelegate.__init__(self, parent)
self.fieldTypes = field_types

0 comments on commit 1e6dceb

Please sign in to comment.
You can’t perform that action at this time.