Commit ca02d134 authored by Sam Thursfield's avatar Sam Thursfield
Browse files

libtracker-miners-common: Remove unused file utils function

parent 1b78faca
Pipeline #215444 passed with stage
in 2 minutes and 58 seconds
......@@ -319,44 +319,6 @@ tracker_file_system_get_remaining_space_percentage (const gchar *path)
}
}
gboolean
tracker_file_system_has_enough_space (const gchar *path,
gulong required_bytes,
gboolean creating_db)
{
gchar *str1;
gchar *str2;
gboolean enough;
guint64 remaining;
g_return_val_if_fail (path != NULL, FALSE);
remaining = tracker_file_system_get_remaining_space (path);
enough = (remaining >= required_bytes);
if (creating_db) {
str1 = g_format_size (required_bytes);
str2 = g_format_size (remaining);
if (!enough) {
g_critical ("Not enough disk space to create databases, "
"%s remaining, %s required as a minimum",
str2,
str1);
} else {
g_debug ("Checking for adequate disk space to create databases, "
"%s remaining, %s required as a minimum",
str2,
str1);
}
g_free (str2);
g_free (str1);
}
return enough;
}
gboolean
tracker_path_is_in_path (const gchar *path,
const gchar *in_path)
......
......@@ -57,9 +57,6 @@ gboolean tracker_filename_casecmp_without_extension (const gchar *a,
const gchar *b);
/* File system utils */
gboolean tracker_file_system_has_enough_space (const gchar *path,
gulong required_bytes,
gboolean creating_db);
guint64 tracker_file_system_get_remaining_space (const gchar *path);
gdouble tracker_file_system_get_remaining_space_percentage (const gchar *path);
......
......@@ -364,17 +364,6 @@ test_file_system_get_remaining_space_percentage ()
//space = tracker_file_system_get_remaining_space_percentage ("/unlikely/to/have/this/folder");
}
static void
test_file_system_has_enough_space ()
{
/* Hopefully we will always have 1 byte free... */
g_assert_true (tracker_file_system_has_enough_space ("/home", 1, FALSE));
g_assert_true (tracker_file_system_has_enough_space ("/home", 1, TRUE));
/* gulong goes only up to 4Gb. Cannot ask for unreasonable amount of space */
//g_assert_true (!tracker_file_system_has_enough_space ("/home", G_MAXULONG, FALSE));
}
static void
test_file_exists_and_writable ()
{
......@@ -466,8 +455,6 @@ main (int argc, char **argv)
test_file_system_get_remaining_space);
g_test_add_func ("/libtracker-common/file-utils/get_remaining_space_percentage",
test_file_system_get_remaining_space_percentage);
g_test_add_func ("/libtracker-common/file-utils/has_enough_space",
test_file_system_has_enough_space);
g_test_add_func ("/libtracker-common/file-utils/has_write_access_or_was_created",
test_file_exists_and_writable);
g_test_add_func ("/libtracker-common/file-utils/is_hidden",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment