This commit is contained in:
Vitaliy 2021-03-15 20:57:34 +02:00
parent b7dd8dca05
commit f692339a36

View file

@ -131,7 +131,10 @@ public class RenameFileBottomSheet extends MenuBottomSheetDialogFragment {
File dest; File dest;
int index = file.getName().lastIndexOf('.'); int index = file.getName().lastIndexOf('.');
String ext = index == -1 ? "" : file.getName().substring(index); String ext = index == -1 ? "" : file.getName().substring(index);
String newName = Algorithms.getFileNameWithoutExtension(selectedFileName); String newName = selectedFileName;
if (selectedFileName.endsWith(ext)) {
newName = selectedFileName.substring(0, selectedFileName.lastIndexOf(ext));
}
if (SQLiteTileSource.EXT.equals(ext)) { if (SQLiteTileSource.EXT.equals(ext)) {
dest = renameSQLiteFile(app, file, newName + ext, null); dest = renameSQLiteFile(app, file, newName + ext, null);
} else if (IndexConstants.GPX_FILE_EXT.equals(ext)) { } else if (IndexConstants.GPX_FILE_EXT.equals(ext)) {