Skip to content

Commit

Permalink
[dbmanager] Fixes various signal bugs after 8bda5c
Browse files Browse the repository at this point in the history
Fixes some unreported glitches after new signals migration.

Also fixes #14649
  • Loading branch information
elpaso committed Apr 14, 2016
1 parent 170c955 commit 1e6dceb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions python/plugins/db_manager/db_model.py
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/spatialite/plugin.py
Expand Up @@ -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()

Expand Down
4 changes: 3 additions & 1 deletion python/plugins/db_manager/dlg_create_table.py
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1e6dceb

Please sign in to comment.