Re: recently-used.xbel

On 23/01/2015 13:02, Murray Cumming wrote:
On Fri, 2015-01-23 at 11:55 +0000, John Emmas wrote:
So what API calls do I need to eventually arrive at a pointer to the
RecentManager object?
If you just call Gtk::RecentManager::get_default() (or
gtk_recent_manager_get_default) instead of instantiating it yourself
then you can get it anywhere you like.

On 22/01/2015 19:48, Emmanuele Bassi wrote:
a GtkRecentManager is a GObject; you just connect to the changed
signal, like you would on any other GObject instance.

Thanks guys. I only managed to return to this today but after following your advices, I've managed to set up a working handler function. I can iterate over my Gtk::RecentManager entries and remove any that I don't want. However I've hit a couple of things that I'm not understanding.... I'm using Gtk::RecentManager::get_items() to return a std::vector which contains my current RecentManager entries:-

According to the above documentation, once I've finished doing whatever I'm doing, I need to call 'Gtk::RecentInfo::unref()' for each entry in the vector. The first problem is that the relevant function is called 'unreference()' (rather than 'unref()') so the documentation needs to be corrected.

The second problem is that (after I've unreferenced all the entries) I'm supposed to call Glib::list_free()' to free the returned list (which is in fact, a vector). And there's no such function as 'Glib::list_free()' AFAICT. I'm using glibmm ver2.42.0. Am I looking in the wrong place?


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