Web lists-archives.com

Re: recently-used.xbel




hi;

On 22 January 2015 at 19:34, John Emmas <johne53@xxxxxxxxxxxxx> wrote:

>> On Thu, Jan 22, 2015 at 8:52 AM, John Emmas <johne53@xxxxxxxxxxxxx> wrote:
>>>
>>> Is there any way I can modify what gets saved in 'recently-used.xbel'?  For example, if I DIDN'T want it to include files with a particular extension, does the existing code provide any mechanism for achieving that?
>>>
>>> Or alternatively...  if I ONLY wanted it to include files with certain extension(s) can I specify that somehow in my application? Thanks.

I honestly don't really understand what are you trying to achieve. do
you want to add files, or is it just an issue of displayed files?

the file chooser widget will add the currently selected file to the
list of recently used files automatically. an argument could be made
for having this behind as a setting, but playing games with the
GtkRecentManager API does not really strike me as a viable, long term
solution. after all, anything can add that file to the list of
recently used files.

the file chooser widget should also use the currently selected filter
when displaying the recently used files, so if you want to display a
certain file type or extension, you should use the facilities offered
by the file chooser API.

>> There's no direct api to achieve this. You can probably get it done in
>> a few lines of code with GtkRecentManager::changed and
>> gtk_recent_manager_remove_item().
>
> Thanks Matthias,
>
> Somewhere in my app I'm guessing that I'd need to provide a handler (callback) function to get called whenever the 'changed' signal gets emitted.  Do you know of an example anywhere that I could study?  From looking at the API list for GtkRecentManager it's not obvious how I'd set up the callback function.  Thanks,

a GtkRecentManager is a GObject; you just connect to the changed
signal, like you would on any other GObject instance.

ciao,
 Emmanuele.


-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-devel-list