diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2010-09-30 05:19:31 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2010-10-26 13:58:33 +0200 |
commit | e0e63649dc830cd63ae4e7a958e224ef3b2a1375 (patch) | |
tree | bfd6ebef764e0e439b2207d1f9d9ddb09985a0bd /src/ld-library.c | |
parent | 0c9b297e50ffaf9a34f50a99f7bc4e02ea295d1d (diff) | |
download | logdiag-e0e63649dc830cd63ae4e7a958e224ef3b2a1375.tar.gz logdiag-e0e63649dc830cd63ae4e7a958e224ef3b2a1375.tar.xz logdiag-e0e63649dc830cd63ae4e7a958e224ef3b2a1375.zip |
Redesign the library and related components.
This step is needed, since the current design is quite chaotic
and it would not be possible to finish the application.
There's still a lot to be done.
After this step, it's time to implement the rest of LdLua.
Diffstat (limited to 'src/ld-library.c')
-rw-r--r-- | src/ld-library.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ld-library.c b/src/ld-library.c index ba12d5d..d4eec09 100644 --- a/src/ld-library.c +++ b/src/ld-library.c @@ -12,9 +12,10 @@ #include "config.h" -#include "ld-library.h" -#include "ld-symbol-category.h" #include "ld-symbol.h" +#include "ld-symbol-category.h" +#include "ld-library.h" + #include "ld-lua.h" @@ -132,9 +133,10 @@ load_category (LdLibrary *self, const char *path, const char *name) /* TODO: Search for category.json and read the category name from it. */ /* TODO: Search for xyz.lua and load the objects into the category. */ - cat = ld_symbol_category_new (self); - cat->name = g_strdup (name); - cat->image_path = icon_file; + cat = ld_symbol_category_new (name); + ld_symbol_category_set_image_path (cat, icon_file); + + g_free (icon_file); return cat; } @@ -167,7 +169,8 @@ ld_library_load (LdLibrary *self, const char *path) categ_path = g_build_filename (path, item, NULL); cat = load_category (self, categ_path, item); if (cat) - g_hash_table_insert (self->categories, cat->name, cat); + g_hash_table_insert (self->categories, + g_strdup (ld_symbol_category_get_name (cat)), cat); g_free (categ_path); changed = TRUE; |