summaryrefslogtreecommitdiff
path: root/src/libtracker-common
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-11-06 10:55:02 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-11-08 21:42:45 +0100
commit35e92c3e587724e21aff216786210bd1f249ed7b (patch)
tree486f13e24980b5a2d299b4ccbef80b7aa200b5e0 /src/libtracker-common
parent46b9133c7548384dd9a1b027e2ef91fc712e4a94 (diff)
downloadtracker-35e92c3e587724e21aff216786210bd1f249ed7b.tar.gz
libtracker-common: Drop unused function and its test
This function is no longer used, so makes no sense to test for it. This test used to break on CI with the default docker images because of user permissions, so this obstacle is removed.
Diffstat (limited to 'src/libtracker-common')
-rw-r--r--src/libtracker-common/tracker-file-utils.c81
-rw-r--r--src/libtracker-common/tracker-file-utils.h1
2 files changed, 0 insertions, 82 deletions
diff --git a/src/libtracker-common/tracker-file-utils.c b/src/libtracker-common/tracker-file-utils.c
index ce9b7e98d..57ced9142 100644
--- a/src/libtracker-common/tracker-file-utils.c
+++ b/src/libtracker-common/tracker-file-utils.c
@@ -650,87 +650,6 @@ tracker_path_evaluate_name (const gchar *path)
return final_path;
}
-static gboolean
-path_has_write_access (const gchar *path,
- gboolean *exists)
-{
- GFile *file;
- GFileInfo *info;
- GError *error = NULL;
- gboolean writable;
-
- g_return_val_if_fail (path != NULL, FALSE);
- g_return_val_if_fail (path[0] != '\0', FALSE);
-
- file = g_file_new_for_path (path);
- info = g_file_query_info (file,
- G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
- 0,
- NULL,
- &error);
-
- if (G_UNLIKELY (error)) {
- if (error->code == G_IO_ERROR_NOT_FOUND) {
- if (exists) {
- *exists = FALSE;
- }
- } else {
- gchar *uri;
-
- uri = g_file_get_uri (file);
- g_warning ("Could not check if we have write access for "
- "'%s': %s",
- uri,
- error->message);
- g_free (uri);
- }
-
- g_error_free (error);
-
- writable = FALSE;
- } else {
- if (exists) {
- *exists = TRUE;
- }
-
- writable = g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE);
-
- g_object_unref (info);
- }
-
- g_object_unref (file);
-
- return writable;
-}
-
-gboolean
-tracker_path_has_write_access_or_was_created (const gchar *path)
-{
- gboolean writable;
- gboolean exists = FALSE;
-
- writable = path_has_write_access (path, &exists);
- if (exists) {
- if (writable) {
- g_message (" Path is OK");
- return TRUE;
- }
-
- g_message (" Path can not be written to");
- } else {
- g_message (" Path does not exist, attempting to create...");
-
- if (g_mkdir_with_parents (path, 0700) == 0) {
- g_message (" Path was created");
- return TRUE;
- }
-
- g_message (" Path could not be created");
- }
-
- return FALSE;
-}
-
gboolean
tracker_file_is_hidden (GFile *file)
{
diff --git a/src/libtracker-common/tracker-file-utils.h b/src/libtracker-common/tracker-file-utils.h
index 2b6beabde..45c5f9374 100644
--- a/src/libtracker-common/tracker-file-utils.h
+++ b/src/libtracker-common/tracker-file-utils.h
@@ -52,7 +52,6 @@ GSList * tracker_path_list_filter_duplicates (GSList *roots,
const gchar *basename_exception_prefix,
gboolean is_recursive);
gchar * tracker_path_evaluate_name (const gchar *uri);
-gboolean tracker_path_has_write_access_or_was_created (const gchar *path);
gboolean tracker_filename_casecmp_without_extension (const gchar *a,
const gchar *b);