From 71c2e6f0786b3e56f2a0063cfa80f8de5033a59a Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sat, 23 Feb 2008 12:13:28 +0000 Subject: [PATCH] Image/text class destroy is broken (and never used). SVN revision: 33819 --- src/aclass.c | 3 ++- src/aclass.h | 1 - src/iclass.c | 10 +++++++++- src/tclass.c | 16 ++++++++++++---- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/aclass.c b/src/aclass.c index 2e7dbfca..26426428 100644 --- a/src/aclass.c +++ b/src/aclass.c @@ -189,7 +189,7 @@ ActionclassCreate(const char *name, int global) return ac; } -void +static void ActionclassDestroy(ActionClass * ac) { int i; @@ -211,6 +211,7 @@ ActionclassDestroy(ActionClass * ac) Efree(ac->list); Efree(ac->name); Efree(ac->tooltipstring); + Efree(ac); mode_action_destroy = 1; } diff --git a/src/aclass.h b/src/aclass.h index 90e61c65..ba43e471 100644 --- a/src/aclass.h +++ b/src/aclass.h @@ -29,7 +29,6 @@ /* aclass.c */ int AclassConfigLoad(FILE * fs); ActionClass *ActionclassCreate(const char *name, int global); -void ActionclassDestroy(ActionClass * ac); Action *ActionCreate(char event, char anymod, int mod, int anybut, int but, char anykey, const char *key, const char *tooltipstring); diff --git a/src/iclass.c b/src/iclass.c index c3eafa73..8726155e 100644 --- a/src/iclass.c +++ b/src/iclass.c @@ -32,6 +32,8 @@ #include "tclass.h" #include "xwin.h" +#define ENABLE_DESTROY 0 /* Broken */ + #if ENABLE_COLOR_MODIFIERS typedef struct { @@ -223,6 +225,7 @@ ImagestateCreate(const char *file) return is; } +#if ENABLE_DESTROY static void ImagestateDestroy(ImageState * is) { @@ -253,6 +256,7 @@ FreeImageStateArray(ImageStateArray * isa) ImagestateDestroy(isa->clicked); ImagestateDestroy(isa->disabled); } +#endif /* ENABLE_DESTROY */ static void ImagestateColorsAlloc(ImageState * is) @@ -343,6 +347,7 @@ ImageclassCreate(const char *name) return ic; } +#if ENABLE_DESTROY static void ImageclassDestroy(ImageClass * ic) { @@ -372,6 +377,7 @@ ImageclassDestroy(ImageClass * ic) Efree(ic); } +#endif /* ENABLE_DESTROY */ ImageClass * ImageclassAlloc(const char *name, int fallback) @@ -1438,7 +1444,9 @@ ImageclassIpc(const char *params) if (!strcmp(param2, "delete")) { +#if ENABLE_DESTROY ImageclassDestroy(ic); +#endif } else if (!strcmp(param2, "modify")) { @@ -1551,7 +1559,7 @@ static const IpcItem ImageclassIpcArray[] = { { ImageclassIpc, "imageclass", NULL, - "List imageclasses, create/delete/modify/apply an imageclass", + "List imageclasses, apply an imageclass", NULL} , }; diff --git a/src/tclass.c b/src/tclass.c index 0fef61e2..050c462f 100644 --- a/src/tclass.c +++ b/src/tclass.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2007 Kim Woelders + * Copyright (C) 2004-2008 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -29,6 +29,8 @@ #include "tclass.h" #include "xwin.h" +#define ENABLE_DESTROY 0 /* Broken */ + static Ecore_List *tclass_list = NULL; static char * @@ -66,6 +68,7 @@ TextstateCreate(const char *font) return ts; } +#if ENABLE_DESTROY static void TextStateDestroy(TextState * ts) { @@ -78,6 +81,7 @@ TextStateDestroy(TextState * ts) Efree(ts); } +#endif static TextClass * TextclassCreate(const char *name) @@ -98,6 +102,7 @@ TextclassCreate(const char *name) return tc; } +#if ENABLE_DESTROY static void TextclassDestroy(TextClass * tc) { @@ -127,6 +132,7 @@ TextclassDestroy(TextClass * tc) Efree(tc); } +#endif /* ENABLE_DESTROY */ TextClass * TextclassAlloc(const char *name, int fallback) @@ -403,7 +409,7 @@ TextclassIpc(const char *params) p = params; l = 0; param1[0] = param2[0] = '\0'; - sscanf(params, "%1000s %1000s %n", param1, param2, &l); + sscanf(p, "%1000s %1000s %n", param1, param2, &l); p += l; if (!strncmp(param1, "list", 2)) @@ -433,7 +439,9 @@ TextclassIpc(const char *params) if (!strcmp(param2, "delete")) { +#if ENABLE_DESTROY TextclassDestroy(tc); +#endif } else if (!strcmp(param2, "modify")) { @@ -498,7 +506,7 @@ TextclassIpc(const char *params) } else { - IpcPrintf("Error: Unknown operation specified\n"); + IpcPrintf("Error: unknown operation specified\n"); } } @@ -506,7 +514,7 @@ static const IpcItem TextclassIpcArray[] = { { TextclassIpc, "textclass", NULL, - "List textclasses, create/delete/modify/apply a textclass", + "List textclasses, apply a textclass", NULL} , };