251 watcher = EricFileSystemWatcher.instance() |
251 watcher = EricFileSystemWatcher.instance() |
252 watcher.directoryCreated.connect(lambda x: self.entryCreated(x, isDir=True)) |
252 watcher.directoryCreated.connect(lambda x: self.entryCreated(x, isDir=True)) |
253 watcher.directoryDeleted.connect(lambda x: self.entryDeleted(x, isDir=True)) |
253 watcher.directoryDeleted.connect(lambda x: self.entryDeleted(x, isDir=True)) |
254 watcher.fileCreated.connect(lambda x: self.entryCreated(x, isDir=False)) |
254 watcher.fileCreated.connect(lambda x: self.entryCreated(x, isDir=False)) |
255 watcher.fileDeleted.connect(lambda x: self.entryDeleted(x, isDir=False)) |
255 watcher.fileDeleted.connect(lambda x: self.entryDeleted(x, isDir=False)) |
|
256 watcher.fileMoved.connect(self.entryMoved) |
256 |
257 |
257 self.inRefresh = False |
258 self.inRefresh = False |
258 |
259 |
259 self.colorNames = { |
260 self.colorNames = { |
260 "A": "VcsAdded", |
261 "A": "VcsAdded", |
843 |
844 |
844 @param path path of the deleted file or directory |
845 @param path path of the deleted file or directory |
845 @type str |
846 @type str |
846 @param isDir flag indicating a deleted directory (defaults to False) |
847 @param isDir flag indicating a deleted directory (defaults to False) |
847 @type bool (optional) |
848 @type bool (optional) |
|
849 @return flag indicating a deletion |
|
850 @rtype bool |
848 """ |
851 """ |
849 if not self.__watcherActive: |
852 if not self.__watcherActive: |
850 return |
853 return False |
851 |
854 |
852 super().entryDeleted(path, isDir=isDir) |
855 return super().entryDeleted(path, isDir=isDir) |
|
856 |
|
857 def entryMoved(self, srcPath, tgtPath): |
|
858 """ |
|
859 Public slot handling the renaming of a non-managed file. |
|
860 |
|
861 @param srcPath original name |
|
862 @type str |
|
863 @param tgtPath new name |
|
864 @type str |
|
865 """ |
|
866 if self.entryDeleted(srcPath, isDir=False): |
|
867 self.entryCreated(tgtPath, isDir=False) |
853 |
868 |
854 def __addVCSStatus(self, item, name): |
869 def __addVCSStatus(self, item, name): |
855 """ |
870 """ |
856 Private method used to set the vcs status of a node. |
871 Private method used to set the vcs status of a node. |
857 |
872 |