Commits

Yuya Nishihara committed 402e2fb

manifestmodel: disable lookup of file-type icons from system (fixes #3594)

Current implementation has several issues:

- doubled overlay icon due to Explorer integration (Windows Vista or later?)
- SHGetFileInfo() is not recommended to call from the main thread (Windows)
http://msdn.microsoft.com/en-us/library/windows/desktop/bb762179(v=vs.85).aspx
- extra overhead to stat() working-directory files (and does not work if the
file has been removed)
- some icons are hard to distinguish with status overlay

  • Participants
  • Parent commits 9c3f447
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/manifestmodel.py

         elif e.isdir:
             ic = self._fileiconprovider.icon(QFileIconProvider.Folder)
         else:
-            # assumes file still exists in wdir; otherwise falls back to default
-            info = QFileInfo(os.path.join(self._repoagent.rootPath(), e.path))
-            ic = self._fileiconprovider.icon(info)
-            if ic.isNull():
-                ic = self._fileiconprovider.icon(QFileIconProvider.File)
+            # do not use fileiconprovier.icon(fileinfo), which may return icon
+            # with shell (i.e. status of working directory) overlay.
+            ic = self._fileiconprovider.icon(QFileIconProvider.File)
 
         if not e.status:
             return ic