def emit(self,slot,value): if slot is None: return if type(value) is not tuple: value = (value,) if str(type(slot)) == "<type 'PySide.QtCore.SignalInstance'>": # allows slotting into signals; this type is not in QtCore, so must compare by name str if slot is None: return value = map(nonesigmod.pyside_none_wrap, value) tempemitter = EmitterFactory(*[object] * len(value))() tempemitter.sigTemp.connect(slot, QtCore.Qt.QueuedConnection) tempemitter.sigTemp.emit(*value) else: guiinvoker.invoke_in_main_thread(slot, *value) # actually works better than communicating with signals
def refresh(self, path=None): guiinvoker.invoke_in_main_thread(self.clear) if path is not None: self.path = path self.client.cd(path) self.client.walktree(self.path, lambda x: self.sigAddTopLevelItem.emit(x, 'file'), lambda x: self.sigAddTopLevelItem.emit(x, 'dir'), lambda: None, recurse=False) return self