[tracker] libtracker-common: Remove unused language functions



commit 146980a697fd205acaa7a385199f3947aef0c744
Author: Jürg Billeter <j bitron ch>
Date:   Thu Mar 18 14:00:03 2010 +0100

    libtracker-common: Remove unused language functions

 src/libtracker-common/tracker-language.c |  131 ------------------------------
 src/libtracker-common/tracker-language.h |    5 -
 2 files changed, 0 insertions(+), 136 deletions(-)
---
diff --git a/src/libtracker-common/tracker-language.c b/src/libtracker-common/tracker-language.c
index da20a9b..c61da22 100644
--- a/src/libtracker-common/tracker-language.c
+++ b/src/libtracker-common/tracker-language.c
@@ -496,97 +496,6 @@ tracker_language_stem_word (TrackerLanguage *language,
 }
 
 /**
- * tracker_language_check_exists:
- * @language_code: language code in ISO 639-1 format
- *
- * Checks whether the language is supported by #TrackerLanguage
- *
- * Returns: %TRUE if the language is supported.
- **/
-gboolean
-tracker_language_check_exists (const gchar *language_code)
-{
-	gint i;
-
-	if (!language_code || language_code[0] == '\0') {
-		return FALSE;
-	}
-
-	for (i = 0; all_langs[i].code; i++) {
-		if (g_str_has_prefix (language_code, all_langs[i].code)) {
-			return TRUE;
-		}
-	}
-
-	return FALSE;
-}
-
-/**
- * tracker_language_get_default_code:
- *
- * Returns the ISO 639-1 language code for the current locale settings.
- * As a fallback it will return the english language code.
- *
- * Returns: ISO 639-1 language code for the default settings. This
- *          string must be freed with g_free().
- **/
-gchar *
-tracker_language_get_default_code (void)
-{
-	const gchar **local_languages;
-	const gchar **p;
-
-	/* Get languages for user's locale */
-	local_languages = (const gchar**) g_get_language_names ();
-
-	for (p = local_languages; *p; p++) {
-		const gchar *code;
-		gint         i = 0;
-
-		if (!*p || *p[0] == '\0') {
-			continue;
-		}
-
-		code = all_langs[i].code;
-
-		while (code) {
-			if (g_str_has_prefix (*p, code)) {
-				return g_strndup (*p, strlen (code));
-			}
-
-			code = all_langs[i++].code;
-		}
-	}
-
-	return g_strdup ("en");
-}
-
-/**
- * tracker_language_get_all_by_code:
- *
- * Returns all supported languages by #TrackerLanguage
- *
- * Returns: a list of ISO 639-1 language codes. This list must be
- *          freed through g_list_free().
- **/
-GSList *
-tracker_language_get_all_by_code (void)
-{
-	GSList *list = NULL;
-	gint i;
-
-	/* Shouldn't we use g_get_language_names() instead? -mr */
-
-	for (i = 0; all_langs[i].code; i++) {
-		list = g_slist_prepend (list, (gchar *)all_langs[i].code);
-	}
-
-	list = g_slist_reverse (list);
-
-	return list;
-}
-
-/**
  * tracker_language_get_name_by_code:
  * @language_code: a ISO 639-1 language code.
  *
@@ -613,43 +522,3 @@ tracker_language_get_name_by_code (const gchar *language_code)
 	return "";
 }
 
-/**
- * tracker_language_get_code_by_name:
- * @language_name: a string representing the language name
- *
- * Supported @language_name strings and their ISO 639-1 codes include:
- *
- *  - "Danish" (da)
- *  - "Dutch"  (nl)
- *  - "English" (en)
- *  - "Finnish" (fi)
- *  - "French" (fr)
- *  - "German" (de)
- *  - "Hungarian" (hu)
- *  - "Italian" (it)
- *  - "Norwegian" (nb)
- *  - "Portuguese" (pt)
- *  - "Russian" (ru)
- *  - "Spanish" (es)
- *  - "Swedish" (sv)
- *
- * Returns: the ISO 639-1 code corresponding to the @language_name,
- *          if it is supported.
- **/
-const gchar *
-tracker_language_get_code_by_name (const gchar *language_name)
-{
-	gint i;
-
-	if (!language_name || language_name[0] == '\0') {
-		return "en";
-	}
-
-	for (i = 0; all_langs[i].name; i++) {
-		if (g_str_has_prefix (language_name, all_langs[i].name)) {
-			return all_langs[i].code;
-		}
-	}
-
-	return "";
-}
diff --git a/src/libtracker-common/tracker-language.h b/src/libtracker-common/tracker-language.h
index 0918042..1e033e2 100644
--- a/src/libtracker-common/tracker-language.h
+++ b/src/libtracker-common/tracker-language.h
@@ -64,12 +64,7 @@ gchar *          tracker_language_stem_word          (TrackerLanguage *language,
                                                       gint             word_length);
 
 /* Utility functions */
-gboolean         tracker_language_check_exists       (const gchar     *language_code);
-gchar *          tracker_language_get_default_code   (void);
-GSList *         tracker_language_get_all_by_code    (void);
 const gchar *    tracker_language_get_name_by_code   (const gchar     *language_code);
-const gchar *    tracker_language_get_code_by_name   (const gchar     *language_name);
-
 G_END_DECLS
 
 #endif /* __LIBTRACKER_COMMON_LANGUAGE_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]