[Xfce4-commits] r30044 - in thunar/branches/migration-to-gio: . thunar
Jannis Pohlmann
jannis at xfce.org
Wed Jun 17 19:57:47 CEST 2009
Author: jannis
Date: 2009-06-17 17:57:46 +0000 (Wed, 17 Jun 2009)
New Revision: 30044
Modified:
thunar/branches/migration-to-gio/ChangeLog
thunar/branches/migration-to-gio/thunar/thunar-shortcuts-model.c
Log:
* thunar/thunar-shortcuts-model.c: Minor code reorganization.
Modified: thunar/branches/migration-to-gio/ChangeLog
===================================================================
--- thunar/branches/migration-to-gio/ChangeLog 2009-06-17 17:57:41 UTC (rev 30043)
+++ thunar/branches/migration-to-gio/ChangeLog 2009-06-17 17:57:46 UTC (rev 30044)
@@ -1,5 +1,9 @@
2009-06-17 Jannis Pohlmann <jannis at xfce.org>
+ * thunar/thunar-shortcuts-model.c: Minor code reorganization.
+
+2009-06-17 Jannis Pohlmann <jannis at xfce.org>
+
* thunar/thunar-window.c: Split thunar_window_start_open_location()
up into three functions and load unmounted files asynchronously.
Modified: thunar/branches/migration-to-gio/thunar/thunar-shortcuts-model.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-shortcuts-model.c 2009-06-17 17:57:41 UTC (rev 30043)
+++ thunar/branches/migration-to-gio/thunar/thunar-shortcuts-model.c 2009-06-17 17:57:46 UTC (rev 30044)
@@ -882,21 +882,22 @@
continue;
/* make sure the file refers to a directory */
- if (G_UNLIKELY (!thunar_file_is_directory (file)))
+ if (G_UNLIKELY (thunar_file_is_directory (file)))
{
- g_object_unref (G_OBJECT (file));
- continue;
+ /* create the shortcut entry */
+ shortcut = _thunar_slice_new0 (ThunarShortcut);
+ shortcut->type = THUNAR_SHORTCUT_USER_DEFINED;
+ shortcut->file = file;
+ shortcut->name = (*name != '\0') ? g_strdup (name) : NULL;
+
+ /* append the shortcut to the list */
+ thunar_shortcuts_model_add_shortcut (model, shortcut, path);
+ gtk_tree_path_next (path);
}
-
- /* create the shortcut entry */
- shortcut = _thunar_slice_new0 (ThunarShortcut);
- shortcut->type = THUNAR_SHORTCUT_USER_DEFINED;
- shortcut->file = file;
- shortcut->name = (*name != '\0') ? g_strdup (name) : NULL;
-
- /* append the shortcut to the list */
- thunar_shortcuts_model_add_shortcut (model, shortcut, path);
- gtk_tree_path_next (path);
+ else
+ {
+ g_object_unref (file);
+ }
}
/* clean up */
@@ -1113,10 +1114,10 @@
_thunar_return_if_fail (THUNAR_IS_FILE (file));
_thunar_return_if_fail (THUNAR_IS_SHORTCUTS_MODEL (model));
- /* check if the file still refers to a directory, else we cannot keep
- * it on the shortcuts list, and so we'll treat it like the file
- * was destroyed (and thereby removed)
- */
+ /* check if the file still refers to a directory or a not mounted URI,
+ * otherwise we cannot keep it on the shortcuts list, and so we'll treat
+ * it like the file was destroyed (and thereby removed) */
+
if (G_UNLIKELY (!thunar_file_is_directory (file)))
{
thunar_shortcuts_model_file_destroy (file, model);
More information about the Xfce4-commits
mailing list