소스 검색

fixed bug causing directories to disappear immediately after renaming to a long name.

Sebastian Stenzel 9 년 전
부모
커밋
bb185c3170
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      main/filesystem-nameshortening/src/main/java/org/cryptomator/filesystem/shortening/ShorteningFile.java

+ 11 - 0
main/filesystem-nameshortening/src/main/java/org/cryptomator/filesystem/shortening/ShorteningFile.java

@@ -46,4 +46,15 @@ class ShorteningFile extends DelegatingFile<ShorteningFolder> {
 		return super.openWritable();
 	}
 
+	@Override
+	public void moveTo(File destination) {
+		super.moveTo(destination);
+		if (destination instanceof ShorteningFile) {
+			ShorteningFile dest = (ShorteningFile) destination;
+			if (shortener.isShortened(dest.shortenedName())) {
+				shortener.saveMapping(dest.name(), dest.shortenedName());
+			}
+		}
+	}
+
 }