summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdefault.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2012-12-10 14:45:18 -0600
committerFederico Mena Quintero <federico@gnome.org>2012-12-10 14:45:18 -0600
commit8b0aea9f3d5e85b683a908695d04fe13e1d16e7e (patch)
tree9cab05e612314cb0d1da2ab36f47d1c8367d1495 /gtk/gtkfilechooserdefault.c
parente6ba6e7e06360ab2b02c54950c269d32ad5c6c3a (diff)
downloadgtk+-8b0aea9f3d5e85b683a908695d04fe13e1d16e7e.tar.gz
Implement the Desktop keyboard shortcut
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
Diffstat (limited to 'gtk/gtkfilechooserdefault.c')
-rw-r--r--gtk/gtkfilechooserdefault.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index da6a5f0706..cd86086e2d 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -7514,10 +7514,17 @@ home_folder_handler (GtkFileChooserDefault *impl)
static void
desktop_folder_handler (GtkFileChooserDefault *impl)
{
-#if REMOVE_FOR_PLACES_SIDEBAR
- if (impl->has_desktop)
- switch_to_shortcut (impl, shortcuts_get_index (impl, SHORTCUTS_DESKTOP));
-#endif
+ const char *name;
+
+ name = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP);
+ /* "To disable a directory, point it to the homedir."
+ * See http://freedesktop.org/wiki/Software/xdg-user-dirs
+ **/
+ if (!g_strcmp0 (name, g_get_home_dir ())) {
+ return;
+ }
+
+ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (impl), name);
}
/* Handler for the "search-shortcut" keybinding signal */