Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
thunar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pratik Karki
thunar
Commits
3a01c1e7
Commit
3a01c1e7
authored
14 years ago
by
Jannis Pohlmann
Browse files
Options
Downloads
Patches
Plain Diff
Add function thunar_file_is_parent().
parent
14d505a1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
thunar/thunar-file.c
+31
-0
31 additions, 0 deletions
thunar/thunar-file.c
thunar/thunar-file.h
+2
-0
2 additions, 0 deletions
thunar/thunar-file.h
with
33 additions
and
0 deletions
thunar/thunar-file.c
+
31
−
0
View file @
3a01c1e7
...
...
@@ -2008,6 +2008,37 @@ thunar_file_is_local (const ThunarFile *file)
/**
* thunar_file_is_parent:
* @file : a #ThunarFile instance.
* @child : another #ThunarFile instance.
*
* Determines whether @file is the parent directory of @child.
*
* Return value: %TRUE if @file is the parent of @child.
**/
gboolean
thunar_file_is_parent
(
const
ThunarFile
*
file
,
const
ThunarFile
*
child
)
{
gboolean
is_parent
=
FALSE
;
GFile
*
parent
;
_thunar_return_val_if_fail
(
THUNAR_IS_FILE
(
file
),
FALSE
);
_thunar_return_val_if_fail
(
THUNAR_IS_FILE
(
child
),
FALSE
);
parent
=
g_file_get_parent
(
child
->
gfile
);
if
(
parent
!=
NULL
)
{
is_parent
=
g_file_equal
(
file
->
gfile
,
parent
);
g_object_unref
(
parent
);
}
return
is_parent
;
}
/**
* thunar_file_is_ancestor:
* @file : a #ThunarFile instance.
...
...
This diff is collapsed.
Click to expand it.
thunar/thunar-file.h
+
2
−
0
View file @
3a01c1e7
...
...
@@ -190,6 +190,8 @@ gboolean thunar_file_is_directory (const ThunarFile *file
gboolean
thunar_file_is_shortcut
(
const
ThunarFile
*
file
);
gboolean
thunar_file_is_mountable
(
const
ThunarFile
*
file
);
gboolean
thunar_file_is_local
(
const
ThunarFile
*
file
);
gboolean
thunar_file_is_parent
(
const
ThunarFile
*
file
,
const
ThunarFile
*
child
);
gboolean
thunar_file_is_ancestor
(
const
ThunarFile
*
file
,
const
ThunarFile
*
ancestor
);
gboolean
thunar_file_is_executable
(
const
ThunarFile
*
file
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment