summaryrefslogtreecommitdiff
path: root/libcaja-private
diff options
context:
space:
mode:
authorKonstantin Unruh <[email protected]>2021-02-20 18:50:23 +0100
committerraveit65 <[email protected]>2021-03-24 10:19:42 +0100
commita0df7f63792f0970100efff856ea0076e3faf15e (patch)
treeac692af6e5fcd9520656a2e202262d8951f3348a /libcaja-private
parenta4f17cc150578eb24980cf4f23a6d1442bb4868d (diff)
downloadcaja-a0df7f63792f0970100efff856ea0076e3faf15e.tar.bz2
caja-a0df7f63792f0970100efff856ea0076e3faf15e.tar.xz
keep one .desktop suffix on desktop file renaming
Diffstat (limited to 'libcaja-private')
-rw-r--r--libcaja-private/caja-file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c
index 1b3bf220..be5a5732 100644
--- a/libcaja-private/caja-file.c
+++ b/libcaja-private/caja-file.c
@@ -1931,7 +1931,10 @@ caja_file_rename (CajaFile *file,
g_error_free (error);
return;
}
- new_file_name = g_strdup_printf ("%s.desktop", new_name);
+ if (!g_str_has_suffix(new_name, ".desktop"))
+ new_file_name = g_strdup_printf ("%s.desktop", new_name);
+ else
+ new_file_name = g_strdup_printf("%s", new_name);
new_file_name = g_strdelimit (new_file_name, "/", '-');
if (name_is (file, new_file_name)) {