diff options
author | Yash Jain <ydjainopensource@gmail.com> | 2018-07-23 01:22:04 +0530 |
---|---|---|
committer | António Fernandes <antoniojpfernandes@gmail.com> | 2018-07-25 12:50:33 +0000 |
commit | bc93e1cc53517c698f3cd44ca0810503237fbae4 (patch) | |
tree | 3771ce78ccfcb0928b4bed0d7883398ac6066c11 /src/nautilus-file-name-widget-controller.c | |
parent | a4529a8309987562cb50e6317ad4ff874f2a084f (diff) | |
download | nautilus-bc93e1cc53517c698f3cd44ca0810503237fbae4.tar.gz |
file-name-widget : Warn if the name will hide the file
The user should be informed that using a file/folder name starting with
"." will mark it a hidden.
Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/529
Signed-off-by: Yash Jain <ydjainopensource@gmail.com>
Diffstat (limited to 'src/nautilus-file-name-widget-controller.c')
-rw-r--r-- | src/nautilus-file-name-widget-controller.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nautilus-file-name-widget-controller.c b/src/nautilus-file-name-widget-controller.c index 9b49b0f4c..6d04ce1ed 100644 --- a/src/nautilus-file-name-widget-controller.c +++ b/src/nautilus-file-name-widget-controller.c @@ -122,6 +122,11 @@ real_name_is_valid (NautilusFileNameWidgetController *self, { *error_message = _("A file cannot be called “..”."); } + else if (g_str_has_prefix (name, ".")) + { + *error_message = _("Files with “.” at the beginning of their name are hidden."); + return TRUE; + } return *error_message == NULL; } |