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>
|
Sun Feb 7 05:29:17 1999 Timur Bakeyev <mc@bat.ru>
|
||||||
|
|
||||||
* Makefile.in: Remove references and dependences to/from libslang -
|
* Makefile.in: Remove references and dependences to/from libslang -
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "dir-open.xpm"
|
#include "dir-open.xpm"
|
||||||
#include "dir-close.xpm"
|
#include "dir-close.xpm"
|
||||||
|
#include "main.h"
|
||||||
#include "treestore.h"
|
#include "treestore.h"
|
||||||
#include "gtkdtree.h"
|
#include "gtkdtree.h"
|
||||||
|
|
||||||
@ -101,13 +102,11 @@ gtk_dtree_contains (GtkDTree *dtree, GtkCTreeNode *parent, char *text)
|
|||||||
static GtkCTreeNode *
|
static GtkCTreeNode *
|
||||||
gtk_dtree_insert_node (GtkDTree *dtree, GtkCTreeNode *parent, char *text)
|
gtk_dtree_insert_node (GtkDTree *dtree, GtkCTreeNode *parent, char *text)
|
||||||
{
|
{
|
||||||
GtkCTreeNode *sibling;
|
|
||||||
char *texts [1];
|
char *texts [1];
|
||||||
|
|
||||||
texts [0] = text;
|
texts [0] = text;
|
||||||
|
|
||||||
sibling = gtk_ctree_insert_node (
|
return gtk_ctree_insert_node (GTK_CTREE (dtree), parent, NULL,
|
||||||
GTK_CTREE (dtree), parent, NULL,
|
|
||||||
texts, TREE_SPACING,
|
texts, TREE_SPACING,
|
||||||
dtree->pixmap_close,
|
dtree->pixmap_close,
|
||||||
dtree->bitmap_close,
|
dtree->bitmap_close,
|
||||||
|
@ -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>
|
Sun Feb 7 06:11:48 1999 Timur Bakeyev <mc@bat.ru>
|
||||||
|
|
||||||
* Makefile.in: Change calls to xmkdir to mkinstalldirs - this is more
|
* Makefile.in: Change calls to xmkdir to mkinstalldirs - this is more
|
||||||
|
@ -129,12 +129,12 @@ tree_store_whereis (char *name)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TreeStore *
|
TreeStore *
|
||||||
tree_store_init (void)
|
tree_store_init (void)
|
||||||
{
|
{
|
||||||
ts.tree_first = 0;
|
ts.tree_first = 0;
|
||||||
ts.tree_last = 0;
|
ts.tree_last = 0;
|
||||||
|
ts.check_name_stack = 0;
|
||||||
ts.refcount++;
|
ts.refcount++;
|
||||||
|
|
||||||
return &ts;
|
return &ts;
|
||||||
@ -484,6 +484,7 @@ remove_entry (tree_entry *entry)
|
|||||||
entry->prev->next = entry->next;
|
entry->prev->next = entry->next;
|
||||||
else
|
else
|
||||||
ts.tree_first = entry->next;
|
ts.tree_first = entry->next;
|
||||||
|
|
||||||
if (entry->next)
|
if (entry->next)
|
||||||
entry->next->prev = entry->prev;
|
entry->next->prev = entry->prev;
|
||||||
else
|
else
|
||||||
@ -500,11 +501,11 @@ void
|
|||||||
tree_store_remove_entry (char *name)
|
tree_store_remove_entry (char *name)
|
||||||
{
|
{
|
||||||
tree_entry *current, *base, *old;
|
tree_entry *current, *base, *old;
|
||||||
int len, base_sublevel;
|
int len;
|
||||||
char *check_name;
|
char *check_name;
|
||||||
|
|
||||||
g_return_if_fail (name != NULL);
|
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 */
|
/* Miguel Ugly hack */
|
||||||
if (name [0] == PATH_SEP && name [1] == 0)
|
if (name [0] == PATH_SEP && name [1] == 0)
|
||||||
@ -515,12 +516,8 @@ tree_store_remove_entry (char *name)
|
|||||||
if (!base)
|
if (!base)
|
||||||
return; /* Doesn't exist */
|
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);
|
len = strlen (base->name);
|
||||||
current = base->next;
|
current = base->next;
|
||||||
while (current
|
while (current
|
||||||
@ -548,10 +545,9 @@ tree_store_mark_checked (const char *subname)
|
|||||||
if (!ts.loaded)
|
if (!ts.loaded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ts.check_name_list == NULL)
|
g_return_if_fail (ts.check_name_stack != NULL);
|
||||||
return;
|
|
||||||
|
|
||||||
check_name = ts.check_name_list->data;
|
check_name = ts.check_name_stack->data;
|
||||||
|
|
||||||
/* Calculate the full name of the subdirectory */
|
/* Calculate the full name of the subdirectory */
|
||||||
if (subname [0] == '.' &&
|
if (subname [0] == '.' &&
|
||||||
@ -614,18 +610,18 @@ tree_store_start_check (char *path)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
current = tree_store_add_entry (path);
|
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;
|
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;
|
retval = current;
|
||||||
|
|
||||||
/* Mark old subdirectories for delete */
|
/* Mark old subdirectories for delete */
|
||||||
ts.check_start = current->next;
|
ts.check_start = current->next;
|
||||||
check_name = ts.check_name_list->data;
|
check_name = ts.check_name_stack->data;
|
||||||
len = strlen (check_name);
|
len = strlen (check_name);
|
||||||
|
|
||||||
current = ts.check_start;
|
current = ts.check_start;
|
||||||
@ -655,15 +651,15 @@ tree_store_end_check (void)
|
|||||||
tree_entry *current, *old;
|
tree_entry *current, *old;
|
||||||
int len;
|
int len;
|
||||||
char *check_name;
|
char *check_name;
|
||||||
GList *list_head;
|
GSList *stack_head;
|
||||||
|
|
||||||
if (!ts.loaded)
|
if (!ts.loaded)
|
||||||
return;
|
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 delete marks and delete if found */
|
||||||
check_name = ts.check_name_list->data;
|
check_name = ts.check_name_stack->data;
|
||||||
len = strlen (check_name);
|
len = strlen (check_name);
|
||||||
|
|
||||||
current = ts.check_start;
|
current = ts.check_start;
|
||||||
@ -676,10 +672,10 @@ tree_store_end_check (void)
|
|||||||
remove_entry (old);
|
remove_entry (old);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (ts.check_name_list->data);
|
g_free (ts.check_name_stack->data);
|
||||||
list_head = ts.check_name_list;
|
stack_head = ts.check_name_stack;
|
||||||
ts.check_name_list = list_head->next;
|
ts.check_name_stack = g_slist_remove_link (ts.check_name_stack, stack_head);
|
||||||
g_list_free_1 (list_head);
|
g_slist_free_1 (stack_head);
|
||||||
}
|
}
|
||||||
|
|
||||||
tree_entry *
|
tree_entry *
|
||||||
@ -766,7 +762,6 @@ tree_store_notify_add (tree_entry *entry)
|
|||||||
Hook *p = add_entry_hooks;
|
Hook *p = add_entry_hooks;
|
||||||
tree_store_add_fn r;
|
tree_store_add_fn r;
|
||||||
|
|
||||||
|
|
||||||
while (p) {
|
while (p) {
|
||||||
r = (tree_store_add_fn) p->hook_fn;
|
r = (tree_store_add_fn) p->hook_fn;
|
||||||
r (entry, p->hook_data);
|
r (entry, p->hook_data);
|
||||||
|
@ -24,7 +24,7 @@ typedef struct {
|
|||||||
tree_entry *tree_first; /* First entry in the list */
|
tree_entry *tree_first; /* First entry in the list */
|
||||||
tree_entry *tree_last; /* Last entry in the list */
|
tree_entry *tree_last; /* Last entry in the list */
|
||||||
tree_entry *check_start; /* Start of checked subdirectories */
|
tree_entry *check_start; /* Start of checked subdirectories */
|
||||||
GList *check_name_list;
|
GSList *check_name_stack;
|
||||||
unsigned int loaded : 1;
|
unsigned int loaded : 1;
|
||||||
unsigned int dirty : 1;
|
unsigned int dirty : 1;
|
||||||
} TreeStore;
|
} TreeStore;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user