projects
/
geeqie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
559683d
)
do not use FileData entries with empty path
author
Vladimir Nadvornik
<nadvornik@suse.cz>
Fri, 30 Sep 2011 08:54:32 +0000
(10:54 +0200)
committer
Vladimir Nadvornik
<nadvornik@suse.cz>
Fri, 30 Sep 2011 08:54:32 +0000
(10:54 +0200)
src/view_dir_tree.c
patch
|
blob
|
history
diff --git
a/src/view_dir_tree.c
b/src/view_dir_tree.c
index
2477724
..
4d3f7f0
100644
(file)
--- a/
src/view_dir_tree.c
+++ b/
src/view_dir_tree.c
@@
-159,7
+159,7
@@
static void vdtree_node_free(NodeData *nd)
{
if (!nd) return;
{
if (!nd) return;
- file_data_unref(nd->fd);
+
if (nd->fd)
file_data_unref(nd->fd);
g_free(nd);
}
g_free(nd);
}
@@
-281,7
+281,7
@@
static GList *parts_list_add_node_points(ViewDir *vd, GList *list)
NodeData *nd;
gtk_tree_model_get(store, &iter, DIR_COLUMN_POINTER, &nd, -1);
NodeData *nd;
gtk_tree_model_get(store, &iter, DIR_COLUMN_POINTER, &nd, -1);
- if (strcmp(nd->fd->name, pd->name) == 0)
+ if (
nd->fd &&
strcmp(nd->fd->name, pd->name) == 0)
{
fd = nd->fd;
}
{
fd = nd->fd;
}
@@
-419,7
+419,7
@@
static void vdtree_add_by_data(ViewDir *vd, FileData *fd, GtkTreeIter *parent)
/* all nodes are created with an "empty" node, so that the expander is shown
* this is removed when the child is populated */
end = g_new0(NodeData, 1);
/* all nodes are created with an "empty" node, so that the expander is shown
* this is removed when the child is populated */
end = g_new0(NodeData, 1);
- end->fd =
file_data_new_simple("")
;
+ end->fd =
NULL
;
end->expanded = TRUE;
gtk_tree_store_append(store, &empty, &child);
end->expanded = TRUE;
gtk_tree_store_append(store, &empty, &child);
@@
-462,7
+462,7
@@
gboolean vdtree_populate_path_by_iter(ViewDir *vd, GtkTreeIter *iter, gboolean f
if (nd->expanded)
{
if (nd->expanded)
{
- if (!isdir(nd->fd->path))
+ if (!
nd->fd || !
isdir(nd->fd->path))
{
if (vd->click_fd == nd->fd) vd->click_fd = NULL;
if (vd->drop_fd == nd->fd) vd->drop_fd = NULL;
{
if (vd->click_fd == nd->fd) vd->click_fd = NULL;
if (vd->drop_fd == nd->fd) vd->drop_fd = NULL;
@@
-904,6
+904,10
@@
static gint vdtree_sort_cb(GtkTreeModel *store, GtkTreeIter *a, GtkTreeIter *b,
gtk_tree_model_get(store, a, DIR_COLUMN_POINTER, &nda, -1);
gtk_tree_model_get(store, b, DIR_COLUMN_POINTER, &ndb, -1);
gtk_tree_model_get(store, a, DIR_COLUMN_POINTER, &nda, -1);
gtk_tree_model_get(store, b, DIR_COLUMN_POINTER, &ndb, -1);
+ if (!nda->fd && !ndb->fd) return 0;
+ if (!nda->fd) return 1;
+ if (!ndb->fd) return -1;
+
if (options->file_sort.case_sensitive)
return strcmp(nda->fd->collate_key_name, ndb->fd->collate_key_name);
else
if (options->file_sort.case_sensitive)
return strcmp(nda->fd->collate_key_name, ndb->fd->collate_key_name);
else