[gnome-control-center] display: deprecation fix



commit 7054d8b0508c2b2758ef5f860c85bd440ba3d07d
Author: Nishal Kulkarni <kulknishu gmail com>
Date:   Tue Aug 3 09:33:49 2021 +0530

    display: deprecation fix
    
    Change g_memdup to g_memdup2 in display.
    
    https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538

 meson.build                          | 2 +-
 panels/display/cc-display-settings.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index 0d46802b5..6f08febd9 100644
--- a/meson.build
+++ b/meson.build
@@ -121,7 +121,7 @@ accounts_dep = dependency('accountsservice', version: '>= 0.6.39')
 colord_dep = dependency('colord', version: '>= 0.1.34')
 gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: '>= 2.23.0')
 gio_dep = dependency('gio-2.0')
-glib_dep = dependency('glib-2.0', version: '>= 2.64.0')
+glib_dep = dependency('glib-2.0', version: '>= 2.68.0')
 gnome_desktop_dep = dependency('gnome-desktop-3.0', version: '>= 3.33.4')
 gnome_settings_dep = dependency('gnome-settings-daemon', version: '>= 3.27.90')
 goa_dep = dependency('goa-1.0', version: goa_req_version)
diff --git a/panels/display/cc-display-settings.c b/panels/display/cc-display-settings.c
index c9f89f24c..a4f914ecd 100644
--- a/panels/display/cc-display-settings.c
+++ b/panels/display/cc-display-settings.c
@@ -413,7 +413,7 @@ cc_display_settings_rebuild_ui (CcDisplaySettings *self)
           value_object = hdy_value_object_new_collect (G_TYPE_STRING, scale_str);
           g_list_store_append (self->scale_list, value_object);
           g_object_set_data_full (G_OBJECT (value_object), "scale",
-                                  g_memdup (&scale, sizeof (double)), g_free);
+                                  g_memdup2 (&scale, sizeof (double)), g_free);
           if (is_selected)
             hdy_combo_row_set_selected_index (HDY_COMBO_ROW (self->scale_combo_row),
                                               g_list_model_get_n_items (G_LIST_MODEL (self->scale_list)) - 
1);
@@ -422,7 +422,7 @@ cc_display_settings_rebuild_ui (CcDisplaySettings *self)
         {
           GtkWidget *scale_btn = gtk_radio_button_new_with_label_from_widget (group, scale_str);
           g_object_set_data_full (G_OBJECT (scale_btn), "scale",
-                                  g_memdup (&scale, sizeof (double)), g_free);
+                                  g_memdup2 (&scale, sizeof (double)), g_free);
 
           if (!group)
             group = GTK_RADIO_BUTTON (scale_btn);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]