GNOME Bugzilla – Bug 351930
Category icons do not appear in preview pane
Last modified: 2013-09-10 13:42:14 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:
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.
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.
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.
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.
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.
confirming, looks broken currently.
The changes made looks reasonable. Some comments, + case '<': + g_string_append (buffer, "<"); + 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.
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.
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 !!!
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.
also see bug 353924 which is about this issue
Patch proposed in bug #353924 addresses comment #10. So that just leaves the issue Chen raised in comment #9.
Chen : Any follow-ups on this ?
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?
Changing summary to better reflect the remaining issue (comment #9).
Task preview displays category icons in 2.23.5. Shall we close the bug ?
Matt, ping
(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.
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.
(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...