summaryrefslogtreecommitdiff
path: root/src/nautilus-file-utilities.c
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2018-03-23 16:46:30 +0000
committerAntónio Fernandes <antoniof@gnome.org>2018-03-23 23:32:54 +0000
commit52d80d291a3f14cd46883fb6dd1e3a6135833284 (patch)
tree2dd85ad5f74c10c3dda5518273be1d11a80d1742 /src/nautilus-file-utilities.c
parent2787773c625d647ec603bb63071a8ff0699c6ba9 (diff)
downloadnautilus-52d80d291a3f14cd46883fb6dd1e3a6135833284.tar.gz
file-utils: Remove obsolete API for desktop dir
None of this is currently used. Also, since the desktop_is_home_dir setting was removed in commit 5ab3050f22da718264a35e61ada4be1a386a6e2d, the desktop dir is always XDG_DESKTOP_DIR. Thanks to that, we can simply use this instead: nautilus_file_is_user_special_directory (file, G_USER_DIRECTORY_DESKTOP) Therefore, remove the obsolete API.
Diffstat (limited to 'src/nautilus-file-utilities.c')
-rw-r--r--src/nautilus-file-utilities.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
index 44a5b83c4..c0b7d51b6 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -391,20 +391,6 @@ nautilus_get_scripts_directory_path (void)
return g_build_filename (g_get_user_data_dir (), "nautilus", "scripts", NULL);
}
-static const char *
-get_desktop_path (void)
-{
- const char *desktop_path;
-
- desktop_path = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP);
- if (desktop_path == NULL)
- {
- desktop_path = g_get_home_dir ();
- }
-
- return desktop_path;
-}
-
char *
nautilus_get_home_directory_uri (void)
{
@@ -440,26 +426,6 @@ nautilus_get_templates_directory_uri (void)
return uri;
}
-/* These need to be reset to NULL when desktop_is_home_dir changes */
-static GFile *desktop_dir = NULL;
-static GFile *desktop_dir_dir = NULL;
-static char *desktop_dir_filename = NULL;
-
-static void
-update_desktop_dir (void)
-{
- const char *path;
- char *dirname;
-
- path = get_desktop_path ();
- desktop_dir = g_file_new_for_path (path);
-
- dirname = g_path_get_dirname (path);
- desktop_dir_dir = g_file_new_for_path (dirname);
- g_free (dirname);
- desktop_dir_filename = g_path_get_basename (path);
-}
-
gboolean
nautilus_is_home_directory_file (GFile *dir,
const char *filename)
@@ -506,31 +472,6 @@ nautilus_is_root_directory (GFile *dir)
return g_file_equal (dir, root_dir);
}
-
-gboolean
-nautilus_is_desktop_directory_file (GFile *dir,
- const char *file)
-{
- if (desktop_dir == NULL)
- {
- update_desktop_dir ();
- }
-
- return (g_file_equal (dir, desktop_dir_dir) &&
- strcmp (file, desktop_dir_filename) == 0);
-}
-
-gboolean
-nautilus_is_desktop_directory (GFile *dir)
-{
- if (desktop_dir == NULL)
- {
- update_desktop_dir ();
- }
-
- return g_file_equal (dir, desktop_dir);
-}
-
gboolean
nautilus_is_search_directory (GFile *dir)
{