summaryrefslogtreecommitdiff
path: root/src/nautilus-file-name-widget-controller.c
diff options
context:
space:
mode:
authorYash Jain <ydjainopensource@gmail.com>2018-07-23 01:22:04 +0530
committerAntónio Fernandes <antoniojpfernandes@gmail.com>2018-07-25 12:50:33 +0000
commitbc93e1cc53517c698f3cd44ca0810503237fbae4 (patch)
tree3771ce78ccfcb0928b4bed0d7883398ac6066c11 /src/nautilus-file-name-widget-controller.c
parenta4529a8309987562cb50e6317ad4ff874f2a084f (diff)
downloadnautilus-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.c5
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;
}