From: Ed Page Date: Tue, 16 Aug 2011 02:54:13 +0000 (-0500) Subject: Bumping to 1.3.7-3 to remove code that doesn't work on older PyQt, like on Maemo 5 X-Git-Url: https://vcs.maemo.org/git/?p=gc-dialer;a=commitdiff_plain;h=da14570fdcadf55606f5ac7ee4de5b380b150661 Bumping to 1.3.7-3 to remove code that doesn't work on older PyQt, like on Maemo 5 --- diff --git a/dialcentral/constants.py b/dialcentral/constants.py index 53b8b60..9f396c6 100644 --- a/dialcentral/constants.py +++ b/dialcentral/constants.py @@ -1,7 +1,7 @@ __pretty_app_name__ = "DialCentral" __app_name__ = "dialcentral" __version__ = "1.3.7" -__build__ = 2 +__build__ = 3 __app_magic__ = 0xdeadbeef IS_MAEMO = True diff --git a/dialcentral/util/qore_utils.py b/dialcentral/util/qore_utils.py index 5fbf97e..ade9bc1 100644 --- a/dialcentral/util/qore_utils.py +++ b/dialcentral/util/qore_utils.py @@ -208,107 +208,6 @@ def create_tupled_list_model(*columnNames, **kwargs): return TupledListModel -class FileSystemModel(QtCore.QAbstractListModel): - """ - Wrapper around QtGui.QFileSystemModel - """ - - FILEINFOS = [ - "fileName", - "isDir", - "filePath", - "completeSuffix", - "baseName", - ] - - EXTINFOS = [ - "type", - ] - - ALLINFOS = FILEINFOS + EXTINFOS - - def __init__(self, model, path): - QtCore.QAbstractListModel.__init__(self) - self._path = path - - self._model = model - self._rootIndex = self._model.index(self._path) - - self._child = None - self.setRoleNames(dict(enumerate(self.ALLINFOS))) - self._model.directoryLoaded.connect(self._on_directory_loaded) - - childChanged = qt_compat.Signal(QtCore.QObject) - - def _child(self): - assert self._child is not None - return self._child - - child = qt_compat.Property(QtCore.QObject, _child, notify=childChanged) - - backendChanged = qt_compat.Signal() - - def _parent(self): - finfo = self._model.fileInfo(self._rootIndex) - return finfo.fileName() - - parent = qt_compat.Property(str, _parent, notify=backendChanged) - - @qt_compat.Slot(str) - def browse_to(self, path): - if self._child is None: - self._child = FileSystemModel(self._model, path) - else: - self._child.switch_to(path) - self.childChanged.emit() - return self._child - - @qt_compat.Slot(str) - def switch_to(self, path): - with scoped_model_reset(self): - self._path = path - self._rootIndex = self._model.index(self._path) - self.backendChanged.emit() - - def __len__(self): - return self._model.rowCount(self._rootIndex) - - def __getitem__(self, key): - return self._model.index(key, 0, self._rootIndex) - - def __iter__(self): - return (self[i] for i in xrange(len(self))) - - def rowCount(self, parent=QtCore.QModelIndex()): - return len(self) - - def data(self, index, role): - if index.isValid() and 0 <= role and role < len(self.ALLINFOS): - internalIndex = self._translate_index(index) - info = self._model.fileInfo(internalIndex) - if role < len(self.FILEINFOS): - field = self.FILEINFOS[role] - value = getattr(info, field)() - else: - role -= len(self.FILEINFOS) - field = self.EXTINFOS[role] - if field == "type": - return self._model.type(internalIndex) - else: - raise NotImplementedError("Out of range that was already checked") - return value - return None - - def _on_directory_loaded(self, path): - if self._path == path: - self.backendChanged.emit() - self.reset() - - def _translate_index(self, externalIndex): - internalIndex = self._model.index(externalIndex.row(), 0, self._rootIndex) - return internalIndex - - @contextlib.contextmanager def scoped_model_reset(model): model.beginResetModel() diff --git a/www/dialcentral.deb b/www/dialcentral.deb index 221e237..057af66 100644 Binary files a/www/dialcentral.deb and b/www/dialcentral.deb differ