Commit dd785294 authored by Neha Yadav's avatar Neha Yadav Committed by Carlos Soriano Sánchez

file: add function nautilus_file_is_regular_file

In commit we added a new function named nautilus_file_is_regular_file

The problem is that there are function present in different files
named "!nautilus_file_is_directory()" like inside nautilus-file.c
near line #7798. So, if any newcomer will come and look into the files
then it is difficult for them to analyse that there is any other
option available for file or not.

To solve this issue create a new function inside nautilus-file
with name nautilus_file_is_a_regular_file. So, we can check
for explicit regular file type.
parent d96a0c46
......@@ -8063,6 +8063,21 @@ nautilus_file_is_nautilus_link (NautilusFile *file)
* nautilus_file_is_regular_file
* Check if this file is a regular file.
* @file: NautilusFile representing the file in question.
* Returns: TRUE if @file is a regular file.
nautilus_file_is_regular_file (NautilusFile *file)
return nautilus_file_get_file_type (file) == G_FILE_TYPE_REGULAR;
* nautilus_file_is_directory
......@@ -206,6 +206,7 @@ gboolean nautilus_file_is_broken_symbolic_link (Nautilu
gboolean nautilus_file_is_nautilus_link (NautilusFile *file);
gboolean nautilus_file_is_executable (NautilusFile *file);
gboolean nautilus_file_is_directory (NautilusFile *file);
gboolean nautlius_file_is_regular_file (NautilusFile *file);
gboolean nautilus_file_is_user_special_directory (NautilusFile *file,
GUserDirectory special_directory);
gboolean nautilus_file_is_special_link (NautilusFile *file);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment