clang-tidy: modernize-use-using
[geeqie.git] / src / collect-io.cc
index a460938..e0c1933 100644 (file)
@@ -44,21 +44,25 @@ static CollectManagerEntry *collect_manager_get_entry(const gchar *path);
 static void collect_manager_entry_reset(CollectManagerEntry *entry);
 static gint collect_manager_process_action(CollectManagerEntry *entry, gchar **path_ptr);
 
+namespace
+{
 
-static gboolean scan_geometry(gchar *buffer, gint *x, gint *y, gint *w, gint *h)
+gboolean scan_geometry(gchar *buffer, GdkRectangle &window)
 {
        gint nx, ny, nw, nh;
 
        if (sscanf(buffer, "%d %d %d %d", &nx, &ny, &nw, &nh) != 4) return FALSE;
 
-       *x = nx;
-       *y = ny;
-       *w = nw;
-       *h = nh;
+       window.x = nx;
+       window.y = ny;
+       window.width = nw;
+       window.height = nh;
 
        return TRUE;
 }
 
+}
+
 static gboolean collection_load_private(CollectionData *cd, const gchar *path, CollectionLoadFlags flags)
 {
        gchar s_buf[GQ_COLLECTION_READ_BUFSIZE];
@@ -141,7 +145,7 @@ static gboolean collection_load_private(CollectionData *cd, const gchar *path, C
                                        limit_failures = FALSE;
                                        }
                                else if (strncmp(p, "#geometry:", 10 ) == 0 &&
-                                        scan_geometry(p + 10, &cd->window_x, &cd->window_y, &cd->window_w, &cd->window_h))
+                                        scan_geometry(p + 10, cd->window))
                                        {
                                        has_geometry_header = TRUE;
                                        cd->window_read = TRUE;
@@ -198,7 +202,7 @@ static gboolean collection_load_private(CollectionData *cd, const gchar *path, C
                                }
                        }
 
-               if (strlen(extended_filename_buffer->str) > 0)
+               if (extended_filename_buffer->len > 0)
                        {
                        buffer2 = g_strdup(extended_filename_buffer->str);
                        g_string_erase(extended_filename_buffer, 0, -1);
@@ -412,7 +416,7 @@ static gboolean collection_save_private(CollectionData *cd, const gchar *path)
        collection_update_geometry(cd);
        if (cd->window_read)
                {
-               secure_fprintf(ssi, "#geometry: %d %d %d %d\n", cd->window_x, cd->window_y, cd->window_w, cd->window_h);
+               secure_fprintf(ssi, "#geometry: %d %d %d %d\n", cd->window.x, cd->window.y, cd->window.width, cd->window.height);
                }
 
        work = cd->list;