[nautilus/remove-unremovability-of-the-removed-icons-on-desktop-folder] file-utils: Remove obsolete API for desktop dir
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/remove-unremovability-of-the-removed-icons-on-desktop-folder] file-utils: Remove obsolete API for desktop dir
- Date: Fri, 23 Mar 2018 23:35:22 +0000 (UTC)
commit 52d80d291a3f14cd46883fb6dd1e3a6135833284
Author: António Fernandes <antoniof gnome org>
Date: Fri Mar 23 16:46:30 2018 +0000
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.
src/nautilus-file-utilities.c | 59 -------------------------------------------
src/nautilus-file-utilities.h | 3 ---
src/nautilus-file.c | 25 ------------------
src/nautilus-file.h | 1 -
4 files changed, 88 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)
{
diff --git a/src/nautilus-file-utilities.h b/src/nautilus-file-utilities.h
index 528dd418c..1affe7d8f 100644
--- a/src/nautilus-file-utilities.h
+++ b/src/nautilus-file-utilities.h
@@ -35,10 +35,7 @@
char * nautilus_get_user_directory (void);
GFile * nautilus_get_desktop_location (void);
char * nautilus_get_home_directory_uri (void);
-gboolean nautilus_is_desktop_directory_file (GFile *dir,
- const char *filename);
gboolean nautilus_is_root_directory (GFile *dir);
-gboolean nautilus_is_desktop_directory (GFile *dir);
gboolean nautilus_is_home_directory (GFile *dir);
gboolean nautilus_is_home_directory_file (GFile *dir,
const char *filename);
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 541897d16..1ed3c6f12 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -1593,31 +1593,6 @@ nautilus_file_poll_for_media (NautilusFile *file)
}
}
-/**
- * nautilus_file_is_desktop_directory:
- *
- * Check whether this file is the desktop directory.
- *
- * @file: The file to check.
- *
- * Return value: TRUE if this is the physical desktop directory.
- */
-gboolean
-nautilus_file_is_desktop_directory (NautilusFile *file)
-{
- g_autoptr (GFile) location = NULL;
-
- g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE);
-
- location = nautilus_directory_get_location (file->details->directory);
- if (location == NULL)
- {
- return FALSE;
- }
-
- return nautilus_is_desktop_directory_file (location, eel_ref_str_peek (file->details->name));
-}
-
static gboolean
is_desktop_file (NautilusFile *file)
{
diff --git a/src/nautilus-file.h b/src/nautilus-file.h
index 147ad4649..7da949cc3 100644
--- a/src/nautilus-file.h
+++ b/src/nautilus-file.h
@@ -219,7 +219,6 @@ gboolean nautilus_file_is_remote (Nautilu
gboolean nautilus_file_is_other_locations (NautilusFile
*file);
gboolean nautilus_file_is_starred_location (NautilusFile
*file);
gboolean nautilus_file_is_home (NautilusFile
*file);
-gboolean nautilus_file_is_desktop_directory (NautilusFile
*file);
GError * nautilus_file_get_file_info_error (NautilusFile
*file);
gboolean nautilus_file_get_directory_item_count (NautilusFile
*file,
guint
*count,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]