From 2df10bc2b6ad7b8081c865cfb02319155a483bd0 Mon Sep 17 00:00:00 2001 From: CyberGlitch01 Date: Fri, 17 Nov 2023 14:30:29 +0530 Subject: [PATCH] fix: Do not allow creating file with name and format that already exists #1 --- .../dragon/ide/ui/dialogs/filemanager/CreateFileDialog.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/dragon/ide/ui/dialogs/filemanager/CreateFileDialog.java b/app/src/main/java/com/dragon/ide/ui/dialogs/filemanager/CreateFileDialog.java index d8f4a23..81bf166 100644 --- a/app/src/main/java/com/dragon/ide/ui/dialogs/filemanager/CreateFileDialog.java +++ b/app/src/main/java/com/dragon/ide/ui/dialogs/filemanager/CreateFileDialog.java @@ -109,7 +109,11 @@ public void afterTextChanged(Editable arg0) {} if (FileNameValidator.isValidFileName(binding.fileName.getText().toString())) { boolean isNameInUse = false; for (int i = 0; i < fileList.size(); ++i) { - if (fileList.get(i).getFilePath() == binding.fileName.getText().toString()) { + if (fileList + .get(i) + .getFilePath() + .toLowerCase() + .equals(binding.fileName.getText().toString().toLowerCase())) { int fileType = fileList.get(i).getFileType(); int fileCreatingButton = binding.fileTypeChooser.getCheckedButtonId(); if (fileCreatingButton == R.id.html) {