diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | backends/markup-tree.c | 2 | ||||
-rw-r--r-- | backends/xml-dir.c | 8 | ||||
-rw-r--r-- | doc/gconf/gconf-sections.txt | 2 | ||||
-rw-r--r-- | doc/gconf/tmpl/gconf-internals.sgml | 19 | ||||
-rw-r--r-- | gconf/gconf-backend.c | 4 | ||||
-rw-r--r-- | gconf/gconf-internals.c | 25 | ||||
-rw-r--r-- | gconf/gconf-internals.h | 11 | ||||
-rw-r--r-- | gconf/gconfd.c | 2 |
9 files changed, 23 insertions, 65 deletions
@@ -3,6 +3,21 @@ Patch from Paolo Borelli <pborelli@katamail.com> + * backends/markup-tree.c: + * backends/xml-dir.c: + * doc/gconf/gconf-sections.txt: + * doc/gconf/tmpl/gconf-internals.sgml: + * gconf/gconf-backend.c: + * gconf/gconf-internals.[ch]: + * gconf/gconfd.c: + use g_file_test instead of home brew + gconf_file_test and gconf_file_exists functions + +2007-03-02 Ray Strode <rstrode@redhat.com> + + Patch from + Paolo Borelli <pborelli@katamail.com> + * gconf/gconf.c (gconf_clear_cache): Drop dead code (coverity 2208, bug 341724) diff --git a/backends/markup-tree.c b/backends/markup-tree.c index 645d0d49..2e7434cd 100644 --- a/backends/markup-tree.c +++ b/backends/markup-tree.c @@ -495,7 +495,7 @@ load_subtree (MarkupDir *dir) char *markup_file; markup_file = markup_dir_build_file_path (dir, TRUE, NULL); - if (!gconf_file_exists (markup_file)) + if (!g_file_test (markup_file, G_FILE_TEST_EXISTS)) { g_free (markup_file); return FALSE; diff --git a/backends/xml-dir.c b/backends/xml-dir.c index 022ef4f4..ec74593b 100644 --- a/backends/xml-dir.c +++ b/backends/xml-dir.c @@ -454,7 +454,7 @@ dir_sync (Dir *d, if (outfile == NULL) { /* Try to solve the problem by creating the FS dir */ - if (!gconf_file_exists(d->fs_dirname)) + if (!g_file_test (d->fs_dirname, G_FILE_TEST_EXISTS)) { if (create_fs_dir(d->fs_dirname, d->xml_filename, d->root_dir_len, @@ -527,7 +527,7 @@ dir_sync (Dir *d, } #endif - old_existed = gconf_file_exists (d->xml_filename); + old_existed = g_file_test (d->xml_filename, G_FILE_TEST_EXISTS); if (old_existed) { @@ -1219,8 +1219,8 @@ create_fs_dir(const gchar* dir, const gchar* xml_filename, g_return_val_if_fail(xml_filename != NULL, FALSE); gconf_log(GCL_DEBUG, "Enter create_fs_dir: %s", dir); - - if (gconf_file_test(xml_filename, GCONF_FILE_ISFILE)) + + if (g_file_test(xml_filename, G_FILE_TEST_IS_REGULAR)) { gconf_log(GCL_DEBUG, "XML backend file %s already exists", xml_filename); return TRUE; diff --git a/doc/gconf/gconf-sections.txt b/doc/gconf/gconf-sections.txt index b4f0a2bf..df5173b3 100644 --- a/doc/gconf/gconf-sections.txt +++ b/doc/gconf/gconf-sections.txt @@ -99,8 +99,6 @@ gconf_compose_errors <FILE>gconf-internals</FILE> gconf_key_directory gconf_key_key -gconf_file_test -gconf_file_exists gconf_value_from_corba_value corba_value_from_gconf_value fill_corba_value_from_gconf_value diff --git a/doc/gconf/tmpl/gconf-internals.sgml b/doc/gconf/tmpl/gconf-internals.sgml index dab74b85..984745c2 100644 --- a/doc/gconf/tmpl/gconf-internals.sgml +++ b/doc/gconf/tmpl/gconf-internals.sgml @@ -35,25 +35,6 @@ gconf-internals @Returns: -<!-- ##### FUNCTION gconf_file_test ##### --> -<para> - -</para> - -@filename: -@test: -@Returns: - - -<!-- ##### FUNCTION gconf_file_exists ##### --> -<para> - -</para> - -@filename: -@Returns: - - <!-- ##### FUNCTION gconf_value_from_corba_value ##### --> <para> diff --git a/gconf/gconf-backend.c b/gconf/gconf-backend.c index 3fd6ec86..2a785742 100644 --- a/gconf/gconf-backend.c +++ b/gconf/gconf-backend.c @@ -185,7 +185,7 @@ gconf_backend_file(const gchar* address) g_free(back); - if (gconf_file_exists(retval)) + if (g_file_test(retval, G_FILE_TEST_EXISTS)) { g_free(file); @@ -205,7 +205,7 @@ gconf_backend_file(const gchar* address) g_free(dir); - if (gconf_file_exists(retval)) + if (g_file_test(retval, G_FILE_TEST_EXISTS)) { g_free(file); return retval; diff --git a/gconf/gconf-internals.c b/gconf/gconf-internals.c index ceb84d2f..12f8f3fc 100644 --- a/gconf/gconf-internals.c +++ b/gconf/gconf-internals.c @@ -127,31 +127,6 @@ gconf_key_key (const gchar* key) * Random stuff */ -gboolean -gconf_file_exists (const gchar* filename) -{ - struct stat s; - - g_return_val_if_fail (filename != NULL,FALSE); - - return g_stat (filename, &s) == 0; -} - -gboolean -gconf_file_test(const gchar* filename, int test) -{ - struct stat s; - if(g_stat (filename, &s) != 0) - return FALSE; - if(!(test & GCONF_FILE_ISFILE) && S_ISREG(s.st_mode)) - return FALSE; - if(!(test & GCONF_FILE_ISLINK) && S_ISLNK(s.st_mode)) - return FALSE; - if(!(test & GCONF_FILE_ISDIR) && S_ISDIR(s.st_mode)) - return FALSE; - return TRUE; -} - GConfValue* gconf_value_from_corba_value(const ConfigValue* value) { diff --git a/gconf/gconf-internals.h b/gconf/gconf-internals.h index 42ebda09..1852af5f 100644 --- a/gconf/gconf-internals.h +++ b/gconf/gconf-internals.h @@ -90,17 +90,6 @@ const char *_gconf_win32_get_home_dir (void); gchar* gconf_key_directory (const gchar* key); const gchar* gconf_key_key (const gchar* key); -/* These file tests are in libgnome, I cut-and-pasted them */ -enum { - GCONF_FILE_EXISTS=(1<<0)|(1<<1)|(1<<2), /*any type of file*/ - GCONF_FILE_ISFILE=1<<0, - GCONF_FILE_ISLINK=1<<1, - GCONF_FILE_ISDIR=1<<2 -}; - -gboolean gconf_file_test (const gchar* filename, int test); -gboolean gconf_file_exists (const gchar* filename); - GConfValue* gconf_value_from_corba_value (const ConfigValue *value); ConfigValue* gconf_corba_value_from_gconf_value (const GConfValue *value); void gconf_fill_corba_value_from_gconf_value (const GConfValue *value, diff --git a/gconf/gconfd.c b/gconf/gconfd.c index 8de7f524..556d2364 100644 --- a/gconf/gconfd.c +++ b/gconf/gconfd.c @@ -1571,7 +1571,7 @@ logfile_save (void) fd = -1; /* Move the main saved state file aside, if it exists */ - if (gconf_file_exists (logfile)) + if (g_file_test(logfile, G_FILE_TEST_EXISTS)) { tmpfile2 = g_strconcat (logfile, ".orig", NULL); if (g_rename (logfile, tmpfile2) < 0) |