Commits

Yuya Nishihara committed ecb9418 Merge

Merge with stable

Comments (0)

Files changed (3)

tortoisehg/hgqt/filelistmodel.py

 
     def indexFromFile(self, filename):
         if filename in self._filesdict:
-            row = self._files.index(self._filesdict[filename])
-            return self.index(row, 0)
+            try:
+                row = self._files.index(self._filesdict[filename])
+                return self.index(row, 0)
+            except ValueError:
+                pass
         return QModelIndex()
 
     def setFilter(self, match):
         'simple match in filename filter'
         self.layoutAboutToBeChanged.emit()
+        oldindexes = [(self.indexFromFile(r['path']), r['path'])
+                      for r in self._files]
         self._files = [r for r in self._unfilteredfiles
-            if unicode(match) in r['path']]
+            if hglib.fromunicode(match) in r['path']]
+        for oi, filename in oldindexes:
+            self.changePersistentIndex(oi, self.indexFromFile(filename))
         self.layoutChanged.emit()
-        self.reset()
 
     def _buildDesc(self, parent):
         files = []

tortoisehg/hgqt/settings.py

 ({'name': 'log', 'label': _('Workbench'), 'icon': 'menulog'}, (
     _fi(_('Single Workbench Window'), 'tortoisehg.workbench.single', genBoolRBGroup,
         _('Select whether you want to have a single workbench window. '
-        'If you disable this setting you will get a new workbench window everytime that you use the "Hg Workbench"'
+        'If you disable this setting you will get a new workbench window everytime that you use the "Hg Workbench" '
         'command on the explorer context menu. Default: True'),
         restartneeded=True, globalonly=True),
     _fi(_('Default widget'), 'tortoisehg.defaultwidget', (genDefaultCombo,

tortoisehg/hgqt/sync.py

         sm = self.reltv.selectionModel()
         sm.currentRowChanged.connect(self.pathSelected)
 
-        # restore the current alias and its url
-        if self.curalias in self.paths:
-            self.setUrl(hglib.tounicode(self.curalias))
-
     def currentUrl(self):
         return unicode(self.urlentry.text())
 
         dlg.setWindowModality(Qt.WindowModal)
         if dlg.exec_() == QDialog.Accepted:
             self.curalias = hglib.fromunicode(dlg.aliasentry.text())
+            self.setEditUrl(dlg.urlentry.text())
             self.reload()
 
     def removeurl(self):