Remove category icons.

This commit is contained in:
Přemysl Eric Janouch 2012-08-29 15:46:20 +02:00
parent a915bf4496
commit ef64c0427f
7 changed files with 6 additions and 338 deletions

View File

@ -167,9 +167,7 @@ LoadCategoryData;
static LdSymbolCategory *
load_category (LdLibrary *self, const gchar *path, const gchar *name)
{
LdSymbolCategory *cat = NULL;
gchar *icon_file, *category_file;
gchar *human_name;
gchar *category_file, *human_name;
LoadCategoryData data;
g_return_val_if_fail (LD_IS_LIBRARY (self), NULL);
@ -177,33 +175,20 @@ load_category (LdLibrary *self, const gchar *path, const gchar *name)
g_return_val_if_fail (name != NULL, NULL);
if (!g_file_test (path, G_FILE_TEST_IS_DIR))
goto load_category_fail_1;
icon_file = g_build_filename (path, "icon.svg", NULL);
if (!g_file_test (icon_file, G_FILE_TEST_IS_REGULAR))
{
g_warning ("the category in `%s' has no icon", path);
goto load_category_fail_2;
}
return NULL;
category_file = g_build_filename (path, "category.json", NULL);
human_name = read_human_name_from_file (category_file);
if (!human_name)
human_name = g_strdup (name);
cat = ld_symbol_category_new (name, human_name);
ld_symbol_category_set_image_path (cat, icon_file);
data.self = self;
data.cat = cat;
data.cat = ld_symbol_category_new (name, human_name);
foreach_dir (path, load_category_cb, &data, NULL);
g_free (human_name);
g_free (category_file);
load_category_fail_2:
g_free (icon_file);
load_category_fail_1:
return cat;
return data.cat;
}
/*

View File

@ -23,7 +23,7 @@
/*
* LdSymbolCategoryPrivate:
* @name: the name of this category.
* @image_path: path to the image for this category.
* @human_name: the localized human-readable name of this category.
* @symbols: (element-type LdSymbol *): symbols in this category.
* @subcategories: (element-type LdSymbolCategory *) children of this category.
*/
@ -31,7 +31,6 @@ struct _LdSymbolCategoryPrivate
{
gchar *name;
gchar *human_name;
gchar *image_path;
GSList *symbols;
GSList *subcategories;
};
@ -40,8 +39,7 @@ enum
{
PROP_0,
PROP_NAME,
PROP_HUMAN_NAME,
PROP_IMAGE_PATH
PROP_HUMAN_NAME
};
static void ld_symbol_category_get_property (GObject *object, guint property_id,
@ -87,16 +85,6 @@ ld_symbol_category_class_init (LdSymbolCategoryClass *klass)
"", G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_HUMAN_NAME, pspec);
/**
* LdSymbolCategory:image-path:
*
* Path to an image file representing this category.
*/
pspec = g_param_spec_string ("image-path", "Image path",
"Path to an image file representing this category.",
"", G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_IMAGE_PATH, pspec);
g_type_class_add_private (klass, sizeof (LdSymbolCategoryPrivate));
}
@ -122,9 +110,6 @@ ld_symbol_category_get_property (GObject *object, guint property_id,
case PROP_HUMAN_NAME:
g_value_set_string (value, ld_symbol_category_get_human_name (self));
break;
case PROP_IMAGE_PATH:
g_value_set_string (value, ld_symbol_category_get_image_path (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@ -145,9 +130,6 @@ ld_symbol_category_set_property (GObject *object, guint property_id,
case PROP_HUMAN_NAME:
ld_symbol_category_set_human_name (self, g_value_get_string (value));
break;
case PROP_IMAGE_PATH:
ld_symbol_category_set_image_path (self, g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@ -172,8 +154,6 @@ ld_symbol_category_finalize (GObject *gobject)
g_free (self->priv->name);
if (self->priv->human_name)
g_free (self->priv->human_name);
if (self->priv->image_path)
g_free (self->priv->image_path);
g_slist_foreach (self->priv->symbols, (GFunc) g_object_unref, NULL);
g_slist_free (self->priv->symbols);
@ -272,37 +252,6 @@ ld_symbol_category_get_human_name (LdSymbolCategory *self)
return self->priv->human_name;
}
/**
* ld_symbol_category_set_image_path:
* @self: an #LdSymbolCategory object.
* @image_path: (allow-none): The new path to the image for this category.
*/
void
ld_symbol_category_set_image_path (LdSymbolCategory *self,
const gchar *image_path)
{
g_return_if_fail (LD_IS_SYMBOL_CATEGORY (self));
if (self->priv->image_path)
g_free (self->priv->image_path);
self->priv->image_path = g_strdup (image_path);
g_object_notify (G_OBJECT (self), "image-path");
}
/**
* ld_symbol_category_get_image_path:
* @self: an #LdSymbolCategory object.
*
* Return value: (allow-none): filesystem path to the image for this category.
*/
const gchar *
ld_symbol_category_get_image_path (LdSymbolCategory *self)
{
g_return_val_if_fail (LD_IS_SYMBOL_CATEGORY (self), NULL);
return self->priv->image_path;
}
/**
* ld_symbol_category_insert_symbol:
* @self: an #LdSymbolCategory object.

View File

@ -62,9 +62,6 @@ const gchar *ld_symbol_category_get_name (LdSymbolCategory *self);
void ld_symbol_category_set_human_name (LdSymbolCategory *self,
const gchar *human_name);
const gchar *ld_symbol_category_get_human_name (LdSymbolCategory *self);
void ld_symbol_category_set_image_path (LdSymbolCategory *self,
const gchar *image_path);
const gchar *ld_symbol_category_get_image_path (LdSymbolCategory *self);
gboolean ld_symbol_category_insert_symbol (LdSymbolCategory *self,
LdSymbol *symbol, gint pos);

View File

@ -1,53 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="128"
height="128"
id="svg2">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(-3,-1)"
id="g3774"
style="fill:none;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none">
<path
d="m 20,63 45,0"
id="path3764"
style="fill:none;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 65,38 0,50"
id="path3766"
style="fill:none;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="M 65,53 110,23"
id="path3768"
style="fill:none;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 65,73 45,30"
id="path3770"
style="fill:none;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="M 78,92 93,92 88,77"
id="path3772"
style="fill:none;stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="128"
height="128"
id="svg2">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(0,-924.36218)"
id="layer1">
<g
transform="translate(-10,-60)"
id="g3016">
<path
d="m 25,1030.3622 20,0"
id="path3008"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 25,1014.3622 20,0"
id="path3010"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 45,118 0,-40 25,0 c 0,0 20,0 20,20 0,20 -20,20 -20,20 z"
transform="translate(0,924.36218)"
id="path3012"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 90,98 20,0"
transform="translate(0,924.36218)"
id="path3014"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
<g
transform="translate(5,-5)"
id="g3016-8">
<path
d="m 25,1022.3622 20,0"
id="path3010-0"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="M 45,118 45,78 75,98 z"
transform="translate(0,924.36218)"
id="path3012-9"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 87.5,1022.3622 17.5,0"
id="path3014-6"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 100,93 a 10,10 0 1 1 -20,0 10,10 0 1 1 20,0 z"
transform="matrix(0.5,0,0,0.5,37,975.86218)"
id="path3820"
style="fill:none;stroke:#000000;stroke-width:8;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="128"
height="128"
id="svg2">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="g3837">
<g
transform="translate(120,-10)"
id="g3771"
style="fill:none">
<path
d="m 140,48 a 25,25 0 1 1 -50,0 25,25 0 1 1 50,0 z"
transform="translate(-180,0)"
id="path2991"
style="stroke:#000000;stroke-width:4;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m -90,48 -15,0"
id="path3761"
style="stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m -40,48 15,0"
id="path3763"
style="stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m -80,33 30,30"
id="path3767"
style="stroke:#000000;stroke-width:4;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="M -50,33 -80,63"
id="path3769"
style="stroke:#000000;stroke-width:4;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
<g
transform="translate(0,5)"
id="g3786"
style="fill:none">
<path
d="m 90,57 0,20"
id="path3778"
style="stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 65,77 50,0"
id="path3780"
style="stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 70,93 40,0"
id="path3782"
style="stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 75,109 30,0"
id="path3784"
style="stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="128"
height="128"
id="svg2">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(0,-924.36218)"
id="layer1">
<g
transform="translate(0,9.75)"
id="g3784">
<path
d="m 15,960.11218 25,0 0,0"
id="path2985"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 42,935.11218 0,50"
id="path2987"
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 85,960.11218 -25,0 0,0"
id="path2985-2"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 58,935.11216 0,50.00002"
id="path2987-7"
style="fill:none;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
<path
d="m 29,1031.3622 15,0 c 0,0 0,-13 10,-13 10,0 10,15 10,15 0,0 0,-15 10,-15 10,0 10,15 10,15 0,0 0,-15 10,-15 10,0 10,13 10,13 l 15,0"
id="path3782"
style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB