diff options
author | Jasmine Hassan <[email protected]> | 2012-10-18 11:29:02 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-11-16 09:49:21 +0200 |
commit | 639c9137b77557f38946d6dc174772554343da47 (patch) | |
tree | 74ee23abc1fab3fb720f1da16ae94e864b2b205d /eel/eel-glib-extensions.c | |
parent | eb0fb3845bd7a6f3b566c454d16b6f7cd287ef9c (diff) | |
download | caja-639c9137b77557f38946d6dc174772554343da47.tar.bz2 caja-639c9137b77557f38946d6dc174772554343da47.tar.xz |
[eel] remove unused eel_get_filename_charset()
http://git.gnome.org/browse/nautilus/commit/?id=00c0b9daa2053a110e17c64fb79ce4884290dc76
Diffstat (limited to 'eel/eel-glib-extensions.c')
-rw-r--r-- | eel/eel-glib-extensions.c | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/eel/eel-glib-extensions.c b/eel/eel-glib-extensions.c index 63ac74a7..5b016aad 100644 --- a/eel/eel-glib-extensions.c +++ b/eel/eel-glib-extensions.c @@ -775,104 +775,6 @@ eel_remove_weak_pointer (gpointer pointer_location) *object_location = NULL; } -/* Get the filename encoding, returns TRUE if utf8 */ - -typedef struct _EelFilenameCharsetCache EelFilenameCharsetCache; - -struct _EelFilenameCharsetCache -{ - gboolean is_utf8; - gchar *charset; - gchar *filename_charset; -}; - -static void -filename_charset_cache_free (gpointer data) -{ - EelFilenameCharsetCache *cache = data; - g_free (cache->charset); - g_free (cache->filename_charset); - g_free (cache); -} - -/* - * eel_get_filename_charset: - * @charset: return location for the name of the filename encoding - * - * Determines the character set used for filenames by consulting the - * environment variables G_FILENAME_ENCODING and G_BROKEN_FILENAMES. - * - * G_FILENAME_ENCODING may be set to a comma-separated list of character - * set names. The special token "@locale" is taken to mean the character set - * for the current locale. The first character set from the list is taken - * as the filename encoding. - * If G_FILENAME_ENCODING is not set, but G_BROKEN_FILENAMES is, the - * character set of the current locale is taken as the filename encoding. - * - * The returned @charset belongs to Eel and must not be freed. - * - * Return value: %TRUE if the charset used for filename is UTF-8. - */ -gboolean -eel_get_filename_charset (const gchar **filename_charset) -{ - static GStaticPrivate cache_private = G_STATIC_PRIVATE_INIT; - EelFilenameCharsetCache *cache = g_static_private_get (&cache_private); - const gchar *charset; - - if (!cache) - { - cache = g_new0 (EelFilenameCharsetCache, 1); - g_static_private_set (&cache_private, cache, filename_charset_cache_free); - } - - g_get_charset (&charset); - - if (!(cache->charset && strcmp (cache->charset, charset) == 0)) - { - const gchar *new_charset; - gchar *p, *q; - - g_free (cache->charset); - g_free (cache->filename_charset); - cache->charset = g_strdup (charset); - - p = getenv ("G_FILENAME_ENCODING"); - if (p != NULL) - { - q = strchr (p, ','); - if (!q) - q = p + strlen (p); - - if (strncmp ("@locale", p, q - p) == 0) - { - cache->is_utf8 = g_get_charset (&new_charset); - cache->filename_charset = g_strdup (new_charset); - } - else - { - cache->filename_charset = g_strndup (p, q - p); - cache->is_utf8 = (strcmp (cache->filename_charset, "UTF-8") == 0); - } - } - else if (getenv ("G_BROKEN_FILENAMES") != NULL) - { - cache->is_utf8 = g_get_charset (&new_charset); - cache->filename_charset = g_strdup (new_charset); - } - else - { - cache->filename_charset = g_strdup ("UTF-8"); - cache->is_utf8 = TRUE; - } - } - - if (filename_charset) - *filename_charset = cache->filename_charset; - - return cache->is_utf8; -} - static void update_auto_boolean (GSettings *settings, const gchar *key, |