~ubuntu-branches/ubuntu/utopic/gnome-settings-daemon/utopic

« back to all changes in this revision

Viewing changes to plugins/sound/gsd-sound-manager.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Martin Pitt, Sebastien Bacher
  • Date: 2013-05-13 15:28:42 UTC
  • Revision ID: package-import@ubuntu.com-20130513152842-o8birmss2qigkbqn
Tags: 3.6.4-0ubuntu10
[ Martin Pitt ]
* Drop 51_lock_screen_on_suspend.patch: Superseded by handling this key in
  gnome-screensaver. With that, g-screensaver mirrors what's being done in
  g-shell, and avoids patching settings-daemon.

[ Sebastien Bacher ]
* debian/patches/git_housekeeping_ignore_list.patch:
  - correctly handle ignore list for disk space notifications (lp: #881376)
* debian/patches/git_glib_get_xdg_dirs.patch:
  - use glib to get xdg dirs (rather than reading the environment)
* debian/patches/git_sound_not_polling.patch:
  - don't poll on non existant directories

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
gsd_sound_manager_start (GsdSoundManager *manager,
256
256
                         GError **error)
257
257
{
258
 
        char *p, **ps, **k;
259
 
        const char *env, *dd;
 
258
        guint i;
 
259
        const gchar * const * dirs;
 
260
        char *p;
260
261
 
261
262
        g_debug ("Starting sound manager");
262
263
        gnome_settings_profile_start (NULL);
266
267
 
267
268
        /* ... and we listen to changes of the theme base directories
268
269
         * in $HOME ...*/
269
 
 
270
 
        if ((env = g_getenv ("XDG_DATA_HOME")) && *env == '/')
271
 
                p = g_build_filename (env, "sounds", NULL);
272
 
        else if (((env = g_getenv ("HOME")) && *env == '/') || (env = g_get_home_dir ()))
273
 
                p = g_build_filename (env, ".local", "share", "sounds", NULL);
274
 
        else
275
 
                p = NULL;
276
 
 
277
 
        if (p) {
 
270
        p = g_build_filename (g_get_user_data_dir (), "sounds", NULL);
 
271
        if (g_mkdir_with_parents(p, 0600) == 0)
278
272
                register_directory_callback (manager, p, NULL);
 
273
        g_free (p);
 
274
 
 
275
        /* ... and globally. */
 
276
        dirs = g_get_system_data_dirs ();
 
277
        for (i = 0; dirs[i] != NULL; i++) {
 
278
                p = g_build_filename (dirs[i], "sounds", NULL);
 
279
                if (g_file_test (p, G_FILE_TEST_IS_DIR))
 
280
                        register_directory_callback (manager, p, NULL);
279
281
                g_free (p);
280
282
        }
281
283
 
282
 
        /* ... and globally. */
283
 
        if (!(dd = g_getenv ("XDG_DATA_DIRS")) || *dd == 0)
284
 
                dd = "/usr/local/share:/usr/share";
285
 
 
286
 
        ps = g_strsplit (dd, ":", 0);
287
 
 
288
 
        for (k = ps; *k; ++k)
289
 
                register_directory_callback (manager, *k, NULL);
290
 
 
291
 
        g_strfreev (ps);
292
 
 
293
284
        gnome_settings_profile_end (NULL);
294
285
 
295
286
        return TRUE;