IIRC recent-files doesn't update until the app exits; this is way too late. We should instead expose and model the GtkRecent object and update as/when we get a signal to do so, my old (2008) note says:
+ it only updates the recent-files on application exit
+ I believe it's only write-only, ie. if you open an XLS in gnumeric, it
will be in Panel->System->Recent Files, but it will not be available
in File->Recent Documents in OO.o
I guess with the new recent-files code in gtk+ we should be able to listen to
"changed" on the gtkrecent object - and get nice live updates here.
The code to hack is: sfx2/source/appl/sfxpicklist.cxx and
shell/source/unix/sysshell/systemshell.cxx - we need a new API to fetch the
picklist and use that instead of SvtHistoryOptions.GetList - I imagine.
Hopefully this is not impossibly hard.
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.
see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Removing comma from whiteboard (please use a space to delimit values in this field)
Michael: I noticed that AddDocumentToPickList was called at the opening + closing of the document.
406 case SFX_EVENT_OPENDOC:
412 case SFX_EVENT_SAVEDOCDONE:
413 case SFX_EVENT_SAVEASDOCDONE:
414 case SFX_EVENT_SAVETODOCDONE:
415 case SFX_EVENT_CLOSEDOC:
421 case SFX_EVENT_SAVEASDOC:
... 434 AddDocumentToPickList(pDocSh);
Moreover, shell/source/unix/sysshell/systemshell.cxx is nowhere to be seen (at least in master sources).
Sure - so we do a call there that in AddDocumentToPickList does:
if ( aURL.GetProtocol() == INET_PROT_FILE )
Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ),
(pFilter) ? pFilter->GetMimeType() : OUString(),
(pFilter) ? pFilter->GetServiceName() : OUString() );
Which (AFAICS) should not really be filtering out only file URLs (at least here) but ... that ends up here:
GtkRecentManager *manager = gtk_recent_manager_get_default ();
gtk_recent_manager_add_item (manager, sGtkURL.getStr());
And (I guess) it is entirely possible that this now works properly =)
I believe the file-selector in other apps uses this, as that now synchronizes without exiting libreoffice, we can close this guy =)
Thanks for the poke.
Thank you Michael for your feedback.
Side question: I'm just wondering if we could/should remove SFX_EVENT_CLOSEDOC since I can't imagine a use case that will need it.
It would allow us to save 1 call to AddDocumentToPickList.
As you like =) it does little harm performance-wise I suspect.
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyInteresting SkillCpp TopicCleanup)
Remove LibreOffice Dev List from CC on EasyHacks
(curtailing excessive email to list)