After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 351930 - Category icons do not appear in preview pane
Category icons do not appear in preview pane
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
1.8.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Chenthill P
Evolution QA team
Depends on:
Blocks: 165732
 
 
Reported: 2006-08-18 14:55 UTC by Matthew Barnes
Modified: 2013-09-10 13:42 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Proposed patch (18.48 KB, patch)
2006-08-27 05:13 UTC, Matthew Barnes
none Details | Review
Patch against CVS HEAD (20.24 KB, patch)
2006-08-27 19:06 UTC, Matthew Barnes
reviewed Details | Review
Revised patch with both suggestions implemented (22.31 KB, patch)
2006-10-01 08:41 UTC, Matthew Barnes
committed Details | Review

Description Matthew Barnes 2006-08-18 14:55:05 UTC
Forwarding this bug from downstream.
Confirmed that it still exists in Evolution 2.7.91.
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=202573


Description of problem:


Version-Release number of selected component (if applicable):
evolution-2.7.91-2

How reproducible:
always

Steps to Reproduce:
1. Launch Tasks-Evolution 
2. Create a new task and set "Categories" to be Birthday/International/Time &
Expenses
3. Save the task and check it in task preview window

  
Actual results:
Icons cannot be shown, pls see attached screenshot

Expected results:


Additional info:
Comment 1 Matthew Barnes 2006-08-21 03:49:05 UTC
I traced the problem to GConf key "/apps/evolution/general/category_master_list".

The "icon" attribute of each category has the wrong path:

    /usr/share/pixmaps/evolution-data-server-1.6/category_*.png

All of my category icon files live in:

    /usr/share/pixmaps/evolution-data-server-1.8/category_*.png

So I don't see any category icons at all.

It seems the hard-coded paths in this GConf key are not getting properly updated when upgrading from evolution-data-server 1.5/1.6 to 1.7/1.8.

The logic that writes the initial set of categories into GConf is in libedataserver/e-categories.c.  The existing logic saves a default set of categories (along with the hard-coded paths) only if the GConf key does not exist.  Once saved, future invocations of evolution-data-server will simply load the GConf value that's there.

Perhaps the logic needs to be smarter about detecting when an upgrade has occurred or when those paths no longer exist.  Or perhaps we need to play games with backward-compatible symlinks in the /usr/share/pixmaps directory when upgrading from one major release to another.

Not sure what the right approach is for this one.
Comment 2 Matthew Barnes 2006-08-24 22:59:48 UTC
I have a proposal for this one.

I think the "/apps/evolution/general/category_master_list" GConf key is screwed up beyond repair for existing evolution users, so I propose that we migrate them to a new GConf key called "/apps/evolution/general/categories".  This new key will essentially serve the same purpose with one important difference.

For image files belonging to the default set of categories, we will only store the base filename, not the full path to the image.  i.e. "category_birthday_16.png" instead of "/usr/share/pixmaps/evolution-data-server-1.8/category_birthday_16.png"

Then we modify the logic in libedataserver/e-categories.c to prepend icon filenames with no path with E_DATA_SERVER_IMAGESDIR/.  The absolute path to the icon file will still be stored for custom categories.

This approach should make category icons continue to show up for users as we enter into the evolution-data-server-1.10 development cycle and beyond.

I'll see if I can whip up a patch for this.
Comment 3 Matthew Barnes 2006-08-25 13:42:15 UTC
After chewing on this a little while longer, here is perhaps a cleaner solution:

1) I still think we need to migrate users off of the existing GConf key in order
   to fix this.  But now I think that GConf is the wrong place to be storing XML
   data.  I think ~/.evolution/categories.xml is more appropriate.

2) The only data that is stored in /usr/share/pixmaps/evolution-data-server-1.8
   are the category pixmaps.  I see no reason why the directory has to include
   the version number.  Instead of playing games with path names like I suggested
   above, name the directory /usr/share/pixmaps/evolution-data-server.
Comment 4 Matthew Barnes 2006-08-27 05:13:40 UTC
Created attachment 71690 [details] [review]
Proposed patch

This patch does four things:

1) Changes the category icon directory from
   "/usr/share/pixmaps/evolution-data-server-1.x" to
   "/usr/share/pixmaps/evolution-data-server".

   The lack of a version-specific directory enables the saved category
   configuration to survive a major upgrade of evolution-data-server.

2) Stores category information in "~/.evolution/categories.xml" rather than
   in a GConf key.  GConf is not the right place to be storing XML data.

3) Changes the behavior of e_categories_get_list() to sort the list before
   returning it.  This makes the category configuration dialog list the
   available categories in alphabetic order (at least for English locales).
   Not sure whether this works for all locales.  Please advise.

4) Streamlines much of the existing code in e-categories.c.  One of the
   major things I noticed was that the author didn't seem to realize that
   the return value of g_string_append() is simply a pass-through and
   doesn't need to be continually reassigned to the GString variable.
   Also, the default categories are now listed as a static array to make
   them easier to read and maintain.
Comment 5 Matthew Barnes 2006-08-27 19:06:04 UTC
Created attachment 71715 [details] [review]
Patch against CVS HEAD

Forgot to add a ChangeLog entry and use the preferred diff options in the previous patch.
Comment 6 André Klapper 2006-08-28 02:53:15 UTC
confirming, looks broken currently.
Comment 7 Chenthill P 2006-09-29 21:35:29 UTC
The changes made looks reasonable.

Some comments,
+		case '<':
+			g_string_append (buffer, "&lt;");
+			break;
Since we already know the length of the string appended here, its better to use
g_string_append_len at relevant places in the patch.

Since the categories are stored in gconf as of now. There should be a migration code to move old data to categories.xml, else people who have removed/added new categories would lose their data.

Comment 8 Matthew Barnes 2006-10-01 08:41:36 UTC
Created attachment 73738 [details] [review]
Revised patch with both suggestions implemented

The initialization logic now works as follows w.r.t. migrating old data:

First try to load the categories.xml file.  If there is no such file, try to load the old GConf key for category data.  If there is no such key, load the default set of categories.

If there is no categories.xml file but the old GConf key exists, attempt to load and parse its contents.  If that goes well, save the category data to the XML file and unset the GConf key.  Also, adjust the icon file paths to point to the new unversioned pixmaps directory.
Comment 9 Chenthill P 2006-10-16 14:27:32 UTC
Committed to cvs HEAD and gnome-2-16 branch. The category icons still does not appear. The icons paths and names are reaching evolution properly, but there is some issue in component-preview in show it using gtkhtml. So am leaving the bug report open since the description talks about this issue too. Matthew, thanks for the patch !!!
Comment 10 Matthew Barnes 2006-11-01 12:42:30 UTC
I think my patch may have caused an unwanted side-effect.  From a recent evolution-list posting:

  Is there an easy way to put a address in the "To" column when addressing
  an email? When i press the "TO" button i get my address book(Personal)
  then i have change the category from "Anniversary" to "Any category" to
  get an address list to add to the "To" column. Suppose i have missed
  something?

I think this is a result of my sorting the categories, as mentioned in comment #4.  I don't think I'm even sorting them properly for internationalization.  And I'm guessing the category selection widget in that dialog just defaults to whatever comes first in the list, which is "Anniversary" now that the list is sorted.

It would be good to get this fixed for the next point release.
Comment 11 André Klapper 2006-11-01 12:57:14 UTC
also see bug 353924 which is about this issue
Comment 12 Matthew Barnes 2006-11-01 17:37:49 UTC
Patch proposed in bug #353924 addresses comment #10.  So that just leaves the issue Chen raised in comment #9.
Comment 13 Harish Krishnaswamy 2007-01-29 14:35:15 UTC
Chen : Any follow-ups on this ?
Comment 14 Priit Laes (IRC: plaes) 2007-05-22 13:30:10 UTC
I marked this bug as blocker for bug 165732 because we would like to use the category icons in the clock applet.

Am I correct that when this patch gets committed, the icons will be installed into $pkgdatadir/icons directory?
Comment 15 Matthew Barnes 2007-05-22 13:52:45 UTC
Changing summary to better reflect the remaining issue (comment #9).
Comment 16 Akhil Laddha 2008-07-31 11:15:10 UTC
Task preview displays category icons in 2.23.5. Shall we close the bug  ?
Comment 17 Akhil Laddha 2008-09-02 07:06:36 UTC
Matt, ping
Comment 18 Priit Laes (IRC: plaes) 2008-09-02 08:58:59 UTC
(In reply to comment #16)
> Task preview displays category icons in 2.23.5. Shall we close the bug  ?

Also gnome-panel might need these icons (clock applet appointments/birthdays) , will look into this in few days.
Comment 19 Matthew Barnes 2008-09-02 10:58:00 UTC
Confirming preview pane displays the category icons.  I don't see where the clock applet would even have /room/ to display the icons.  Tasks and appointments shown there are already truncated to the point of borderline uselessness.
Comment 20 Priit Laes (IRC: plaes) 2008-09-02 18:57:55 UTC
(In reply to comment #19)
> Confirming preview pane displays the category icons.  I don't see where the
> clock applet would even have /room/ to display the icons.  Tasks and
> appointments shown there are already truncated to the point of borderline
> uselessness.
> 

Well, currently for appointments calendar color is displayed, but for birthdays it would be nice to show a cake picture :P

But now that icons are installed under /usr/share/pixmaps/evolution-data-server clock applet can use them a bit more easily.

So, closing this bug...