1999-03-19 Paul Raines <raines@slac.stanford.edu>
* gtkdtree.c (gtk_dtree_load_path): Uses a phantom node to get directories with the expandable flag. Avoids loading directories at two levels.
Этот коммит содержится в:
родитель
d45dc1f253
Коммит
ba56e04c4c
@ -1,3 +1,9 @@
|
|||||||
|
1999-03-19 Paul Raines <raines@slac.stanford.edu>
|
||||||
|
|
||||||
|
* gtkdtree.c (gtk_dtree_load_path): Uses a phantom node to get
|
||||||
|
directories with the expandable flag. Avoids loading directories
|
||||||
|
at two levels.
|
||||||
|
|
||||||
1999-03-18 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
1999-03-18 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
* gdesktop.c (desktop_icon_info_open): Fix condition. Should not
|
* gdesktop.c (desktop_icon_info_open): Fix condition. Should not
|
||||||
|
@ -120,14 +120,34 @@ gtk_dtree_insert_node (GtkDTree *dtree, GtkCTreeNode *parent, char *text)
|
|||||||
static gboolean
|
static gboolean
|
||||||
gtk_dtree_load_path (GtkDTree *dtree, char *path, GtkCTreeNode *parent, int level)
|
gtk_dtree_load_path (GtkDTree *dtree, char *path, GtkCTreeNode *parent, int level)
|
||||||
{
|
{
|
||||||
|
GtkCTreeNode *phantom;
|
||||||
tree_scan *dir;
|
tree_scan *dir;
|
||||||
tree_entry *dirent;
|
tree_entry *dirent;
|
||||||
|
struct stat dir_stat;
|
||||||
|
|
||||||
g_assert (path);
|
g_assert (path);
|
||||||
g_assert (parent);
|
g_assert (parent);
|
||||||
g_assert (dtree);
|
g_assert (dtree);
|
||||||
|
|
||||||
|
if (mc_stat (path, &dir_stat)){
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (!S_ISDIR(dir_stat.st_mode))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
dtree->loading_dir++;
|
dtree->loading_dir++;
|
||||||
|
|
||||||
|
|
||||||
|
phantom = gtk_dtree_contains (dtree, parent, "PHANTOM");
|
||||||
|
if (!level) {
|
||||||
|
dirent = tree_store_whereis (path);
|
||||||
|
if (!phantom && (!dirent || (dirent && !dirent->scanned)))
|
||||||
|
if (dir_stat.st_nlink > 2 || strncmp(path,"/afs",4)==0)
|
||||||
|
gtk_dtree_insert_node (dtree, parent, "PHANTOM");
|
||||||
|
dtree->loading_dir--;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
dir = tree_store_opendir (path);
|
dir = tree_store_opendir (path);
|
||||||
if (!dir){
|
if (!dir){
|
||||||
dtree->loading_dir--;
|
dtree->loading_dir--;
|
||||||
@ -155,6 +175,11 @@ gtk_dtree_load_path (GtkDTree *dtree, char *path, GtkCTreeNode *parent, int leve
|
|||||||
|
|
||||||
tree_store_closedir (dir);
|
tree_store_closedir (dir);
|
||||||
dtree->loading_dir--;
|
dtree->loading_dir--;
|
||||||
|
if (phantom != NULL && level) {
|
||||||
|
dtree->removing_rows = 1;
|
||||||
|
gtk_ctree_remove_node (GTK_CTREE (dtree), phantom);
|
||||||
|
dtree->removing_rows = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user