aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@novell.com>2005-01-05 02:48:09 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2005-01-05 02:48:09 +0800
commit29f1f4aaebf804c2325f630844111ad99fbe4799 (patch)
treec6cf831affbf8b791275ebc069fb18fc5bc0e031
parent2f67df578fe940cf5e7aab8c98b7a0d1c71cfa71 (diff)
downloadgsoc2013-evolution-29f1f4aaebf804c2325f630844111ad99fbe4799.tar.gz
gsoc2013-evolution-29f1f4aaebf804c2325f630844111ad99fbe4799.tar.zst
gsoc2013-evolution-29f1f4aaebf804c2325f630844111ad99fbe4799.zip
removed most of the API. The rest will be removed as the GAL dependencies
2005-01-04 Rodrigo Moya <rodrigo@novell.com> * e-categories-config.[ch]: removed most of the API. The rest will be removed as the GAL dependencies are sorted out. svn path=/trunk/; revision=28235
-rw-r--r--e-util/ChangeLog5
-rw-r--r--e-util/e-categories-config.c115
-rw-r--r--e-util/e-categories-config.h9
3 files changed, 15 insertions, 114 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index dfe7035b6e..c9f1596fb6 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-04 Rodrigo Moya <rodrigo@novell.com>
+
+ * e-categories-config.[ch]: removed most of the API. The rest will
+ be removed as the GAL dependencies are sorted out.
+
2004-12-22 Not Zed <NotZed@Ximian.com>
* e-plugin.c: include config.h.
diff --git a/e-util/e-categories-config.c b/e-util/e-categories-config.c
index 2a63ebe036..da72879aae 100644
--- a/e-util/e-categories-config.c
+++ b/e-util/e-categories-config.c
@@ -13,66 +13,12 @@
#include <libgnome/gnome-i18n.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gal/widgets/e-categories.h>
+#include <libedataserver/e-categories.h>
#include "e-categories-config.h"
#include "e-categories-master-list-wombat.h"
-static gboolean initialized = FALSE;
-static ECategoriesMasterListWombat *ecmlw = NULL;
static GHashTable *icons_table = NULL;
-static void
-initialize_categories_config (void)
-{
- g_return_if_fail (initialized == FALSE);
-
- ecmlw = E_CATEGORIES_MASTER_LIST_WOMBAT (e_categories_master_list_wombat_new ());
- icons_table = g_hash_table_new (g_str_hash, g_str_equal);
- /* FIXME: must free the two objects above when exiting */
-
- initialized = TRUE;
-}
-
-/**
- * e_categories_config_get_color_for:
- * @category: Category to get the color for.
- *
- * Returns the representation of the color configured for the given
- * category
- *
- * Returns: An X color specification.
- */
-const char *
-e_categories_config_get_color_for (const char *category)
-{
- int n;
-
- g_return_val_if_fail (category != NULL, NULL);
-
- if (!initialized)
- initialize_categories_config ();
-
- for (n = 0;
- n < e_categories_master_list_count (E_CATEGORIES_MASTER_LIST (ecmlw));
- n++) {
- char *tmp_cat;
-
- tmp_cat = (char *) e_categories_master_list_nth (E_CATEGORIES_MASTER_LIST (ecmlw), n);
- if (tmp_cat && !strcmp (tmp_cat, category))
- return e_categories_master_list_nth_color (E_CATEGORIES_MASTER_LIST (ecmlw), n);
- }
-
- return NULL; /* not found */
-}
-
-/**
- * e_categories_config_set_color_for
- */
-void
-e_categories_config_set_color_for (const char *category, const char *color)
-{
- /* FIXME: implement */
-}
-
/**
* e_categories_config_get_icon_for:
* @category: Category for which to get the icon.
@@ -91,7 +37,7 @@ e_categories_config_get_icon_for (const char *category, GdkPixmap **pixmap, GdkB
g_return_val_if_fail (pixmap != NULL, FALSE);
- icon_file = (char *) e_categories_config_get_icon_file_for (category);
+ icon_file = (char *) e_categories_get_icon_file_for (category);
if (!icon_file) {
*pixmap = NULL;
if (mask != NULL)
@@ -100,17 +46,12 @@ e_categories_config_get_icon_for (const char *category, GdkPixmap **pixmap, GdkB
}
/* load the icon in our list */
- pixbuf = g_hash_table_lookup (icons_table, icon_file);
+ pixbuf = gdk_pixbuf_new_from_file (icon_file, NULL);
if (!pixbuf) {
- pixbuf = gdk_pixbuf_new_from_file (icon_file, NULL);
- if (!pixbuf) {
- *pixmap = NULL;
- if (mask != NULL)
- *mask = NULL;
- return FALSE;
- }
-
- g_hash_table_insert (icons_table, g_strdup (icon_file), pixbuf);
+ *pixmap = NULL;
+ if (mask != NULL)
+ *mask = NULL;
+ return FALSE;
}
/* render the pixbuf to the pixmap and mask passed */
@@ -122,43 +63,6 @@ e_categories_config_get_icon_for (const char *category, GdkPixmap **pixmap, GdkB
}
/**
- * e_categories_config_get_icon_file_for
- * @category: Category for which to get the icon file
- */
-const char *
-e_categories_config_get_icon_file_for (const char *category)
-{
- int n;
-
- g_return_val_if_fail (category != NULL, NULL);
-
- if (!initialized)
- initialize_categories_config ();
-
- for (n = 0;
- n < e_categories_master_list_count (E_CATEGORIES_MASTER_LIST (ecmlw));
- n++) {
- char *tmp_cat;
-
- tmp_cat = (char *) e_categories_master_list_nth (E_CATEGORIES_MASTER_LIST (ecmlw), n);
- if (tmp_cat && !strcmp (tmp_cat, category))
- return e_categories_master_list_nth_icon (E_CATEGORIES_MASTER_LIST (ecmlw), n);
- }
-
- return NULL; /* not found */
-}
-
-/**
- * e_categories_config_set_icon_for
- * @category: Category for which to set the icon.
- * @icon_file: Full path of the icon file.
- */
-void
-e_categories_config_set_icon_for (const char *category, const char *icon_file)
-{
-}
-
-/**
* e_categories_config_open_dialog_for_entry:
* entry: A GtkEntry on which to get/set the categories list.
*
@@ -177,16 +81,15 @@ e_categories_config_open_dialog_for_entry (GtkEntry *entry)
const char *text;
char *categories;
int result;
+ ECategoriesMasterListWombat *ecmlw;
g_return_if_fail (entry != NULL);
g_return_if_fail (GTK_IS_ENTRY (entry));
- if (!initialized)
- initialize_categories_config ();
-
text = gtk_entry_get_text (GTK_ENTRY (entry));
dialog = GTK_DIALOG (e_categories_new (text));
+ ecmlw = e_categories_master_list_wombat_new ();
g_object_set (dialog, "ecml", ecmlw, NULL);
/* run the dialog */
diff --git a/e-util/e-categories-config.h b/e-util/e-categories-config.h
index 3af14dfc7f..ed6b5639ae 100644
--- a/e-util/e-categories-config.h
+++ b/e-util/e-categories-config.h
@@ -17,17 +17,10 @@
G_BEGIN_DECLS
-const char *e_categories_config_get_color_for (const char *category);
-void e_categories_config_set_color_for (const char *category, const char *color);
-
gboolean e_categories_config_get_icon_for (const char *category,
GdkPixmap **icon,
GdkBitmap **mask);
-const char *e_categories_config_get_icon_file_for (const char *category);
-void e_categories_config_set_icon_for (const char *category,
- const char *pixmap_file);
-
-void e_categories_config_open_dialog_for_entry (GtkEntry *entry);
+void e_categories_config_open_dialog_for_entry (GtkEntry *entry);
G_END_DECLS