Skip to content

Commit

Permalink
Changed old-style by new-style signal in NSettings. For some reason t…
Browse files Browse the repository at this point in the history
…his caused the signals were issued more than once
  • Loading branch information
centaurialpha committed Sep 19, 2016
1 parent 33a318d commit 2fc0afc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ninja_ide/core/nsettings.py
Expand Up @@ -18,7 +18,7 @@
from __future__ import unicode_literals

from PyQt4.QtCore import QSettings
from PyQt4.QtCore import SIGNAL
from PyQt4.QtCore import pyqtSignal


class NSettings(QSettings):
Expand All @@ -28,6 +28,7 @@ class NSettings(QSettings):
@signals:
valueChanged(QString, PyQt_PyObject)
"""
valueChanged = pyqtSignal('QString', 'PyQt_PyObject')

def __init__(self, path, fformat=QSettings.IniFormat, prefix=''):
super(NSettings, self).__init__(path, fformat)
Expand All @@ -36,4 +37,4 @@ def __init__(self, path, fformat=QSettings.IniFormat, prefix=''):
def setValue(self, key, value):
super(NSettings, self).setValue(key, value)
key = "%s_%s" % (self.__prefix, key)
self.emit(SIGNAL("valueChanged(QString, PyQt_PyObject)"), key, value)
self.valueChanged.emit(key, value)

0 comments on commit 2fc0afc

Please sign in to comment.