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;
}