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 788174 - Use g_auto*
Use g_auto*
Status: RESOLVED OBSOLETE
Product: gnome-photos
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on: 763712 764423 789970 790237 790925 793367
Blocks:
 
 
Reported: 2017-09-26 09:57 UTC by Debarshi Ray
Modified: 2018-02-12 12:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
done-notification: Use g_auto* (1.12 KB, patch)
2017-10-08 06:07 UTC, Umang Jain
committed Details | Review
delete-notification: Use g_auto* (1.26 KB, patch)
2017-10-08 06:15 UTC, Umang Jain
committed Details | Review
source-notification: Use g_auto* (2.39 KB, patch)
2017-10-08 06:17 UTC, Umang Jain
none Details | Review
indexing-notification: Use g_auto* (1.07 KB, patch)
2017-10-08 06:17 UTC, Umang Jain
none Details | Review
print-notification: Use g_auto* (1.17 KB, patch)
2017-10-08 06:17 UTC, Umang Jain
committed Details | Review
share-notification: Use g_auto* (1.11 KB, patch)
2017-10-08 06:20 UTC, Umang Jain
none Details | Review
image-view: Use g_auto* (2.90 KB, patch)
2017-10-08 07:14 UTC, Umang Jain
none Details | Review
source-notification: Use g_auto* (2.39 KB, patch)
2017-10-08 07:16 UTC, Umang Jain
none Details | Review
main-toolbar: Use g_auto* (3.44 KB, patch)
2017-10-08 07:36 UTC, Umang Jain
committed Details | Review
source-notification: Use g_auto* (2.42 KB, patch)
2017-10-08 12:37 UTC, Umang Jain
none Details | Review
export-dialog: Use g_auto* (4.01 KB, patch)
2017-10-08 18:21 UTC, Umang Jain
none Details | Review
indexing-notification: Use g_auto* (1.59 KB, patch)
2017-10-08 18:56 UTC, Umang Jain
none Details | Review
source-notification: Use g_auto* (2.49 KB, patch)
2017-10-08 18:58 UTC, Umang Jain
none Details | Review
properties-dialog: Use g_auto* (9.57 KB, patch)
2017-10-09 15:05 UTC, Ekta Nandwani
none Details | Review
facebook-item: Use g_auto* (4.14 KB, patch)
2017-10-10 16:11 UTC, Ekta Nandwani
none Details | Review
base-model: Use g_auto* (2.30 KB, patch)
2017-10-14 13:01 UTC, Ekta Nandwani
committed Details | Review
empty-results-box: Use g_auto* (2.98 KB, patch)
2017-10-15 11:49 UTC, Ekta Nandwani
none Details | Review
error-box: Use g_auto* (1.08 KB, patch)
2017-10-15 11:57 UTC, Ekta Nandwani
committed Details | Review
media-server-item: Use g_auto* (2.79 KB, patch)
2017-10-15 12:33 UTC, Ekta Nandwani
committed Details | Review
base-model: Use g_auto* (2.38 KB, patch)
2017-10-24 18:02 UTC, Debarshi Ray
committed Details | Review
error-box: Use g_auto* (1.14 KB, patch)
2017-10-24 18:22 UTC, Debarshi Ray
committed Details | Review
properties-dialog: Use g_auto* (9.38 KB, patch)
2017-11-04 19:20 UTC, Ekta Nandwani
none Details | Review
properties-dialog: Use g_auto* (12.97 KB, patch)
2017-11-06 15:29 UTC, Debarshi Ray
committed Details | Review
export-dialog: Use g_auto* (4.65 KB, patch)
2017-11-06 15:30 UTC, Debarshi Ray
committed Details | Review
main-toolbar: Use g_auto* (5.27 KB, patch)
2017-11-06 16:43 UTC, Debarshi Ray
committed Details | Review
share-notification: Use g_auto* (1.12 KB, patch)
2017-11-11 05:49 UTC, Umang Jain
none Details | Review
source-notification: Use g_auto* (3.44 KB, patch)
2017-11-11 05:49 UTC, Umang Jain
committed Details | Review
image-view: Use g_auto* (2.92 KB, patch)
2017-11-11 05:50 UTC, Umang Jain
none Details | Review
indexing-notification: Use g_auto* (2.12 KB, patch)
2017-11-11 05:52 UTC, Umang Jain
committed Details | Review
facebook-item: Use g_auto* (4.47 KB, patch)
2017-11-11 18:05 UTC, Ekta Nandwani
none Details | Review
empty-results-box: Use g_auto* (4.17 KB, patch)
2017-11-12 14:26 UTC, Ekta Nandwani
committed Details | Review
share-notification: Use g_auto* (2.55 KB, patch)
2017-11-13 17:25 UTC, Debarshi Ray
committed Details | Review
empty-results-box: Use g_auto* (4.19 KB, patch)
2017-11-13 17:35 UTC, Debarshi Ray
committed Details | Review
image-view: use g_auto* (2.10 KB, patch)
2017-11-14 05:37 UTC, Umang Jain
committed Details | Review
facebook-item: Use g_auto* (4.38 KB, patch)
2017-11-15 02:03 UTC, Ekta Nandwani
committed Details | Review
zoom-controls: Use g_auto* (994 bytes, patch)
2017-11-15 02:09 UTC, Ekta Nandwani
committed Details | Review
facebook-item: Use g_auto* (4.47 KB, patch)
2017-11-21 12:03 UTC, Debarshi Ray
committed Details | Review
zoom-controls: Use g_auto* (1.07 KB, patch)
2017-11-21 12:09 UTC, Debarshi Ray
committed Details | Review
media-server-item: Use g_auto* (2.70 KB, patch)
2017-11-21 12:19 UTC, Debarshi Ray
committed Details | Review
overview-searchbar: Use g_auto* (1.03 KB, patch)
2017-11-26 20:17 UTC, Umang Jain
committed Details | Review
query-builder: Use g_auto* (11.20 KB, patch)
2017-11-26 20:18 UTC, Umang Jain
committed Details | Review
gesture-zoom: Use g_auto* (1.02 KB, patch)
2017-11-28 04:30 UTC, Umang Jain
committed Details | Review
query-builder: Use g_auto* (11.21 KB, patch)
2017-11-28 07:50 UTC, Debarshi Ray
committed Details | Review
local-item: Use g_auto* (7.60 KB, patch)
2017-11-28 17:52 UTC, Umang Jain
none Details | Review
gegl: Use g_auto* (3.76 KB, patch)
2017-11-29 18:39 UTC, Umang Jain
committed Details | Review
base-item: Use g_auto* (1/3) (20.38 KB, patch)
2017-12-02 19:06 UTC, Umang Jain
committed Details | Review
base-item: Use g_auto* (2/3) (23.66 KB, patch)
2017-12-02 19:07 UTC, Umang Jain
committed Details | Review
base-item: Use g_auto* (3/3) (12.21 KB, patch)
2017-12-02 19:08 UTC, Umang Jain
committed Details | Review
edit-palette-row: Use g_auto* (1.03 KB, patch)
2017-12-03 05:57 UTC, Umang Jain
committed Details | Review
edit-palette: Use g_auto* (1.66 KB, patch)
2017-12-03 06:06 UTC, Umang Jain
committed Details | Review
remote-display-manager: Use g_auto* (2.79 KB, patch)
2017-12-03 06:23 UTC, Umang Jain
committed Details | Review
print-operation: Use g_auto* (2.98 KB, patch)
2017-12-03 06:51 UTC, Umang Jain
committed Details | Review
update-mime-job: Use g_auto* (1.08 KB, patch)
2017-12-03 09:00 UTC, Umang Jain
committed Details | Review
utils: Use g_auto* (1/2) (11.24 KB, patch)
2017-12-03 09:02 UTC, Umang Jain
committed Details | Review
utils: Use g_auto* (2/2) (8.07 KB, patch)
2017-12-03 09:02 UTC, Umang Jain
none Details | Review
local-item: Use g_auto* (9.72 KB, patch)
2017-12-03 14:38 UTC, Debarshi Ray
committed Details | Review
tool-filter-button: Use g_auto* (1.28 KB, patch)
2017-12-03 16:47 UTC, Umang Jain
committed Details | Review
photos-glib: Use g_auto* (2.92 KB, patch)
2017-12-03 17:16 UTC, Umang Jain
committed Details | Review
main: Use g_auto* (1.15 KB, patch)
2017-12-04 03:29 UTC, Umang Jain
none Details | Review
pixbuf: Use g_auto* (1.68 KB, patch)
2017-12-04 11:04 UTC, Umang Jain
committed Details | Review
flickr-item: Use g_auto* (4.89 KB, patch)
2017-12-04 11:30 UTC, Umang Jain
none Details | Review
header-bar: Use g_auto* (981 bytes, patch)
2017-12-04 12:33 UTC, Umang Jain
committed Details | Review
base-item: Use g_auto* (1/3) (20.47 KB, patch)
2017-12-04 15:05 UTC, Debarshi Ray
committed Details | Review
base-item: Use g_auto* (2/3) (23.75 KB, patch)
2017-12-04 21:35 UTC, Debarshi Ray
committed Details | Review
thumbnail-factory: Use g_auto* (7.13 KB, patch)
2017-12-05 06:50 UTC, Umang Jain
none Details | Review
searchbar: Use g_auto* (936 bytes, patch)
2017-12-05 07:03 UTC, Umang Jain
committed Details | Review
remote-display-manager: Use g_auto* (2.78 KB, patch)
2017-12-05 10:18 UTC, Debarshi Ray
committed Details | Review
fetch-ids-job: Use g_auto* (3.00 KB, patch)
2017-12-06 11:08 UTC, Umang Jain
none Details | Review
glib: Use g_auto* with custom closures (1.77 KB, patch)
2017-12-07 10:34 UTC, Debarshi Ray
committed Details | Review
tracker-change-monitor: Use g_auto* (3.42 KB, patch)
2017-12-08 05:03 UTC, Umang Jain
none Details | Review
base-item: Use g_auto* (3/3) (12.28 KB, patch)
2017-12-13 12:01 UTC, Debarshi Ray
committed Details | Review
tool-filter-button: Use g_auto* (1.46 KB, patch)
2017-12-13 12:28 UTC, Debarshi Ray
committed Details | Review
utils: Use g_auto* (1/2) (12.13 KB, patch)
2017-12-13 14:59 UTC, Debarshi Ray
committed Details | Review
main: Use g_auto* (1.96 KB, patch)
2017-12-20 08:20 UTC, Umang Jain
committed Details | Review
utils: Use g_auto* (2/2) (7.48 KB, patch)
2017-12-20 09:43 UTC, Umang Jain
none Details | Review
utils: Use g_auto* (2/2) (7.48 KB, patch)
2017-12-20 09:49 UTC, Umang Jain
none Details | Review
utils: Use g_auto* (2/2) (7.48 KB, patch)
2017-12-20 09:52 UTC, Umang Jain
committed Details | Review
fetch-ids-job: Use g_auto* (2.79 KB, patch)
2017-12-20 10:29 UTC, Umang Jain
committed Details | Review
thumbnail-factory: Use g_auto* (7.14 KB, patch)
2017-12-20 11:44 UTC, Umang Jain
committed Details | Review
tracker-change-monitor: Use g_auto* (3.18 KB, patch)
2017-12-20 11:59 UTC, Umang Jain
committed Details | Review
flickr-item: Use g_auto* (4.97 KB, patch)
2017-12-20 12:05 UTC, Umang Jain
committed Details | Review
fetch-ids-job: Use g_auto* (2.80 KB, patch)
2018-01-01 13:08 UTC, Debarshi Ray
committed Details | Review
thumbnail-factory: Use g_auto* (9.48 KB, patch)
2018-01-01 13:54 UTC, Debarshi Ray
committed Details | Review
flickr-item: Use g_auto* (5.42 KB, patch)
2018-01-02 08:23 UTC, Debarshi Ray
committed Details | Review
source-manager: Use g_auto* (6.33 KB, patch)
2018-01-11 18:45 UTC, Debarshi Ray
committed Details | Review
build: Generate autocleanup definitions for GDBus interfaces (3.81 KB, patch)
2018-01-16 17:27 UTC, Debarshi Ray
committed Details | Review
application: Use g_auto* (22.06 KB, patch)
2018-01-20 18:38 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2017-09-26 09:57:01 UTC
We should use g_auto* instead of manually freeing resources:
https://developer.gnome.org/glib/stable/glib-Miscellaneous-Macros.html#g-auto

Please don't put more than a single class in a single patch. It might be better to split bigger classes into multiple patches, but not more than one class per patch. Use your judgement.
Comment 1 Umang Jain 2017-10-08 06:07:22 UTC
Created attachment 361114 [details] [review]
done-notification: Use g_auto*
Comment 2 Umang Jain 2017-10-08 06:15:33 UTC
Created attachment 361115 [details] [review]
delete-notification: Use g_auto*
Comment 3 Umang Jain 2017-10-08 06:17:03 UTC
Created attachment 361116 [details] [review]
source-notification: Use g_auto*
Comment 4 Umang Jain 2017-10-08 06:17:27 UTC
Created attachment 361117 [details] [review]
indexing-notification: Use g_auto*
Comment 5 Umang Jain 2017-10-08 06:17:57 UTC
Created attachment 361118 [details] [review]
print-notification: Use g_auto*
Comment 6 Umang Jain 2017-10-08 06:20:34 UTC
Created attachment 361119 [details] [review]
share-notification: Use g_auto*
Comment 7 Umang Jain 2017-10-08 07:14:29 UTC
Created attachment 361120 [details] [review]
image-view: Use g_auto*
Comment 8 Umang Jain 2017-10-08 07:16:10 UTC
Created attachment 361122 [details] [review]
source-notification: Use g_auto*
Comment 9 Umang Jain 2017-10-08 07:36:34 UTC
Created attachment 361123 [details] [review]
main-toolbar: Use g_auto*
Comment 10 Alessandro Bono 2017-10-08 11:44:25 UTC
Review of attachment 361122 [details] [review]:

::: src/photos-source-notification.c
@@ -87,3 @@
       g_warning ("Unable to launch gnome-control-center: %s", error->message);
       g_error_free (error);
-      goto out;

You have to replace `goto out;` with `return;` if you want to maintain same control flow.

@@ -106,3 @@
       g_warning ("Unable to launch gnome-control-center: %s", error->message);
       g_error_free (error);
-      goto out;

Here it is not strictly necessary, but I would add a `return;` anyway.
Comment 11 Umang Jain 2017-10-08 12:31:31 UTC
> You have to replace `goto out;` with `return;` if you want to maintain same
> control flow.

Hey thanks. I missed to notice that. I'll quickly update the patch.
> 
> @@ -106,3 @@
>        g_warning ("Unable to launch gnome-control-center: %s",
> error->message);
>        g_error_free (error);
> -      goto out;
> 
> Here it is not strictly necessary, but I would add a `return;` anyway.
Comment 12 Umang Jain 2017-10-08 12:37:00 UTC
Created attachment 361129 [details] [review]
source-notification: Use g_auto*
Comment 13 Umang Jain 2017-10-08 18:21:45 UTC
Created attachment 361146 [details] [review]
export-dialog: Use g_auto*
Comment 14 Umang Jain 2017-10-08 18:56:37 UTC
Created attachment 361148 [details] [review]
indexing-notification: Use g_auto*
Comment 15 Umang Jain 2017-10-08 18:58:30 UTC
Created attachment 361149 [details] [review]
source-notification: Use g_auto*
Comment 16 Ekta Nandwani 2017-10-09 15:05:04 UTC
Created attachment 361193 [details] [review]
properties-dialog: Use g_auto*
Comment 17 Ekta Nandwani 2017-10-10 16:11:27 UTC
Created attachment 361254 [details] [review]
facebook-item: Use g_auto*
Comment 18 Ekta Nandwani 2017-10-14 13:01:09 UTC
Created attachment 361582 [details] [review]
base-model: Use g_auto*
Comment 19 Ekta Nandwani 2017-10-15 11:49:56 UTC
Created attachment 361612 [details] [review]
empty-results-box: Use g_auto*
Comment 20 Ekta Nandwani 2017-10-15 11:57:26 UTC
Created attachment 361614 [details] [review]
error-box: Use g_auto*
Comment 21 Ekta Nandwani 2017-10-15 12:33:59 UTC
Created attachment 361618 [details] [review]
media-server-item: Use g_auto*
Comment 22 Debarshi Ray 2017-10-24 17:46:30 UTC
Review of attachment 361114 [details] [review]:

Perfect. Thanks for the patch.
Comment 23 Debarshi Ray 2017-10-24 17:48:25 UTC
Review of attachment 361115 [details] [review]:

++
Comment 24 Debarshi Ray 2017-10-24 17:59:08 UTC
Review of attachment 361582 [details] [review]:

Thanks for the patches, Ekta! One minor issue:

::: src/photos-base-model.c
@@ +79,3 @@
 photos_base_model_refresh (PhotosBaseModel *self)
 {
+  g_autoptr (GMenu) section;

We should initialize these to NULL.

I have seen GCC warning about the lack of initializers. Not sure why it's not warning during the build here. Could be due to a missing flag or something.

@@ +97,3 @@
     {
+      g_autoptr (GMenuItem) menu_item;
+      g_autoptr (GObject) object;

Ditto.
Comment 25 Debarshi Ray 2017-10-24 18:02:18 UTC
Created attachment 362209 [details] [review]
base-model: Use g_auto*

Fixed and pushed.
Comment 26 Debarshi Ray 2017-10-24 18:06:43 UTC
Review of attachment 361118 [details] [review]:

++
Comment 27 Debarshi Ray 2017-10-24 18:15:50 UTC
Review of attachment 361193 [details] [review]:

::: src/photos-properties-dialog.c
@@ +97,3 @@
   PhotosPropertiesDialog *self;
+  g_autoptr (GError) error;
+  g_autofree gchar *camera;

We should initialize them to NULL.

@@ +128,3 @@
 {
   PhotosPropertiesDialog *self;
+  g_autoptr (GError) error;

Ditto.

@@ -146,3 @@
         g_warning ("Unable to resolve latitude and longitude: %s", error->message);
-      g_error_free (error);
-      goto out;

I'd still like to retain the 'out' labels because they ensure that there's only one return site. Having a single return site is nice because (a) it helps when debugging, (b) we can add g_return_* assertions to enforce post-conditions.

@@ -163,3 @@
- out:
-  g_clear_object (&place);
-  g_free (location_str);

out:
  return; /* in case it warns about an empty label */
Comment 28 Debarshi Ray 2017-10-24 18:19:14 UTC
Review of attachment 361614 [details] [review]:

::: src/photos-error-box.c
@@ +105,3 @@
 photos_error_box_update (PhotosErrorBox *self, const gchar *primary, const gchar *secondary)
 {
+  g_autofree gchar *markup;

This should be moved inside the braces below.

@@ -116,3 @@
   if (secondary != NULL)
     {
       markup = g_markup_escape_text (secondary, -1);

Otherwise, if both primary and secondary are non-NULL, we'd be leaking the previous chunk of memory here.
Comment 29 Debarshi Ray 2017-10-24 18:22:24 UTC
Created attachment 362211 [details] [review]
error-box: Use g_auto*

Fixed and pushed.
Comment 30 Debarshi Ray 2017-10-24 18:24:31 UTC
I went through some of the patches. It would be nice if you could double-check the remaining ones and update them as per the above comments.

Thanks for your contributions. Excited to see g_auto* adoption.
Comment 31 Ekta Nandwani 2017-11-04 19:20:43 UTC
Created attachment 362991 [details] [review]
properties-dialog: Use g_auto*
Comment 32 Debarshi Ray 2017-11-06 15:28:44 UTC
Review of attachment 362991 [details] [review]:

Thanks for the patch, Ekta. Some comments below:

::: src/photos-properties-dialog.c
@@ +96,3 @@
 {
   PhotosPropertiesDialog *self;
+  g_autoptr (GError) error = NULL;

For GErrors, it would be nice to tie them more tightly to the error sites. We can do so by using a pair of braces to narrow down the scope of the fallible call. That would address the following two issues with GError handling:
  (a) Forgetting to NULLify the GError before using it.
  (b) Leaking the GError.

@@ +127,3 @@
 {
   PhotosPropertiesDialog *self;
+  g_autoptr (GError) error = NULL;

Ditto.

@@ +214,3 @@
   PhotosPropertiesDialog *self = PHOTOS_PROPERTIES_DIALOG (user_data);
   TrackerSparqlConnection *connection = TRACKER_SPARQL_CONNECTION (source_object);
   TrackerSparqlCursor *cursor = NULL;

Cases like these where an external library doesn't have autocleanup definitions should be marked with a TODO and a bug filed. That will make it easier to mop them up later.

@@ +348,3 @@
   PhotosPropertiesDialog *self = PHOTOS_PROPERTIES_DIALOG (object);
   GApplication *app;
   GDateTime *date_modified;

g_autoptr (...) date_modified = NULL;

@@ +377,3 @@
   const gchar *type_description;
+  g_autofree gchar *date_created_str = NULL;
+  g_autofree gchar *date_modified_str;

Missing NULL initialization.

@@ +648,3 @@
     {
       GtkWidget *dims_data;
+      g_autofree gchar *dims_str;

Ditto.
Comment 33 Debarshi Ray 2017-11-06 15:29:35 UTC
Created attachment 363060 [details] [review]
properties-dialog: Use g_auto*

Fixed and pushed.
Comment 34 Debarshi Ray 2017-11-06 15:30:42 UTC
Created attachment 363061 [details] [review]
export-dialog: Use g_auto*
Comment 35 Debarshi Ray 2017-11-06 15:31:42 UTC
Review of attachment 361119 [details] [review]:

::: src/photos-share-notification.c
@@ +97,3 @@
   GtkWidget *image;
   GtkWidget *label;
+  g_autofree gchar *msg;

Should be NULL initialized. See comment 24.
Comment 36 Debarshi Ray 2017-11-06 15:32:52 UTC
Review of attachment 361120 [details] [review]:

::: src/photos-image-view.c
@@ +119,3 @@
 {
   const Babl *format;
+  g_autoptr (GeglBuffer) buffer;

Should be NULL initialized. See comment 24.

@@ +307,3 @@
         {
           GdkFrameClock *frame_clock;
+          g_autoptr (PhotosImageViewHelper) helper;

Ditto.

@@ +1052,3 @@
     {
       GdkFrameClock *frame_clock;
+      g_autoptr (PhotosImageViewHelper) helper;

Ditto.
Comment 37 Debarshi Ray 2017-11-06 15:36:35 UTC
Review of attachment 361254 [details] [review]:

::: src/photos-facebook-item.c
@@ +82,3 @@
 {
   PhotosFacebookItem *self = PHOTOS_FACEBOOK_ITEM (item);
+  g_autoptr (GDateTime) date_modified;

Should be NULL initialized. See comment 24.

@@ +135,1 @@
   GFBGraphPhoto *photo = NULL;

Should be marked with a TODO, and a bug filed against gfbgraph that blocks this one. Just like we did for tracker/TrackerSparqlCursor. See comment 32.

@@ +192,1 @@
   GFBGraphPhoto *photo = NULL;

Ditto.

@@ +263,3 @@
 photos_facebook_item_open (PhotosBaseItem *item, GtkWindow *parent, guint32 timestamp)
 {
+  g_autoptr (GError) error;

Would be nice to move the GError closer to the fallible call. See the committed patches for examples.
Comment 38 Debarshi Ray 2017-11-06 15:39:17 UTC
Comment on attachment 361146 [details] [review]
export-dialog: Use g_auto*

Oops! I failed to see that you had ported ExportDialog too, and I committed one separately. Sorry about this.
Comment 39 Debarshi Ray 2017-11-06 15:49:38 UTC
Review of attachment 361123 [details] [review]:

Grepping for g_object_unref yields one use of GtkBuilder that should be g_auto-fied. A few other comments:

::: src/photos-main-toolbar.c
@@ +91,1 @@
       label = NULL;

Nitpick: ideal use-case for g_steal_pointer. :)

@@ +194,3 @@
   PhotosDlnaRenderer *renderer;
   GtkLabel *label;
+  g_autofree gchar *text;

Should be NULL initialized.

@@ +313,3 @@
 {
   GMenu *menu;
+  g_autoptr (GtkBuilder) builder;

Ditto.

@@ +328,3 @@
         {
           GMenu *section;
+          g_autofree gchar *label;

Ditto.

@@ +360,3 @@
 {
   GtkWidget *image;
+  g_autofree gchar *favorite_label;

Ditto.
Comment 40 Debarshi Ray 2017-11-06 16:43:09 UTC
Created attachment 363065 [details] [review]
main-toolbar: Use g_auto*
Comment 41 Debarshi Ray 2017-11-06 16:45:21 UTC
Review of attachment 361148 [details] [review]:

::: src/photos-indexing-notification.c
@@ +237,3 @@
 {
   GApplication *app;
+  g_autoptr (GError) error;

Would be nice to move it closer to the fallible statement. See comment 32.
Comment 42 Debarshi Ray 2017-11-06 16:47:05 UTC
Review of attachment 361149 [details] [review]:

::: src/photos-source-notification.c
@@ +65,3 @@
 {
+  g_autoptr (GAppInfo) app = NULL;
+  g_autoptr (GError) error;

The GError should be moved closer to the fallible statement.

@@ -109,3 @@
     }
-
- out:

I'd still like to retain the 'out' labels because they ensure that there's only one return site. See comment 27.
Comment 43 Debarshi Ray 2017-11-06 16:50:11 UTC
Review of attachment 361612 [details] [review]:

::: src/photos-empty-results-box.c
@@ +58,3 @@
 {
+  g_autoptr (GAppInfo) app = NULL;
+  g_autoptr (GError) error;

The GError should be moved closer to the fallible statement. See comment 32.

@@ +75,3 @@
     {
       g_warning ("Unable to launch gnome-control-center: %s", error->message);
+      return ret_val;

Better to use 'goto out' since we already have it, and a single return site is a nice thing to have. See comment 27.

@@ +123,3 @@
   GtkWidget *details;
+  g_autofree gchar *details_str;
+  g_autofree gchar *system_settings_href;

Should be NULL initialized.

@@ +156,3 @@
   GtkWidget *image;
   GtkWidget *title_label;
+  g_autofree gchar *label;

Ditto.
Comment 44 Debarshi Ray 2017-11-06 16:51:32 UTC
Review of attachment 361618 [details] [review]:

::: src/photos-media-server-item.c
@@ +81,3 @@
 photos_media_server_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
 {
+  g_autoptr (GFile) file;

Should be NULL initialized.

@@ -156,3 @@
   local_path = NULL;
 
- out:

Would be good to keep the 'out' so that we have a single return site.
Comment 45 Umang Jain 2017-11-11 05:49:12 UTC
Created attachment 363386 [details] [review]
share-notification: Use g_auto*
Comment 46 Umang Jain 2017-11-11 05:49:39 UTC
Created attachment 363387 [details] [review]
source-notification: Use g_auto*
Comment 47 Umang Jain 2017-11-11 05:50:02 UTC
Created attachment 363388 [details] [review]
image-view: Use g_auto*
Comment 48 Umang Jain 2017-11-11 05:52:12 UTC
Created attachment 363389 [details] [review]
indexing-notification: Use g_auto*
Comment 49 Ekta Nandwani 2017-11-11 18:05:53 UTC
Created attachment 363397 [details] [review]
facebook-item: Use g_auto*
Comment 50 Ekta Nandwani 2017-11-12 14:26:59 UTC
Created attachment 363450 [details] [review]
empty-results-box: Use g_auto*
Comment 51 Debarshi Ray 2017-11-13 17:24:10 UTC
Review of attachment 363386 [details] [review]:

Thanks for the new set of patches, Umang.

Grepping for _free turns up a few more places that need g_auto*.
Comment 52 Debarshi Ray 2017-11-13 17:25:17 UTC
Created attachment 363520 [details] [review]
share-notification: Use g_auto*

I took the liberty to update the patch to cover all suitable g_auto* candidates.
Comment 53 Debarshi Ray 2017-11-13 17:35:01 UTC
Review of attachment 363450 [details] [review]:

Thanks for the new patches, Ekta. Looks good, except for a couple of nitpicks:

::: src/photos-empty-results-box.c
@@ +68,3 @@
+  {
+    g_autoptr (GError) error = NULL;
+    app = g_app_info_create_from_commandline ("gnome-control-center online-accounts",

Nitpick: missing newline after variable definition.

@@ +91,3 @@
+  {
+    g_autoptr (GError) error = NULL;
+    g_app_info_launch (app, NULL, G_APP_LAUNCH_CONTEXT (ctx), &error);

Nitpick: missing newline after variable definition.
Comment 54 Debarshi Ray 2017-11-13 17:35:44 UTC
Created attachment 363530 [details] [review]
empty-results-box: Use g_auto*

Fixed and pushed.
Comment 55 Debarshi Ray 2017-11-13 17:42:04 UTC
Review of attachment 363387 [details] [review]:

Perfect.
Comment 56 Debarshi Ray 2017-11-13 17:44:01 UTC
Review of attachment 363397 [details] [review]:

This conflicts with commit 9b72b3b20824f5fa. Would it be possible for you try and resolve it by rebasing on top of current master?
Comment 57 Debarshi Ray 2017-11-13 17:47:29 UTC
Review of attachment 363388 [details] [review]:

This conflicts with commit 150ae46fcc9b54c3. Would it be possible for you try and resolve it by rebasing on top of current master?
Comment 58 Debarshi Ray 2017-11-13 18:17:20 UTC
Review of attachment 363389 [details] [review]:

Looks good, thanks.
Comment 59 Umang Jain 2017-11-14 05:37:52 UTC
Created attachment 363553 [details] [review]
image-view: use g_auto*
Comment 60 Ekta Nandwani 2017-11-15 02:03:58 UTC
Created attachment 363647 [details] [review]
facebook-item: Use g_auto*
Comment 61 Ekta Nandwani 2017-11-15 02:09:31 UTC
Created attachment 363648 [details] [review]
zoom-controls: Use g_auto*
Comment 62 Debarshi Ray 2017-11-21 11:41:29 UTC
Review of attachment 363553 [details] [review]:

Thanks for rebasing it. Pushed.
Comment 63 Debarshi Ray 2017-11-21 12:02:16 UTC
Review of attachment 363647 [details] [review]:

Thanks for rebasing the patch!

::: src/photos-facebook-item.c
@@ +246,1 @@
   local_path = NULL;

We could slip in a g_steal_pointer here.

@@ +282,1 @@
     {

Nitpick: these braces can be removed.
Comment 64 Debarshi Ray 2017-11-21 12:03:11 UTC
Created attachment 364110 [details] [review]
facebook-item: Use g_auto*

Made the above changes and pushed.
Comment 65 Debarshi Ray 2017-11-21 12:09:12 UTC
Review of attachment 363648 [details] [review]:

::: src/photos-zoom-controls.c
@@ +153,3 @@
   GdkVisual *visual;
   GdkWindow *parent_window;
+  g_autoptr (GdkWindow) window;

Should be initialized to NULL.
Comment 66 Debarshi Ray 2017-11-21 12:09:59 UTC
Created attachment 364111 [details] [review]
zoom-controls: Use g_auto*
Comment 67 Debarshi Ray 2017-11-21 12:19:51 UTC
Created attachment 364113 [details] [review]
media-server-item: Use g_auto*
Comment 68 Umang Jain 2017-11-26 20:17:53 UTC
Created attachment 364447 [details] [review]
overview-searchbar: Use g_auto*
Comment 69 Umang Jain 2017-11-26 20:18:15 UTC
Created attachment 364448 [details] [review]
query-builder: Use g_auto*
Comment 70 Debarshi Ray 2017-11-27 17:57:26 UTC
Review of attachment 364447 [details] [review]:

Perfect, thanks.
Comment 71 Umang Jain 2017-11-28 04:30:35 UTC
Created attachment 364540 [details] [review]
gesture-zoom: Use g_auto*
Comment 72 Debarshi Ray 2017-11-28 07:49:24 UTC
Review of attachment 364448 [details] [review]:

::: src/photos-query-builder.c
@@ +391,3 @@
   const gchar *path;
+  g_autofree gchar *pictures_uri = NULL;
+  g_auto (GStrv) tracker_dirs;

Nice, but I'd still NULL initialize it because ultimately it will g_strfreev will be involved.
Comment 73 Debarshi Ray 2017-11-28 07:50:11 UTC
Created attachment 364543 [details] [review]
query-builder: Use g_auto*
Comment 74 Umang Jain 2017-11-28 17:52:08 UTC
Created attachment 364583 [details] [review]
local-item: Use g_auto*
Comment 75 Debarshi Ray 2017-11-28 20:49:00 UTC
Review of attachment 364540 [details] [review]:

++
Comment 76 Umang Jain 2017-11-29 18:39:39 UTC
Created attachment 364637 [details] [review]
gegl: Use g_auto*
Comment 77 Umang Jain 2017-12-02 19:06:21 UTC
Created attachment 364827 [details] [review]
base-item: Use g_auto* (1/3)
Comment 78 Umang Jain 2017-12-02 19:07:55 UTC
Created attachment 364828 [details] [review]
base-item: Use g_auto* (2/3)
Comment 79 Umang Jain 2017-12-02 19:08:15 UTC
Created attachment 364829 [details] [review]
base-item: Use g_auto* (3/3)
Comment 80 Umang Jain 2017-12-03 05:57:10 UTC
Created attachment 364841 [details] [review]
edit-palette-row: Use g_auto*
Comment 81 Umang Jain 2017-12-03 06:06:14 UTC
Created attachment 364842 [details] [review]
edit-palette: Use g_auto*
Comment 82 Umang Jain 2017-12-03 06:23:55 UTC
Created attachment 364843 [details] [review]
remote-display-manager: Use g_auto*
Comment 83 Umang Jain 2017-12-03 06:51:34 UTC
Created attachment 364844 [details] [review]
print-operation: Use g_auto*
Comment 84 Umang Jain 2017-12-03 09:00:12 UTC
Created attachment 364845 [details] [review]
update-mime-job: Use g_auto*
Comment 85 Umang Jain 2017-12-03 09:02:23 UTC
Created attachment 364846 [details] [review]
utils: Use g_auto* (1/2)
Comment 86 Umang Jain 2017-12-03 09:02:54 UTC
Created attachment 364847 [details] [review]
utils: Use g_auto* (2/2)
Comment 87 Debarshi Ray 2017-12-03 14:22:22 UTC
Review of attachment 364583 [details] [review]:

::: src/photos-local-item.c
@@ +221,3 @@
   const gchar *version_tag = "Xmp.gnome.photos-xmp-version";
+  g_autofree gchar *path = NULL;
+  g_autofree gchar *shared_string = NULL;

We should either split shared_string into shared_string_old and shared_string_new; or somehow limit it to a narrower scope. The current code replaces the string mid-way through the function, which can get confusing with g_autoptr.

Limiting symbols to a narrower scope is generally the better option.

@@ +277,3 @@
     }
 
   shared_variant = g_variant_builder_end (&builder);

The GVariantBuilder was getting leaked if we failed to parse the shared_string above. It's a pre-existing bug.

We can use g_auto with GVariantBuilder in this patch by limiting it to a narrower scope.
Comment 88 Debarshi Ray 2017-12-03 14:38:08 UTC
Created attachment 364855 [details] [review]
local-item: Use g_auto*

I tried to make the above changes, but this patch is sufficiently big that it would be nice if you could review it.
Comment 89 Debarshi Ray 2017-12-03 14:54:18 UTC
Review of attachment 364637 [details] [review]:

Thanks, Umang. Looks good to me.
Comment 90 Debarshi Ray 2017-12-03 15:00:58 UTC
Review of attachment 364841 [details] [review]:

++
Comment 91 Umang Jain 2017-12-03 16:47:55 UTC
Created attachment 364857 [details] [review]
tool-filter-button: Use g_auto*
Comment 92 Umang Jain 2017-12-03 17:16:56 UTC
Created attachment 364859 [details] [review]
photos-glib: Use g_auto*
Comment 93 Umang Jain 2017-12-04 03:29:35 UTC
Created attachment 364882 [details] [review]
main: Use g_auto*
Comment 94 Umang Jain 2017-12-04 11:04:42 UTC
Created attachment 364896 [details] [review]
pixbuf: Use g_auto*
Comment 95 Umang Jain 2017-12-04 11:30:19 UTC
Created attachment 364906 [details] [review]
flickr-item: Use g_auto*
Comment 96 Umang Jain 2017-12-04 12:33:38 UTC
Created attachment 364909 [details] [review]
header-bar: Use g_auto*
Comment 97 Debarshi Ray 2017-12-04 13:39:12 UTC
Review of attachment 364842 [details] [review]:

++
Comment 98 Debarshi Ray 2017-12-04 15:04:53 UTC
Review of attachment 364827 [details] [review]:

Thanks for splitting src/photos-base-item.c into multiple patches! Some minor details:

::: src/photos-base-item.c
@@ +424,1 @@
               g_object_unref (emblemed_pixbuf);

A few lines above, the GError can also be g_auto-fied.

@@ +607,3 @@
+  {
+    g_autoptr (GError) error = NULL;
+    if (priv->default_app != NULL)

I'd move the GError inside the if branch. The idea is to bind each GError as tightly as possible to the fallible function. That way it's easier to ensure that GErrors are not leaked or reused without being emptied.

@@ +613,3 @@
           g_warning ("Unable to show URI %s: %s", priv->uri, error->message);
+      }
+    else

Same thing here. A separate GError inside 'else'.

@@ +821,3 @@
+        if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+          {
+            goto out;

With g_auto* in place, we can simplify these branches by moving the code inside 'else' to the outer level, and not having a separate else branch.

Earlier, generally speaking, goto:s inside branches or loops were problematic, if the code inside the branch required its own clean-up. That's why we tried to keep things as linear as possible with separate if-else stanzas. That's no longer a problem.

@@ +876,3 @@
+        if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+	  {
+	    goto out;

Same thing here.

@@ +942,3 @@
+        if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+          {
+            goto out;

Ditto.

@@ +998,1 @@
           goto out;

Ditto.

@@ +1039,3 @@
+        if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+	  {
+	    goto out;

Ditto.
Comment 99 Debarshi Ray 2017-12-04 15:05:35 UTC
Created attachment 364919 [details] [review]
base-item: Use g_auto* (1/3)

Made the above changes and pushed to master.
Comment 100 Debarshi Ray 2017-12-04 15:10:48 UTC
Review of attachment 364844 [details] [review]:

++
Comment 101 Debarshi Ray 2017-12-04 21:02:04 UTC
Review of attachment 364828 [details] [review]:

Looks good, apart from:

::: src/photos-base-item.c
@@ -1504,3 @@
                              g_object_ref (task));
 
-  g_free (uri);

Nitpick: stray newline left behind.

@@ -1558,3 @@
                             g_object_ref (task));
 
-  g_object_unref (task);

Ditto.
Comment 102 Debarshi Ray 2017-12-04 21:35:02 UTC
Created attachment 364950 [details] [review]
base-item: Use g_auto* (2/3)
Comment 103 Umang Jain 2017-12-05 06:50:33 UTC
Created attachment 365001 [details] [review]
thumbnail-factory: Use g_auto*
Comment 104 Umang Jain 2017-12-05 07:03:36 UTC
Created attachment 365002 [details] [review]
searchbar: Use g_auto*
Comment 105 Debarshi Ray 2017-12-05 10:02:12 UTC
Review of attachment 364843 [details] [review]:

::: src/photos-remote-display-manager.c
@@ +173,3 @@
   Share *share = user_data;
   PhotosDlnaRenderer *renderer = PHOTOS_DLNA_RENDERER (source_object);
+  g_autoptr (PhotosBaseItem) item = NULL; /* We already hold a ref to the item to be shared */

I'd drop this comment. It made some sense with the g_object_unref call, but now the "already" doesn't sound right any more. :)

Plus, it's a bit obvious from the photos_dlna_renderer_share_finish_call.
Comment 106 Debarshi Ray 2017-12-05 10:16:46 UTC
Review of attachment 364859 [details] [review]:

++
Comment 107 Debarshi Ray 2017-12-05 10:18:10 UTC
Created attachment 365012 [details] [review]
remote-display-manager: Use g_auto*
Comment 108 Umang Jain 2017-12-06 11:08:37 UTC
Created attachment 365100 [details] [review]
fetch-ids-job: Use g_auto*
Comment 109 Debarshi Ray 2017-12-07 10:33:20 UTC
Review of attachment 364845 [details] [review]:

Perfect, thanks.
Comment 110 Debarshi Ray 2017-12-07 10:34:16 UTC
Created attachment 365185 [details] [review]
glib: Use g_auto* with custom closures
Comment 111 Umang Jain 2017-12-08 05:03:57 UTC
Created attachment 365225 [details] [review]
tracker-change-monitor: Use g_auto*
Comment 112 Debarshi Ray 2017-12-13 12:00:50 UTC
Review of attachment 364829 [details] [review]:

Thanks for the steady stream of patches. Some minor niggles:

::: src/photos-base-item.c
@@ +2757,3 @@
+  {
+    g_autoptr (GError) error = NULL;
+    node = photos_base_item_load_finish (self, res, &error);

Nitpick: missing newline.

@@ +2772,3 @@
+  {
+    g_autoptr (GError) error = NULL;
+    print_res = gtk_print_operation_run (print_op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, toplevel, &error);

Ditto.

@@ -3973,3 +3964,2 @@
                                         g_object_ref (task));
 
-  g_object_unref (task);

Nitpick: extra newline left behind.
Comment 113 Debarshi Ray 2017-12-13 12:01:36 UTC
Created attachment 365481 [details] [review]
base-item: Use g_auto* (3/3)
Comment 114 Debarshi Ray 2017-12-13 12:27:59 UTC
Review of attachment 364857 [details] [review]:

::: src/photos-tool-filter-button.c
@@ +112,3 @@
   GtkWidget *image;
   PhotosWidgetShader *shader;
   cairo_surface_t *preview_icon_surface = NULL;

We should add a TODO for cairo_surface_t.
Comment 115 Debarshi Ray 2017-12-13 12:28:47 UTC
Created attachment 365484 [details] [review]
tool-filter-button: Use g_auto*
Comment 116 Debarshi Ray 2017-12-13 14:58:13 UTC
Review of attachment 364846 [details] [review]:

::: src/photos-utils.c
@@ +223,2 @@
   cairo_surface_destroy (surface);
   cairo_destroy (cr);

We should mark these as TODO.

@@ +292,2 @@
   cairo_surface_t *icon_surface = NULL;
   cairo_surface_t *surface;

We should mark these as TODO.

@@ +851,3 @@
                               GError **error)
 {
   GFileAttributeMatcher *matcher = NULL;

Ditto, and the GEnumClass further above.
Comment 117 Debarshi Ray 2017-12-13 14:59:14 UTC
Created attachment 365493 [details] [review]
utils: Use g_auto* (1/2)
Comment 118 Debarshi Ray 2017-12-13 15:13:02 UTC
Review of attachment 364882 [details] [review]:

This is trickier than the rest:

::: src/photos-main.c
@@ -72,3 @@
   exit_status = g_application_run (app, argc, argv);
-  g_object_unref (remote_display_mngr);
-  g_object_unref (app);

We need to move most of main() into a smaller sub-scope. The EggCounterArena is meant to be used once everything has been unreffed or destroyed, so that it can report any (instrumented) type that still has instances flying around.

So, I'd move all of main() into a sub-scope except the following two statements.
Comment 119 Debarshi Ray 2017-12-13 15:37:10 UTC
Review of attachment 364847 [details] [review]:

::: src/photos-utils.c
@@ -1117,3 @@
-        {
-          g_free (result);
-          result = g_ascii_strdown (extensions[i], -1);

This doesn't look right. Since result is defined in the outer scope, it won't be freed after every iteration of the for loop. So, not freeing the result before assigning another memory address to it, means that we are losing the pointer to the earlier buffer and leaking it.

This is an example where C and g_auto* doesn't match C++'s smart pointers.

One way to avoid the g_free would be run the loop backwards, but that would be too much churn for this g_auto* patchset. So I think we'll have to live with the g_free for the time being. We can fix it up in a later patch/bug.

@@ +1161,1 @@
   gchar *uri = NULL;

uri should be marked with g_autofree, not path.

@@ +1363,3 @@
 photos_utils_update_executed (GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
+  TrackerSparqlConnection *connection = TRACKER_SPARQL_CONNECTION (source_object); /* TODO: g_autoptr */

This TODO isn't necessary because we don't need g_autoptr here.

@@ +1388,3 @@
+  {
+    g_autoptr (GError) error = NULL;
+    queue = photos_tracker_queue_dup_singleton (NULL, &error);

Nitpick: missing newline.

@@ +1398,1 @@
   photos_tracker_queue_update (queue, query, NULL, photos_utils_update_executed, g_strdup (urn), g_free);

With the push to g_auto*, I'd sneak in a g_steal_pointer to avoid the g_strdup.

@@ +1428,1 @@
   photos_tracker_queue_update (queue, query, NULL, photos_utils_update_executed, g_strdup (urn), g_free);

Ditto.
Comment 120 Umang Jain 2017-12-19 22:19:08 UTC
> @@ +1398,1 @@
>    photos_tracker_queue_update (queue, query, NULL,
> photos_utils_update_executed, g_strdup (urn), g_free);
> 
> With the push to g_auto*, I'd sneak in a g_steal_pointer to avoid the
> g_strdup.
> 
> @@ +1428,1 @@
>    photos_tracker_queue_update (queue, query, NULL,
> photos_utils_update_executed, g_strdup (urn), g_free);
> 
> Ditto.

hmm, The urn is a <const gchar *> type if you notice. As I understand, the ownership transfer using g_steal_pointer doesn't make sense to me. Can you explain?
Comment 121 Umang Jain 2017-12-20 08:20:08 UTC
Created attachment 365780 [details] [review]
main: Use g_auto*
Comment 122 Debarshi Ray 2017-12-20 08:54:36 UTC
(In reply to Umang Jain from comment #120)
> > @@ +1398,1 @@
> >    photos_tracker_queue_update (queue, query, NULL,
> > photos_utils_update_executed, g_strdup (urn), g_free);
> > 
> > With the push to g_auto*, I'd sneak in a g_steal_pointer to avoid the
> > g_strdup.
> > 
> > @@ +1428,1 @@
> >    photos_tracker_queue_update (queue, query, NULL,
> > photos_utils_update_executed, g_strdup (urn), g_free);
> > 
> > Ditto.
> 
> hmm, The urn is a <const gchar *> type if you notice. As I understand, the
> ownership transfer using g_steal_pointer doesn't make sense to me. Can you
> explain?

Oh, never mind. You're right. I was mistaken. Please ignore those two comments. Sorry about the confusion.
Comment 123 Umang Jain 2017-12-20 09:43:02 UTC
Created attachment 365785 [details] [review]
utils: Use g_auto* (2/2)
Comment 124 Umang Jain 2017-12-20 09:49:13 UTC
Created attachment 365786 [details] [review]
utils: Use g_auto* (2/2)
Comment 125 Umang Jain 2017-12-20 09:52:42 UTC
Created attachment 365787 [details] [review]
utils: Use g_auto* (2/2)
Comment 126 Umang Jain 2017-12-20 10:29:16 UTC
Created attachment 365789 [details] [review]
fetch-ids-job: Use g_auto*
Comment 127 Umang Jain 2017-12-20 11:44:24 UTC
Created attachment 365791 [details] [review]
thumbnail-factory: Use g_auto*
Comment 128 Umang Jain 2017-12-20 11:59:45 UTC
Created attachment 365792 [details] [review]
tracker-change-monitor: Use g_auto*
Comment 129 Umang Jain 2017-12-20 12:05:07 UTC
Created attachment 365793 [details] [review]
flickr-item: Use g_auto*
Comment 130 Debarshi Ray 2017-12-30 21:06:42 UTC
Review of attachment 364896 [details] [review]:

++
Comment 131 Debarshi Ray 2017-12-30 21:11:36 UTC
Review of attachment 364909 [details] [review]:

Thanks, Umang. Looks good to me.
Comment 132 Debarshi Ray 2017-12-31 18:34:43 UTC
Review of attachment 365002 [details] [review]:

++
Comment 133 Debarshi Ray 2017-12-31 18:35:18 UTC
Review of attachment 365780 [details] [review]:

Perfect, looks good to me.
Comment 134 Debarshi Ray 2017-12-31 19:19:38 UTC
Review of attachment 365787 [details] [review]:

Perfect, thanks.
Comment 135 Debarshi Ray 2018-01-01 13:08:09 UTC
Created attachment 366137 [details] [review]
fetch-ids-job: Use g_auto*

Pushed with some cosmetic fixes.
Comment 136 Debarshi Ray 2018-01-01 13:53:42 UTC
Review of attachment 365791 [details] [review]:

::: src/photos-thumbnail-factory.c
@@ +404,1 @@
   if (self->connection == NULL)

The g_clear_error further above can now be avoided.

@@ +407,2 @@
       const gchar *address;
+      g_autofree gchar *thumbnailer_path = NULL;

Pre-existing bug: the thumbnailer_path was being leaked in the error case.
Comment 137 Debarshi Ray 2018-01-01 13:54:27 UTC
Created attachment 366138 [details] [review]
thumbnail-factory: Use g_auto*
Comment 138 Debarshi Ray 2018-01-02 07:57:31 UTC
Review of attachment 365792 [details] [review]:

++

::: src/photos-tracker-change-monitor.c
@@ +185,1 @@
   PhotosTrackerChangeMonitorQueryData *data = (PhotosTrackerChangeMonitorQueryData *) user_data;

Might be good to define a cleanup function for this ...

@@ +234,3 @@
+      {
+        g_warning ("Unable to resolve item URNs for graph changes: %s", error->message);
+        photos_tracker_change_monitor_query_data_free (data);

... so that we can get rid of this.

It can be done in a separate patch, though. See commit e31095dcd81e786b.
Comment 139 Debarshi Ray 2018-01-02 08:21:44 UTC
Review of attachment 365793 [details] [review]:

::: src/photos-flickr-item.c
@@ +145,3 @@
 photos_flickr_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
 {
   PhotosFlickrItemSyncData data;

Might be nice to define a cleanup function.

@@ +151,1 @@
   GMainContext *context = NULL;

Missing g_autoptr.

@@ +151,3 @@
   GMainContext *context = NULL;
   GrlMedia *media = NULL;
   GrlOperationOptions *options = NULL;

Need some TODOs here. :)
Comment 140 Debarshi Ray 2018-01-02 08:23:09 UTC
Created attachment 366160 [details] [review]
flickr-item: Use g_auto*

I took the liberty to make the above adjustments and pushed to master.
Comment 141 Debarshi Ray 2018-01-11 18:45:46 UTC
Created attachment 366681 [details] [review]
source-manager: Use g_auto*
Comment 142 Debarshi Ray 2018-01-16 17:27:26 UTC
Created attachment 366894 [details] [review]
build: Generate autocleanup definitions for GDBus interfaces
Comment 143 Debarshi Ray 2018-01-20 18:38:09 UTC
Created attachment 367155 [details] [review]
application: Use g_auto*
Comment 144 GNOME Infrastructure Team 2018-01-23 10:25: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/gnome-photos/issues/77.