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 768659 - gtk/gtkfilechoosernativeportal.c: Don't use g_autoptr()
gtk/gtkfilechoosernativeportal.c: Don't use g_autoptr()
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
Other Windows
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Reported: 2016-07-11 09:54 UTC by Fan, Chun-wei
Modified: 2017-04-04 16:22 UTC
See Also:
GNOME target: ---
GNOME version: ---

gtk/gtkfilechoosernativeportal.c: Don't use g_autoptr() (1.29 KB, patch)
2016-07-11 09:55 UTC, Fan, Chun-wei
committed Details | Review
gtk: Build portal items only on *NIX (3.89 KB, patch)
2016-07-11 15:12 UTC, Fan, Chun-wei
none Details | Review

Description Fan, Chun-wei 2016-07-11 09:54:18 UTC

Lately there has been works to use xdg-desktop-portal/flatpak in the various parts of GTK, where an oversight crept into the code due to the use of g_autoptr() that is available to GCC and CLang.  I will post a patch to address this.

With blessings, thank you!
Comment 1 Fan, Chun-wei 2016-07-11 09:55:58 UTC
Created attachment 331198 [details] [review]
gtk/gtkfilechoosernativeportal.c: Don't use g_autoptr()


Here's the patch.

With blessings, thank you!
Comment 2 Emmanuele Bassi (:ebassi) 2016-07-11 09:58:05 UTC
Since the portal file chooser is not supposed to be used on platforms without flatpak/portal, I think it would be better to not build it at all on those platforms.
Comment 3 Matthias Clasen 2016-07-11 14:50:51 UTC
Review of attachment 331198 [details] [review]:

While it is true that the portal code is only targeting Unix, the autoptr was still an oversight, didn't mean to start sneak those into gtk through the backdoor.
Comment 4 Fan, Chun-wei 2016-07-11 15:12:14 UTC
Created attachment 331231 [details] [review]
gtk: Build portal items only on *NIX

Hi Matthias/Emmanuele,

Thanks, but I thought it might be better to have a new patch to build the portal stuff only on *NIX, in addition to getting rid of the g_autoptr() usage, which is incorporated in this patch.

With blessings, thank you!
Comment 5 Matthias Clasen 2016-07-13 02:49:20 UTC
Not sure I like unnecessary ifdefs cluttering up the code - if it builds on win32 and does no harm, can't we just leave it as is ?
Comment 6 Fan, Chun-wei 2016-07-13 03:29:00 UTC
Comment on attachment 331198 [details] [review]
gtk/gtkfilechoosernativeportal.c: Don't use g_autoptr()


Since the initial intent of this is to fix the build on non-GCC/CLang, I thought I would push the first patch[1], as it was ack'ed.  Please let me know if excluding the portal items here is still the preferred way to go, as that would involve the #ifdef's, as in the second patch.  I will keep the bug open for now.

[1]: Attachment 331198 [details] was pushed as d8815f3.

With blessings, thank you!
Comment 7 Timm Bäder 2017-04-01 06:45:33 UTC
So this is fixed?
Comment 8 Fan, Chun-wei 2017-04-04 16:22:27 UTC
Hi Timm,

Since the consensus is to leave the portal items as-is, so I think we can close this as fixed.  Sorry for not updating this!

With blessings, and cheers!