~peter-pearse/ubuntu/oneiric/upower/prop001

« back to all changes in this revision

Viewing changes to src/up-config.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-05 14:31:17 UTC
  • mfrom: (15.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20110505143117-9clyzsrw45vt5g6y
Tags: 0.9.10-1
* New upstream release:
  - Fix "unknown" battery status guessing to not be recursive. (LP: #384304)
* debian/control: Drop obsolete devicekit-power-* Conflicts/Replaces.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
{
74
74
        gboolean ret;
75
75
        GError *error = NULL;
 
76
        gchar *filename;
76
77
 
77
78
        config->priv = UP_CONFIG_GET_PRIVATE (config);
78
79
        config->priv->keyfile = g_key_file_new ();
79
80
 
 
81
        filename = g_strdup (g_getenv ("UPOWER_CONF_FILE_NAME"));
 
82
        if (filename == NULL)
 
83
                filename = g_build_filename (PACKAGE_SYSCONF_DIR,"UPower", "UPower.conf", NULL);
 
84
 
80
85
        /* load */
81
86
        ret = g_key_file_load_from_file (config->priv->keyfile,
82
 
                                         PACKAGE_SYSCONF_DIR "/UPower/UPower.conf",
 
87
                                         filename,
83
88
                                         G_KEY_FILE_NONE,
84
89
                                         &error);
 
90
 
 
91
        g_free (filename);
 
92
 
85
93
        if (!ret) {
86
94
                g_warning ("failed to load config file: %s",
87
95
                           error->message);