FileData *fd;
SortType sort_type = SORT_NAME;
gboolean sort_ascend = TRUE;
+ gchar *link = NULL;
+
+ if (vd->layout)
+ {
+ sort_type = vd->layout->options.dir_view_list_sort.method;
+ sort_ascend = vd->layout->options.dir_view_list_sort.ascend;
+ }
old_list = VDLIST(vd)->list;
if (access_file(fd->path, R_OK | X_OK) && fd->name)
{
- if (fd->name[0] == '.' && fd->name[1] == '\0')
+ if (islink(fd->path))
+ {
+ pixbuf = vd->pf->link;
+ }
+ else if (fd->name[0] == '.' && fd->name[1] == '\0')
{
pixbuf = vd->pf->open;
}
match = -1;
}
+ if (islink(fd->path))
+ {
+ link = realpath(fd->path, NULL);
+ }
+ else
+ {
+ link = NULL;
+ }
+
if (match < 0)
{
GtkTreeIter new;
DIR_COLUMN_POINTER, fd,
DIR_COLUMN_ICON, pixbuf,
DIR_COLUMN_NAME, fd->name,
+ DIR_COLUMN_LINK, link,
DIR_COLUMN_DATE, date,
-1);
gtk_list_store_set(store, &iter,
DIR_COLUMN_ICON, pixbuf,
DIR_COLUMN_NAME, fd->name,
+ DIR_COLUMN_LINK, link,
DIR_COLUMN_DATE, date,
-1);
vd->drop_fd = NULL;
filelist_free(old_list);
+ g_free(link);
return ret;
}
ret = vdlist_populate(vd, TRUE);
- if (old_path)
- {
- /* scroll to make last path visible */
- FileData *found = NULL;
- GList *work;
-
- work = VDLIST(vd)->list;
- while (work && !found)
- {
- FileData *fd = work->data;
- if (strcmp(old_path, fd->name) == 0) found = fd;
- work = work->next;
- }
-
- if (found) vdlist_scroll_to_row(vd, found, 0.5);
-
- g_free(old_path);
- return ret;
- }
+ /* scroll to make last path visible */
+ FileData *found = NULL;
+ GList *work;
- if (gtk_widget_get_realized(vd->view))
+ work = VDLIST(vd)->list;
+ while (work && !found)
{
- gtk_tree_view_scroll_to_point(GTK_TREE_VIEW(vd->view), 0, 0);
+ FileData *fd = work->data;
+ if (!old_path || strcmp(old_path, fd->name) == 0) found = fd;
+ work = work->next;
}
+ if (found) vdlist_scroll_to_row(vd, found, 0.5);
+
+ if (old_path) g_free(old_path);
+
return ret;
}
vd->type = DIRVIEW_LIST;
- store = gtk_list_store_new(5, G_TYPE_POINTER, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING);
+ store = gtk_list_store_new(6, G_TYPE_POINTER, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING);
vd->view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
g_object_unref(store);
gtk_tree_view_append_column(GTK_TREE_VIEW(vd->view), column);
+ gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(vd->view), DIR_COLUMN_LINK);
+
return vd;
}
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */