aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-08-08 05:13:52 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-08-08 05:13:52 +0800
commit6feb0b5e5c5f9b9eac7e8dc99a3f3b4f780ee0d4 (patch)
tree5be2f3c2eaa29bc76bd348e02695920a40e86b3f /shell
parent98e5368deb85eee6a8772afcc456fbaf9c02016b (diff)
downloadgsoc2013-evolution-6feb0b5e5c5f9b9eac7e8dc99a3f3b4f780ee0d4.tar
gsoc2013-evolution-6feb0b5e5c5f9b9eac7e8dc99a3f3b4f780ee0d4.tar.gz
gsoc2013-evolution-6feb0b5e5c5f9b9eac7e8dc99a3f3b4f780ee0d4.tar.bz2
gsoc2013-evolution-6feb0b5e5c5f9b9eac7e8dc99a3f3b4f780ee0d4.tar.lz
gsoc2013-evolution-6feb0b5e5c5f9b9eac7e8dc99a3f3b4f780ee0d4.tar.xz
gsoc2013-evolution-6feb0b5e5c5f9b9eac7e8dc99a3f3b4f780ee0d4.tar.zst
gsoc2013-evolution-6feb0b5e5c5f9b9eac7e8dc99a3f3b4f780ee0d4.zip
[Updated the shortcuts view implementation to set the icons on a
per-shortcut basis (instead of a per-URL basis) according to the changes in the EShortcutBar API.] * e-shortcuts-view-model.c (load_group_into_model): Get the icon from the folder type registry. (shortcuts_new_shortcut_cb): Likewise. (shortcuts_update_shortcut_cb): Likewise. * e-shortcuts-view.c (icon_callback): Removed. (e_shortcuts_view_construct): Don't set the icon callback anymore. svn path=/trunk/; revision=11741
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog10
-rw-r--r--shell/e-shortcuts-view-model.c31
-rw-r--r--shell/e-shortcuts-view.c39
3 files changed, 37 insertions, 43 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index d8e04a1692..3a25203c57 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,13 @@
+2001-08-07 Ettore Perazzoli <ettore@ximian.com>
+
+ * e-shortcuts-view-model.c (load_group_into_model): Get the icon
+ from the folder type registry.
+ (shortcuts_new_shortcut_cb): Likewise.
+ (shortcuts_update_shortcut_cb): Likewise.
+
+ * e-shortcuts-view.c (icon_callback): Removed.
+ (e_shortcuts_view_construct): Don't set the icon callback anymore.
+
2001-08-07 Jason Leach <jleach@ximian.com>
* e-storage-set-view.c (etree_value_at): Don't use a leaky hash to
diff --git a/shell/e-shortcuts-view-model.c b/shell/e-shortcuts-view-model.c
index 03fd22a239..43f026716e 100644
--- a/shell/e-shortcuts-view-model.c
+++ b/shell/e-shortcuts-view-model.c
@@ -62,13 +62,14 @@ load_group_into_model (EShortcutsViewModel *shortcuts_view_model,
{
EShortcutsViewModelPrivate *priv;
EStorageSet *storage_set;
+ EFolderTypeRegistry *folder_type_registry;
const GSList *shortcut_list;
const GSList *p;
priv = shortcuts_view_model->priv;
storage_set = e_shortcuts_get_storage_set (priv->shortcuts);
- g_assert (storage_set != NULL);
+ folder_type_registry = e_storage_set_get_folder_type_registry (storage_set);
shortcut_list = e_shortcuts_get_shortcuts_in_group (priv->shortcuts, group_num);
if (shortcut_list == NULL)
@@ -80,7 +81,13 @@ load_group_into_model (EShortcutsViewModel *shortcuts_view_model,
item = (const EShortcutItem *) p->data;
name_with_unread = get_name_with_unread (item);
- e_shortcut_model_add_item (E_SHORTCUT_MODEL (shortcuts_view_model), group_num, -1, item->uri, name_with_unread);
+ e_shortcut_model_add_item (E_SHORTCUT_MODEL (shortcuts_view_model),
+ group_num, -1,
+ item->uri,
+ name_with_unread,
+ e_folder_type_registry_get_icon_for_type (folder_type_registry,
+ item->type,
+ FALSE));
g_free (name_with_unread);
}
}
@@ -165,11 +172,16 @@ shortcuts_new_shortcut_cb (EShortcuts *shortcuts,
EShortcutsViewModel *shortcuts_view_model;
EShortcutsViewModelPrivate *priv;
const EShortcutItem *shortcut_item;
+ EStorageSet *storage_set;
+ EFolderTypeRegistry *folder_type_registry;
char *name_with_unread;
shortcuts_view_model = E_SHORTCUTS_VIEW_MODEL (data);
priv = shortcuts_view_model->priv;
+ storage_set = e_shortcuts_get_storage_set (priv->shortcuts);
+ folder_type_registry = e_storage_set_get_folder_type_registry (storage_set);
+
shortcut_item = e_shortcuts_get_shortcut (priv->shortcuts, group_num, item_num);
g_assert (shortcut_item != NULL);
@@ -177,7 +189,10 @@ shortcuts_new_shortcut_cb (EShortcuts *shortcuts,
e_shortcut_model_add_item (E_SHORTCUT_MODEL (shortcuts_view_model),
group_num, item_num,
shortcut_item->uri,
- name_with_unread);
+ name_with_unread,
+ e_folder_type_registry_get_icon_for_type (folder_type_registry,
+ shortcut_item->type,
+ FALSE));
g_free (name_with_unread);
}
@@ -201,12 +216,17 @@ shortcuts_update_shortcut_cb (EShortcuts *shortcuts,
{
EShortcutsViewModel *shortcuts_view_model;
EShortcutsViewModelPrivate *priv;
+ EFolderTypeRegistry *folder_type_registry;
+ EStorageSet *storage_set;
const EShortcutItem *shortcut_item;
char *name_with_unread;
shortcuts_view_model = E_SHORTCUTS_VIEW_MODEL (data);
priv = shortcuts_view_model->priv;
+ storage_set = e_shortcuts_get_storage_set (shortcuts);
+ folder_type_registry = e_storage_set_get_folder_type_registry (storage_set);
+
shortcut_item = e_shortcuts_get_shortcut (priv->shortcuts, group_num, item_num);
g_assert (shortcut_item != NULL);
@@ -214,7 +234,10 @@ shortcuts_update_shortcut_cb (EShortcuts *shortcuts,
e_shortcut_model_update_item (E_SHORTCUT_MODEL (shortcuts_view_model),
group_num, item_num,
shortcut_item->uri,
- name_with_unread);
+ name_with_unread,
+ e_folder_type_registry_get_icon_for_type (folder_type_registry,
+ shortcut_item->type,
+ FALSE));
g_free (name_with_unread);
}
diff --git a/shell/e-shortcuts-view.c b/shell/e-shortcuts-view.c
index 2d9956ebce..53a83ff243 100644
--- a/shell/e-shortcuts-view.c
+++ b/shell/e-shortcuts-view.c
@@ -86,42 +86,6 @@ get_storage_set_path_from_uri (const char *uri)
return colon + 1;
}
-/* Icon callback for the shortcut bar. */
-static GdkPixbuf *
-icon_callback (EShortcutBar *shortcut_bar,
- const char *uri,
- gpointer data)
-{
- EFolderTypeRegistry *folder_type_registry;
- EShortcuts *shortcuts;
- EStorageSet *storage_set;
- EFolder *folder;
- GdkPixbuf *pixbuf;
- const char *type;
-
- shortcuts = E_SHORTCUTS (data);
-
- storage_set = e_shortcuts_get_storage_set (shortcuts);
- folder_type_registry = e_storage_set_get_folder_type_registry (storage_set);
- folder = e_storage_set_get_folder (storage_set,
- get_storage_set_path_from_uri (uri));
-
- if (folder == NULL)
- return NULL;
-
- type = e_folder_get_type_string (folder);
- if (type == NULL)
- return NULL;
-
- /* FIXME mini icons? */
- pixbuf = e_folder_type_registry_get_icon_for_type (folder_type_registry, type, FALSE);
-
- if (pixbuf != NULL)
- gdk_pixbuf_ref (pixbuf);
-
- return pixbuf;
-}
-
static void
show_new_group_dialog (EShortcutsView *view)
@@ -671,9 +635,6 @@ e_shortcuts_view_construct (EShortcutsView *shortcuts_view,
priv->shortcuts = shortcuts;
gtk_object_ref (GTK_OBJECT (priv->shortcuts));
- e_shortcut_bar_set_icon_callback (E_SHORTCUT_BAR (shortcuts_view), icon_callback,
- shortcuts);
-
e_shortcut_bar_set_model (E_SHORTCUT_BAR (shortcuts_view),
E_SHORTCUT_MODEL (e_shortcuts_view_model_new (shortcuts)));
}