lib: Add a helper to convert struct stat → GFileInfo
It's more natural for a few calling places. Prep for patches to go the other way, which in turn are prep for adding a commit filter v2 that takes `struct stat`. `ot_gfile_type_for_mode()` was only used in this function, so inline it here. Closes: #974 Approved by: jlebon
This commit is contained in:
1 parent
1a9a473580
commit
d57410a7e6
8 files changed
+58
-72
No files matched your search
@@ -35,22 +35,6 @@
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
||||
GFileType
|
||||
ot_gfile_type_for_mode (guint32 mode)
|
||||
{
|
||||
if (S_ISDIR (mode))
|
||||
return G_FILE_TYPE_DIRECTORY;
|
||||
else if (S_ISREG (mode))
|
||||
return G_FILE_TYPE_REGULAR;
|
||||
else if (S_ISLNK (mode))
|
||||
return G_FILE_TYPE_SYMBOLIC_LINK;
|
||||
else if (S_ISBLK (mode) || S_ISCHR(mode) || S_ISFIFO(mode))
|
||||
return G_FILE_TYPE_SPECIAL;
|
||||
else
|
||||
return G_FILE_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
|
||||
GFile *
|
||||
ot_gfile_resolve_path_printf (GFile *path,
|
||||
const char *format,
|
||||
|
||||
Reference in new issue
Block a user