[Xfce4-commits] r17467 - xfce-mcs-plugins/trunk/plugins/shortcuts_plugin

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Thu Sep 8 13:40:22 CEST 2005


Wauthy Jean-François wrote:
> +  /* check if ~/.config/xfce4/shortcuts/ exists; if not it creates it */
> +  shortcuts_path = g_build_path (G_DIR_SEPARATOR_S, xfce_get_homedir (), ".config/xfce4/shortcuts/", NULL);
> +  if (!xfce_mkdirhier (shortcuts_path, 0755, &error)) {
> +    g_warning ("an error occurred while creating shortcuts dir : %s", error->message);
> +    g_error_free (error);
> +  }
> +  g_free (shortcuts_path);

This one won't work for people that don't have XDG_CONFIG_HOME set to
"$HOME/.config". Why not simply use xfce_resource_save_location() [1],
which automatically creates the directory for you? E.g.

xfce_resource_save_location (XFCE_RESOURCE_CONFIG,
                             "xfce4/shortcuts/",
                             TRUE);

Benedikt

[1]
http://xfce.org/documentation/api-4.2/libxfce4util/libxfce4util-Resource-lookup-functions.html#xfce-resource-save-location




More information about the Xfce4-dev mailing list