diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-11-06 11:38:08 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-11-06 12:26:32 +0800 |
commit | 23c781c2475b144a365eaf50dffb88986899b4c8 (patch) | |
tree | 642be4d288b2e532c70791090672a67918602077 /e-util | |
parent | f2e75c5d13a0899b042e7c7f60639be19871f7ca (diff) | |
download | gsoc2013-evolution-23c781c2475b144a365eaf50dffb88986899b4c8.tar.gz gsoc2013-evolution-23c781c2475b144a365eaf50dffb88986899b4c8.tar.zst gsoc2013-evolution-23c781c2475b144a365eaf50dffb88986899b4c8.zip |
Remove redundant URI/filename conversion functions.
Use g_filename_to_uri() instead of e_util_filename_to_uri().
Use g_filename_from_uri() instead of e_util_uri_to_filename().
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-dialog-utils.c | 4 | ||||
-rw-r--r-- | e-util/e-util.c | 60 | ||||
-rw-r--r-- | e-util/e-util.h | 2 |
3 files changed, 5 insertions, 61 deletions
diff --git a/e-util/e-dialog-utils.c b/e-util/e-dialog-utils.c index 334375c755..952d73f303 100644 --- a/e-util/e-dialog-utils.c +++ b/e-util/e-dialog-utils.c @@ -169,7 +169,7 @@ e_file_can_save(GtkWindow *parent, const gchar *uri) if (!e_file_check_local(uri)) return TRUE; - path = e_util_uri_to_filename (uri); + path = g_filename_from_uri (uri, NULL, NULL); if (!path) return FALSE; @@ -199,7 +199,7 @@ e_file_check_local (const gchar *name) { gchar *uri; - uri = e_util_uri_to_filename (name); + uri = g_filename_to_uri (name, NULL, NULL); if (uri) { g_free(uri); return TRUE; diff --git a/e-util/e-util.c b/e-util/e-util.c index 533b3ef908..bf1f387d15 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -1418,7 +1418,7 @@ get_lock_filename (void) } gboolean -e_file_lock_create () +e_file_lock_create (void) { const gchar *fname = get_lock_filename (); gboolean status = FALSE; @@ -1435,7 +1435,7 @@ e_file_lock_create () } void -e_file_lock_destroy () +e_file_lock_destroy (void) { const gchar *fname = get_lock_filename (); @@ -1445,7 +1445,7 @@ e_file_lock_destroy () } gboolean -e_file_lock_exists () +e_file_lock_exists (void) { const gchar *fname = get_lock_filename (); @@ -1508,60 +1508,6 @@ e_util_guess_mime_type (const gchar *filename, gboolean localfile) } /** - * e_util_filename_to_uri: - * @filename: local file name. - * - * Converts a local file name to a URI. Free the returned string with - * g_free(). - * - * Returns: a newly allocated string or %NULL - **/ -gchar * -e_util_filename_to_uri (const gchar *filename) -{ - GFile *file; - gchar *uri = NULL; - - g_return_val_if_fail (filename != NULL, NULL); - - file = g_file_new_for_path (filename); - - if (file) { - uri = g_file_get_uri (file); - g_object_unref (file); - } - - return uri; -} - -/** - * e_util_uri_to_filename: - * @uri: a URI - * - * Converts a URI to a local file name. %NULL indicates no such - * local file name exists. Free the returned string with g_free(). - * - * Returns: either newly allocated string or %NULL - **/ -gchar * -e_util_uri_to_filename (const gchar *uri) -{ - GFile *file; - gchar *filename = NULL; - - g_return_val_if_fail (uri != NULL, NULL); - - file = g_file_new_for_uri (uri); - - if (file) { - filename = g_file_get_path (file); - g_object_unref (file); - } - - return filename; -} - -/** * e_util_read_file: * @filename: File name to read. * @filename_is_uri: Whether the file name is URI, if not, then it's a local path. diff --git a/e-util/e-util.h b/e-util/e-util.h index 16b3373279..88ebaa2af7 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -141,8 +141,6 @@ gboolean e_file_lock_exists (void); gchar * e_util_guess_mime_type (const gchar *filename, gboolean localfile); -gchar * e_util_filename_to_uri (const gchar *filename); -gchar * e_util_uri_to_filename (const gchar *uri); gboolean e_util_read_file (const gchar *filename, gboolean filename_is_uri, |