After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 524219 - add bulk addition to GtkRecentManager API
add bulk addition to GtkRecentManager API
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Class: GtkRecent
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
Emmanuele Bassi (:ebassi)
Depends on: 50606
Blocks: 528035
 
 
Reported: 2008-03-24 22:24 UTC by Emmanuele Bassi (:ebassi)
Modified: 2014-12-22 22:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Add gtk_recent_manager_add_fullv() (10.00 KB, patch)
2008-03-25 11:22 UTC, Emmanuele Bassi (:ebassi)
needs-work Details | Review

Description Emmanuele Bassi (:ebassi) 2008-03-24 22:24:12 UTC
sometimes adding multiple URIs in one go is preferable than having multiple additions inside an idle handler.

a vector based variant of gtk_recent_manager_add()/add_full() would solve this particular issue.

API proposal:

  void
  gtk_recent_manager_addv (GtkRecentManager    *recent_manager,
                           gint                 n_uris,
                           const gchar * const  uris[]);

  void
  gtk_recent_manager_add_fullv (GtkRecentManager     *recent_manager,
                                gint                  n_uris,
                                const gchar * const   uris[],
                                GtkRecentData       **data);

the implementation would iterate over the passed uri list and emit the ::changed signal at the end of the changes (causing the updates to be written to disk).
Comment 1 Emmanuele Bassi (:ebassi) 2008-03-25 11:02:02 UTC
the add_itemv() variant should take into account the asynchronous query performed by the GIO porting in bug 506062.

the add_fullv() variant is straightforward, and will attach it shortly.
Comment 2 Emmanuele Bassi (:ebassi) 2008-03-25 11:22:25 UTC
Created attachment 107984 [details] [review]
[PATCH] Add gtk_recent_manager_add_fullv()

this patch adds the gtk_recent_manager_add_fullv() function, which can be used to add multiple items to the GtkRecentManager with a single change notification.

this function is useful for applications adding many items in a single pass (e.g. when closing).

 gtkrecentmanager.c |  250 ++++++++++++++++++++++++++++++++++-------------------
 gtkrecentmanager.h |    4 
 2 files changed, 165 insertions(+), 89 deletions(-)
Comment 3 Matthias Clasen 2014-12-22 22:22:25 UTC
After all these years, it is perhaps not worth doing anymore