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 616044 - [annotation] Scope type for progress callbacks of async gio method
[annotation] Scope type for progress callbacks of async gio method
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: g-ir-scanner
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
: 708297 (view as bug list)
Depends on:
Blocks: 625942
 
 
Reported: 2010-04-17 19:16 UTC by Torsten Schoenfeld
Modified: 2018-02-08 11:52 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Torsten Schoenfeld 2010-04-17 19:16:44 UTC
g_file_copy_async takes a GFileProgressCallback which is called it zero or more times after g_file_copy_async has returned.  (It's not called at all if some error occurred.)  I don't think any of the existing scope types describes this behavior.

(In fact, I don't see how a binding can wrap this correctly at all.  How do you know when the GFileProgressCallback will not be called anymore?  Maybe when g_file_copy_finish returns.)
Comment 1 Dan Winship 2010-04-26 20:11:22 UTC
(In reply to comment #0)
> (In fact, I don't see how a binding can wrap this correctly at all.  How do you
> know when the GFileProgressCallback will not be called anymore?  Maybe when
> g_file_copy_finish returns.)

yes

perhaps this could be something like:

 * @progress_callback: (scope async=done_callback): function to callback
 *   with progress information
 * @progress_callback_data: user data to pass to @progress_callback
 * @done_callback: a #GAsyncReadyCallback to call when the request is
 *   satisfied
 * @user_data: user data to pass to @done_callback

where the annotation would mean "@progress_callback can be called until @done_callback has been called"

This is a pretty uncommon case though, and it might be better to just add a new version with a progress_callback_destroy_notify arg, and Rename it over the existing version. (That might also be a bit of a torture test for bindings too though... having a destroy-notified callback and an async callback in the same call.)
Comment 2 Colin Walters 2010-04-26 20:44:42 UTC
Note at least gjs won't handle two callbacks for one function now.  It could be made to do so but...
Comment 3 Simon Feltman 2014-05-04 21:57:51 UTC
*** Bug 708297 has been marked as a duplicate of this bug. ***
Comment 4 André Klapper 2015-02-07 17:17:44 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 5 GNOME Infrastructure Team 2018-02-08 11:52:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/25.