GNOME Bugzilla – Bug 336208
EggRecentManager should allow overriding bookmarks filename
Last modified: 2006-03-30 09:26:55 UTC
There was a brief discussion on usability-list about the "recently-used applications" code in the upcoming Novell Linux Desktop 10 main menu, and possibly adding something similar to upstream GNOME. qv: http://mail.gnome.org/archives/usability/2006-March/msg00215.html As mentioned there, this is currently implemented using a hacked version of EggRecentModel that lets you specify the name of the recently-used file, so we can have separate recently-used-documents and recently-used-apps lists. It would be nice to get that feature into the version of EggRecentManager that's going into gtk+ 2.10. (I was going to attach our patch, but it wouldn't apply against EggRecentManager, and it's sort of ugly and wrong, and it's not like it's terribly complicated anyway.)
since the code can filter out the application launchers pretty well, compared to egg-recent-model filtering functions, I'm not entirely convinced that keeping the recently used applications, files and documents (differences between "files" and "documents"?) physically separated into their own files is the right approach. all in all, is just a matter of filtering on a pattern ("*.desktop"), a group ("Launchers") or a MIME type ("application/x-desktop"). anyway, adding a (constructor-only) "filename" property to the RecentManager wouldn't require many changes.
obviously, the menu applet would have to save each .desktop file it launches, using the right MIME type, the right group and the right name.
Sure, it would be easy for the main menu to filter only the things it wants, the trick would be that the recent documents code would also have to filter those same things *out* of its list so that you didn't end up with applications in the Recent Files menu. (For adding things to the recent-apps list, I'm pretty sure the only change we needed to make was to patch gnome_desktop_item_launch().)
okay, I'm much more convinced. :-) is using something like: manager = g_object_new (GTK_TYPE_RECENT_MANAGER, "filename", recent_apps_file, NULL); enough or should I add a specific function, like: GtkRecentManager *gtk_recent_manager_for_file (const gchar *filename);
The former is probably fine. If people suddenly come up with tons of other use cases where we want additional recently-used lists, you could always add the explicit constructor later.
A construct-only property sounds like a fine approach to me.
The GtkRecentManager in HEAD has the "filename" constructor-only property.