aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-11-06 11:38:08 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-11-06 12:26:32 +0800
commit23c781c2475b144a365eaf50dffb88986899b4c8 (patch)
tree642be4d288b2e532c70791090672a67918602077
parentf2e75c5d13a0899b042e7c7f60639be19871f7ca (diff)
downloadgsoc2013-evolution-23c781c2475b144a365eaf50dffb88986899b4c8.tar
gsoc2013-evolution-23c781c2475b144a365eaf50dffb88986899b4c8.tar.gz
gsoc2013-evolution-23c781c2475b144a365eaf50dffb88986899b4c8.tar.bz2
gsoc2013-evolution-23c781c2475b144a365eaf50dffb88986899b4c8.tar.lz
gsoc2013-evolution-23c781c2475b144a365eaf50dffb88986899b4c8.tar.xz
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().
-rw-r--r--doc/reference/shell/eshell-sections.txt2
-rw-r--r--doc/reference/shell/tmpl/e-util.sgml18
-rw-r--r--doc/reference/shell/tmpl/eshell-unused.sgml16
-rw-r--r--e-util/e-dialog-utils.c4
-rw-r--r--e-util/e-util.c60
-rw-r--r--e-util/e-util.h2
6 files changed, 21 insertions, 81 deletions
diff --git a/doc/reference/shell/eshell-sections.txt b/doc/reference/shell/eshell-sections.txt
index 82a7ca5a06..b69e65f3fd 100644
--- a/doc/reference/shell/eshell-sections.txt
+++ b/doc/reference/shell/eshell-sections.txt
@@ -572,8 +572,6 @@ e_file_lock_create
e_file_lock_destroy
e_file_lock_exists
e_util_guess_mime_type
-e_util_filename_to_uri
-e_util_uri_to_filename
e_util_read_file
e_util_get_category_filter_options
e_charset_add_radio_actions
diff --git a/doc/reference/shell/tmpl/e-util.sgml b/doc/reference/shell/tmpl/e-util.sgml
index 7d2fde14a7..50af7459be 100644
--- a/doc/reference/shell/tmpl/e-util.sgml
+++ b/doc/reference/shell/tmpl/e-util.sgml
@@ -354,24 +354,6 @@ Miscellaneous Utility Functions
@Returns:
-<!-- ##### FUNCTION e_util_filename_to_uri ##### -->
-<para>
-
-</para>
-
-@filename:
-@Returns:
-
-
-<!-- ##### FUNCTION e_util_uri_to_filename ##### -->
-<para>
-
-</para>
-
-@uri:
-@Returns:
-
-
<!-- ##### FUNCTION e_util_read_file ##### -->
<para>
diff --git a/doc/reference/shell/tmpl/eshell-unused.sgml b/doc/reference/shell/tmpl/eshell-unused.sgml
index 4505a66d99..99ad9d4067 100644
--- a/doc/reference/shell/tmpl/eshell-unused.sgml
+++ b/doc/reference/shell/tmpl/eshell-unused.sgml
@@ -2238,6 +2238,22 @@ intelligent
</para>
+<!-- ##### FUNCTION e_util_filename_to_uri ##### -->
+<para>
+
+</para>
+
+@filename:
+@Returns:
+
+<!-- ##### FUNCTION e_util_uri_to_filename ##### -->
+<para>
+
+</para>
+
+@uri:
+@Returns:
+
<!-- ##### FUNCTION es_event_get_type ##### -->
<para>
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,