~ubuntu-branches/ubuntu/lucid/lxdm/lucid

« back to all changes in this revision

Viewing changes to src/lang.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-01-31 23:35:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100131233502-nzdhokfq6lbicgfr
Tags: 0.2.0~svn2307+git20100209-0ubuntu1
* New upstream snapshot, from git (40c1561c8d).
* debian/rules
 - Pass config file with CFLAGS to /etc/lxdm/default.list. This location will
   be updated by update-alternative to handle multiple configuration files.
 - Pass --libexecdir=/usr/lib/lxdm configure flag.
* debian/patches/
 - 14-lubuntu-config-file.patch: Removed, handle by update-alternative.
 - 13-plymouth-support.patch: Removed, merged upstream.
 - 12-replace-libexec.patch: removed, handle by --libexecdir=/usr/lib/lxdm
* debian/control
 - Add depends on librsvg2-common, the theme use SVG image.
* debian/lxdm.postinst & debian/prerm
 - Use update-alternate to configure default configuration file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
#include "gdm/gdm-languages.h"
37
37
 
38
 
int lxdm_load_langs(void *arg, void (*cb)(void *arg, char *lang, char *desc), const char* last_lang)
 
38
void lxdm_load_langs(void *arg, void (*cb)(void *arg, char *lang, char *desc))
39
39
{
40
 
    int ret = -1;
41
40
    char **langs, **lang;
42
 
    char* normal_last_lang;
43
41
 
44
42
    //cb(arg,"C","Default");
45
43
    cb(arg, "", "Default"); /* default is to use the system wide settings ,not use the "C" */
46
 
    normal_last_lang = last_lang ? gdm_normalize_language_name(last_lang) : NULL;
47
 
 
48
 
    if( !normal_last_lang || !normal_last_lang[0] )
49
 
        ret = 0;
50
44
 
51
45
    /* come up with available languages with gdm-languages */
52
46
    langs = gdm_get_all_language_names();
55
49
        char* normal = gdm_normalize_language_name(*lang);
56
50
        char* readable = gdm_get_language_from_name(normal, normal);
57
51
        cb(arg, normal, readable);
58
 
        if( ret < 0 && g_strcmp0(normal_last_lang, normal) == 0 )
59
 
            ret = (lang - langs) + 1;
60
52
        g_free(readable);
61
53
        g_free(normal);
62
54
    }
63
 
    g_free(normal_last_lang);
64
 
    return ret;
65
55
}