[gdm] Return gboolean from gdm_parse_language_name()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] Return gboolean from gdm_parse_language_name()
- Date: Fri, 21 Jan 2011 13:50:42 +0000 (UTC)
commit 8bb22b742366f294015a9fce44ab86c8366c8d5b
Author: Bastien Nocera <hadess hadess net>
Date: Fri Jan 21 13:48:59 2011 +0000
Return gboolean from gdm_parse_language_name()
If the parsing succeeded, as used by the user accounts panel
in gnome-control-center.
gui/simple-greeter/gdm-languages.c | 8 +++++++-
gui/simple-greeter/gdm-languages.h | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-languages.c b/gui/simple-greeter/gdm-languages.c
index aae345a..a7fa2ae 100644
--- a/gui/simple-greeter/gdm-languages.c
+++ b/gui/simple-greeter/gdm-languages.c
@@ -115,7 +115,7 @@ normalize_codeset (const char *codeset)
* locale names are of the form:
* [language[_territory][ codeset][ modifier]]
*/
-void
+gboolean
gdm_parse_language_name (const char *name,
char **language_codep,
char **territory_codep,
@@ -128,8 +128,10 @@ gdm_parse_language_name (const char *name,
GError *error;
gchar *normalized_codeset = NULL;
gchar *normalized_name = NULL;
+ gboolean retval;
match_info = NULL;
+ retval = FALSE;
error = NULL;
re = g_regex_new ("^(?P<language>[^_ [:space:]]+)"
@@ -154,6 +156,8 @@ gdm_parse_language_name (const char *name,
goto out;
}
+ retval = TRUE;
+
if (language_codep != NULL) {
*language_codep = g_match_info_fetch_named (match_info, "language");
}
@@ -207,6 +211,8 @@ gdm_parse_language_name (const char *name,
out:
g_match_info_free (match_info);
g_regex_unref (re);
+
+ return retval;
}
static char *
diff --git a/gui/simple-greeter/gdm-languages.h b/gui/simple-greeter/gdm-languages.h
index ab71662..5b4560f 100644
--- a/gui/simple-greeter/gdm-languages.h
+++ b/gui/simple-greeter/gdm-languages.h
@@ -29,7 +29,7 @@ G_BEGIN_DECLS
char * gdm_get_language_from_name (const char *name,
const char *locale);
char ** gdm_get_all_language_names (void);
-void gdm_parse_language_name (const char *name,
+gboolean gdm_parse_language_name (const char *name,
char **language_codep,
char **territory_codep,
char **codesetp,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]