Re: Recent Files Manager in libegg - Take 2


On 7/22/05, Kristof Vansant <de_lupus pandora be> wrote:
> Cool :) This looks very promising. Will there be a big api change or
> will it be easy to port existing apps to recent-files?

I tried to keep the RecentManager API simple - in fact, similar to the
RecentModel API - regarding the operations on the recently used
resources list (adding, removing, getting the list).  All you have to
do is to fill up a RecentData struct with the MIME type of the recent
file, the application's name (g_get_application_name() will be enough,
if you don't want anything fancy) and a command line useful to launch
the item; then, you pass this struct to the manager, along with a URI,
and the item is added to the list.

When you retrieve the list (or directly the data associated to a URI
inside the list), you'll get a RecentInfo object, which holds the
meta-data bound to an item, and has some utility functions (such as
the URI/basename conversion, or the retrieval of the icon bound to the
resource MIME type).

As for displaying the list inside a widget, the RecentChooser
interface should mask the user from actually having to deal with the
RecentManager object, so that showing the recently used resources list
should be painless.

There are examples in the source, anyway.


Emmanuele Bassi <ebassi gmail com>
Web site:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]