summaryrefslogtreecommitdiff
path: root/cubedbus.c
diff options
context:
space:
mode:
authorJoel Bosveld <joel@JOEL-UBUNTU.(none)>2007-11-22 20:38:30 +0900
committerJoel Bosveld <joel@JOEL-UBUNTU.(none)>2007-11-22 20:38:30 +0900
commit6f030a37fb332637894d5cdbc4095b0a67c1de6c (patch)
tree166729c21d566c5ebd12e5a22c8221a0575c3f97 /cubedbus.c
parent95982b91c7c8f8bd0d0368ce762458d58478976e (diff)
downloadcubedbus-6f030a37fb332637894d5cdbc4095b0a67c1de6c.tar.gz
cubedbus-6f030a37fb332637894d5cdbc4095b0a67c1de6c.tar.bz2
Fixed delete problem. There is a bug with objects though, the
transformations of object only apply to first child, rather than all of them.
Diffstat (limited to 'cubedbus.c')
-rw-r--r--cubedbus.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/cubedbus.c b/cubedbus.c
index af58084..c7fd7bf 100644
--- a/cubedbus.c
+++ b/cubedbus.c
@@ -152,9 +152,7 @@ cubedbusDeleteObject (CompDisplay *d,
if(!s) return FALSE;
CUBEDBUS_SCREEN(s);
- compLogMessage(NULL, "cubedbus", CompLogLevelDebug, "started teh delete function");
-
- CubedbusObject **head=&gs->head;
+ CubedbusObject *head=gs->head;
CubedbusObject *objptr=gs->head;
CubedbusName *cubedbusName = malloc (sizeof(CubedbusName));
@@ -172,7 +170,7 @@ cubedbusDeleteObject (CompDisplay *d,
if(!strcmp(objptr->name, cubedbusName->string[i]))
{
- head=&objptr;
+ head=objptr;
CubedbusObj *data=objptr->data;
objptr=data->firstChild;
break;
@@ -186,12 +184,15 @@ cubedbusDeleteObject (CompDisplay *d,
if(objptr==NULL) return false;
if(!strcmp(objptr->name,cubedbusName->string[i]))
{
- if(!(objptr->prev == NULL)) objptr->prev->next=objptr->next;
- else *head=(objptr->next);
-
- if(!(objptr->next == NULL)) objptr->next->prev=objptr->prev;
+ if(objptr->prev != NULL) objptr->prev->next=objptr->next;
+ else
+ {
+ CubedbusObj *data = head->data;
+ data->firstChild=objptr->next;
+ }
+
+ if(objptr->next != NULL) objptr->next->prev=objptr->prev;
- compLogMessage(NULL, "cubedbus", CompLogLevelDebug, "calling delfunc");
return (objptr->delfunc) (objptr);
}
objptr=objptr->next;