1999-02-06 Federico Mena Quintero <federico@nuclecu.unam.mx>
* treestore.h: Replaced TreeStore.check_name_list by a GSList, for minimal memory savings. * treestore.c (tree_store_remove_entry): Removed unused code for base_sublevel computation. 1999-02-06 Federico Mena Quintero <federico@nuclecu.unam.mx> * gtkdtree.c (gtk_dtree_insert_node): This function was never returning the newly-created sibling.
Этот коммит содержится в:
родитель
36a7fa63d7
Коммит
0108bdba8f
@ -1,3 +1,8 @@
|
||||
1999-02-06 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gtkdtree.c (gtk_dtree_insert_node): This function was never
|
||||
returning the newly-created sibling.
|
||||
|
||||
Sun Feb 7 05:29:17 1999 Timur Bakeyev <mc@bat.ru>
|
||||
|
||||
* Makefile.in: Remove references and dependences to/from libslang -
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <unistd.h>
|
||||
#include "dir-open.xpm"
|
||||
#include "dir-close.xpm"
|
||||
#include "main.h"
|
||||
#include "treestore.h"
|
||||
#include "gtkdtree.h"
|
||||
|
||||
@ -101,19 +102,17 @@ gtk_dtree_contains (GtkDTree *dtree, GtkCTreeNode *parent, char *text)
|
||||
static GtkCTreeNode *
|
||||
gtk_dtree_insert_node (GtkDTree *dtree, GtkCTreeNode *parent, char *text)
|
||||
{
|
||||
GtkCTreeNode *sibling;
|
||||
char *texts [1];
|
||||
|
||||
texts [0] = text;
|
||||
|
||||
sibling = gtk_ctree_insert_node (
|
||||
GTK_CTREE (dtree), parent, NULL,
|
||||
texts, TREE_SPACING,
|
||||
dtree->pixmap_close,
|
||||
dtree->bitmap_close,
|
||||
dtree->pixmap_open,
|
||||
dtree->bitmap_open,
|
||||
FALSE, FALSE);
|
||||
return gtk_ctree_insert_node (GTK_CTREE (dtree), parent, NULL,
|
||||
texts, TREE_SPACING,
|
||||
dtree->pixmap_close,
|
||||
dtree->bitmap_close,
|
||||
dtree->pixmap_open,
|
||||
dtree->bitmap_open,
|
||||
FALSE, FALSE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -1,3 +1,11 @@
|
||||
1999-02-06 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* treestore.h: Replaced TreeStore.check_name_list by a GSList, for
|
||||
minimal memory savings.
|
||||
|
||||
* treestore.c (tree_store_remove_entry): Removed unused code for
|
||||
base_sublevel computation.
|
||||
|
||||
Sun Feb 7 06:11:48 1999 Timur Bakeyev <mc@bat.ru>
|
||||
|
||||
* Makefile.in: Change calls to xmkdir to mkinstalldirs - this is more
|
||||
|
@ -129,12 +129,12 @@ tree_store_whereis (char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
TreeStore *
|
||||
tree_store_init (void)
|
||||
{
|
||||
ts.tree_first = 0;
|
||||
ts.tree_last = 0;
|
||||
ts.check_name_stack = 0;
|
||||
ts.refcount++;
|
||||
|
||||
return &ts;
|
||||
@ -484,6 +484,7 @@ remove_entry (tree_entry *entry)
|
||||
entry->prev->next = entry->next;
|
||||
else
|
||||
ts.tree_first = entry->next;
|
||||
|
||||
if (entry->next)
|
||||
entry->next->prev = entry->prev;
|
||||
else
|
||||
@ -500,11 +501,11 @@ void
|
||||
tree_store_remove_entry (char *name)
|
||||
{
|
||||
tree_entry *current, *base, *old;
|
||||
int len, base_sublevel;
|
||||
int len;
|
||||
char *check_name;
|
||||
|
||||
g_return_if_fail (name != NULL);
|
||||
g_return_if_fail (ts.check_name_list != NULL);
|
||||
g_return_if_fail (ts.check_name_stack != NULL);
|
||||
|
||||
/* Miguel Ugly hack */
|
||||
if (name [0] == PATH_SEP && name [1] == 0)
|
||||
@ -515,17 +516,13 @@ tree_store_remove_entry (char *name)
|
||||
if (!base)
|
||||
return; /* Doesn't exist */
|
||||
|
||||
check_name = ts.check_name_list->data;
|
||||
check_name = ts.check_name_stack->data;
|
||||
|
||||
if (check_name [0] == PATH_SEP && check_name [1] == 0)
|
||||
base_sublevel = base->sublevel;
|
||||
else
|
||||
base_sublevel = base->sublevel + 1;
|
||||
len = strlen (base->name);
|
||||
current = base->next;
|
||||
while (current
|
||||
&& strncmp (current->name, base->name, len) == 0
|
||||
&& (current->name[len] == '\0' || current->name[len] == PATH_SEP)){
|
||||
&& (current->name[len] == '\0' || current->name[len] == PATH_SEP)) {
|
||||
old = current;
|
||||
current = current->next;
|
||||
remove_entry (old);
|
||||
@ -548,10 +545,9 @@ tree_store_mark_checked (const char *subname)
|
||||
if (!ts.loaded)
|
||||
return;
|
||||
|
||||
if (ts.check_name_list == NULL)
|
||||
return;
|
||||
g_return_if_fail (ts.check_name_stack != NULL);
|
||||
|
||||
check_name = ts.check_name_list->data;
|
||||
check_name = ts.check_name_stack->data;
|
||||
|
||||
/* Calculate the full name of the subdirectory */
|
||||
if (subname [0] == '.' &&
|
||||
@ -614,18 +610,18 @@ tree_store_start_check (char *path)
|
||||
return NULL;
|
||||
|
||||
current = tree_store_add_entry (path);
|
||||
ts.check_name_list = g_list_prepend (ts.check_name_list, g_strdup (path));
|
||||
ts.check_name_stack = g_slist_prepend (ts.check_name_stack, g_strdup (path));
|
||||
|
||||
return current;
|
||||
}
|
||||
|
||||
ts.check_name_list = g_list_prepend (ts.check_name_list, g_strdup (path));
|
||||
ts.check_name_stack = g_slist_prepend (ts.check_name_stack, g_strdup (path));
|
||||
|
||||
retval = current;
|
||||
|
||||
/* Mark old subdirectories for delete */
|
||||
ts.check_start = current->next;
|
||||
check_name = ts.check_name_list->data;
|
||||
check_name = ts.check_name_stack->data;
|
||||
len = strlen (check_name);
|
||||
|
||||
current = ts.check_start;
|
||||
@ -655,15 +651,15 @@ tree_store_end_check (void)
|
||||
tree_entry *current, *old;
|
||||
int len;
|
||||
char *check_name;
|
||||
GList *list_head;
|
||||
GSList *stack_head;
|
||||
|
||||
if (!ts.loaded)
|
||||
return;
|
||||
|
||||
g_return_if_fail (ts.check_name_list);
|
||||
g_return_if_fail (ts.check_name_stack != NULL);
|
||||
|
||||
/* Check delete marks and delete if found */
|
||||
check_name = ts.check_name_list->data;
|
||||
check_name = ts.check_name_stack->data;
|
||||
len = strlen (check_name);
|
||||
|
||||
current = ts.check_start;
|
||||
@ -676,10 +672,10 @@ tree_store_end_check (void)
|
||||
remove_entry (old);
|
||||
}
|
||||
|
||||
g_free (ts.check_name_list->data);
|
||||
list_head = ts.check_name_list;
|
||||
ts.check_name_list = list_head->next;
|
||||
g_list_free_1 (list_head);
|
||||
g_free (ts.check_name_stack->data);
|
||||
stack_head = ts.check_name_stack;
|
||||
ts.check_name_stack = g_slist_remove_link (ts.check_name_stack, stack_head);
|
||||
g_slist_free_1 (stack_head);
|
||||
}
|
||||
|
||||
tree_entry *
|
||||
@ -766,8 +762,7 @@ tree_store_notify_add (tree_entry *entry)
|
||||
Hook *p = add_entry_hooks;
|
||||
tree_store_add_fn r;
|
||||
|
||||
|
||||
while (p){
|
||||
while (p) {
|
||||
r = (tree_store_add_fn) p->hook_fn;
|
||||
r (entry, p->hook_data);
|
||||
p = p->next;
|
||||
@ -781,7 +776,7 @@ tree_store_opendir (char *path)
|
||||
tree_scan *scan;
|
||||
|
||||
entry = tree_store_whereis (path);
|
||||
if (!entry || (entry && !entry->scanned)){
|
||||
if (!entry || (entry && !entry->scanned)) {
|
||||
entry = tree_store_rescan (path);
|
||||
|
||||
if (!entry)
|
||||
|
@ -24,7 +24,7 @@ typedef struct {
|
||||
tree_entry *tree_first; /* First entry in the list */
|
||||
tree_entry *tree_last; /* Last entry in the list */
|
||||
tree_entry *check_start; /* Start of checked subdirectories */
|
||||
GList *check_name_list;
|
||||
GSList *check_name_stack;
|
||||
unsigned int loaded : 1;
|
||||
unsigned int dirty : 1;
|
||||
} TreeStore;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user