[gnome-initial-setup/youre-welcome: 5/10] Apply 12 suggestion(s) to 6 file(s)




commit c8caf07534c21e48f19ca354d484f56146454dbb
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Aug 6 12:04:26 2020 +0000

    Apply 12 suggestion(s) to 6 file(s)

 gnome-initial-setup/gis-page.c                     |  8 ++++---
 gnome-initial-setup/pages/meson.build              |  2 +-
 .../pages/welcome/gis-welcome-page.c               | 10 ++++-----
 .../pages/welcome/gis-welcome-page.h               | 26 +++-------------------
 .../pages/welcome/gis-welcome-page.ui              |  3 ++-
 gnome-initial-setup/pages/welcome/meson.build      |  2 +-
 6 files changed, 16 insertions(+), 35 deletions(-)
---
diff --git a/gnome-initial-setup/gis-page.c b/gnome-initial-setup/gis-page.c
index 7aa12c2f..7c6e867a 100644
--- a/gnome-initial-setup/gis-page.c
+++ b/gnome-initial-setup/gis-page.c
@@ -37,7 +37,7 @@ struct _GisPagePrivate
   guint complete : 1;
   guint skippable : 1;
   guint needs_accept : 1;
-  guint has_forward: 1;
+  guint has_forward : 1;
   guint padding : 5;
 };
 typedef struct _GisPagePrivate GisPagePrivate;
@@ -319,8 +319,10 @@ void
 gis_page_set_has_forward (GisPage *page, gboolean has_forward)
 {
   GisPagePrivate *priv = gis_page_get_instance_private (page);
-  priv->has_forward = has_forward;
-  g_object_notify_by_pspec (G_OBJECT (page), obj_props[PROP_HAS_FORWARD]);
+  if (priv->has_forward != has_forward) {
+    priv->has_forward = has_forward;
+    g_object_notify_by_pspec (G_OBJECT (page), obj_props[PROP_HAS_FORWARD]);
+  }
 }
 
 void
diff --git a/gnome-initial-setup/pages/meson.build b/gnome-initial-setup/pages/meson.build
index 42200f41..45f77d72 100644
--- a/gnome-initial-setup/pages/meson.build
+++ b/gnome-initial-setup/pages/meson.build
@@ -8,7 +8,7 @@ pages = [
    'goa',
    'password',
    'summary',
-   'welcome'
+   'welcome',
 ]
 
 if libmalcontent_dep.found() and libmalcontent_ui_dep.found()
diff --git a/gnome-initial-setup/pages/welcome/gis-welcome-page.c 
b/gnome-initial-setup/pages/welcome/gis-welcome-page.c
index 41a11ef0..5a6444aa 100644
--- a/gnome-initial-setup/pages/welcome/gis-welcome-page.c
+++ b/gnome-initial-setup/pages/welcome/gis-welcome-page.c
@@ -32,11 +32,10 @@
 #define VENDOR_ENTITY_KEY "entity"
 
 struct _GisWelcomePagePrivate
+typedef struct
 {
   GtkWidget *header;
-  GtkWidget *title;
-};
-typedef struct _GisWelcomePagePrivate GisWelcomePagePrivate;
+} GisWelcomePagePrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (GisWelcomePage, gis_welcome_page, GIS_TYPE_PAGE);
 
@@ -45,11 +44,10 @@ update_welcome_header (GisWelcomePage *page)
 {
   GisWelcomePagePrivate *priv = gis_welcome_page_get_instance_private (page);
   const char *path = "/org/gnome/initial-setup/initial-setup-welcome.svg";
-  GdkPixbuf *pixbuf;
+  g_autoptr(GdkPixbuf) pixbuf = NULL;
 
   pixbuf = gdk_pixbuf_new_from_resource_at_scale (path, 1000, -1, TRUE, NULL);
   gtk_image_set_from_pixbuf (GTK_IMAGE (priv->header), pixbuf);
-  g_object_unref (pixbuf);
 }
 
 typedef struct
@@ -122,7 +120,7 @@ version_text_handler (GMarkupParseContext *ctx,
 
       stripped = g_strstrip (g_strdup (text));
       g_free (*data->current);
-      *data->current = g_strdup (stripped);
+      *data->current = g_steal_pointer (&stripped);
     }
 }
 
diff --git a/gnome-initial-setup/pages/welcome/gis-welcome-page.h 
b/gnome-initial-setup/pages/welcome/gis-welcome-page.h
index ac727f64..73cb6e4f 100644
--- a/gnome-initial-setup/pages/welcome/gis-welcome-page.h
+++ b/gnome-initial-setup/pages/welcome/gis-welcome-page.h
@@ -19,8 +19,7 @@
  *     Matthias Clasen <mclasen redhat com>
  */
 
-#ifndef __GIS_WELCOME_PAGE_H__
-#define __GIS_WELCOME_PAGE_H__
+#pragma once
 
 #include <glib-object.h>
 
@@ -28,30 +27,11 @@
 
 G_BEGIN_DECLS
 
-#define GIS_TYPE_WELCOME_PAGE               (gis_welcome_page_get_type ())
-#define GIS_WELCOME_PAGE(obj)                           (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GIS_TYPE_WELCOME_PAGE, GisWelcomePage))
-#define GIS_WELCOME_PAGE_CLASS(klass)                   (G_TYPE_CHECK_CLASS_CAST ((klass),  
GIS_TYPE_WELCOME_PAGE, GisWelcomePageClass))
-#define GIS_IS_WELCOME_PAGE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIS_TYPE_WELCOME_PAGE))
-#define GIS_IS_WELCOME_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GIS_TYPE_WELCOME_PAGE))
-#define GIS_WELCOME_PAGE_GET_CLASS(obj)                 (G_TYPE_INSTANCE_GET_CLASS ((obj),  
GIS_TYPE_WELCOME_PAGE, GisWelcomePageClass))
-
-typedef struct _GisWelcomePage        GisWelcomePage;
-typedef struct _GisWelcomePageClass   GisWelcomePageClass;
-
-struct _GisWelcomePage
-{
-  GisPage parent;
-};
-
-struct _GisWelcomePageClass
-{
-  GisPageClass parent_class;
-};
+#define GIS_TYPE_WELCOME_PAGE (gis_welcome_page_get_type ())
+G_DECLARE_FINAL_TYPE (GisWelcomePage, gis_welcome_page, GIS, WELCOME_PAGE, GisPage)
 
 GType gis_welcome_page_get_type (void);
 
 GisPage *gis_prepare_welcome_page (GisDriver *driver);
 
 G_END_DECLS
-
-#endif /* __GIS_WELCOME_PAGE_H__ */
diff --git a/gnome-initial-setup/pages/welcome/gis-welcome-page.ui 
b/gnome-initial-setup/pages/welcome/gis-welcome-page.ui
index 2df449f3..69936403 100644
--- a/gnome-initial-setup/pages/welcome/gis-welcome-page.ui
+++ b/gnome-initial-setup/pages/welcome/gis-welcome-page.ui
@@ -30,6 +30,7 @@
             <child>
               <object class="GtkLabel" id="title">
                  <property name="visible">True</property>
+                 <!-- This is set to a translated string at runtime -->
                  <property name="label">Welcome to the latest GNOME!</property>
                  <style>
                    <class name="title-1"/>
@@ -39,7 +40,7 @@
             <child>
               <object class="GtkLabel">
                  <property name="visible">True</property>
-                 <property name="label" translatable="yes">Setup will guide you through making an account 
and enabling some features. We'll have you up and running in no time.</property>
+                 <property name="label" translatable="yes">Setup will guide you through making an account 
and enabling some features. We’ll have you up and running in no time.</property>
                  <property name="wrap">1</property>
                  <property name="width-chars">35</property>
                  <property name="max-width-chars">35</property>
diff --git a/gnome-initial-setup/pages/welcome/meson.build b/gnome-initial-setup/pages/welcome/meson.build
index 5399ce43..be977dc9 100644
--- a/gnome-initial-setup/pages/welcome/meson.build
+++ b/gnome-initial-setup/pages/welcome/meson.build
@@ -1,7 +1,7 @@
 sources += gnome.compile_resources(
     'welcome-resources',
     files('welcome.gresource.xml'),
-    c_name: 'welcome'
+    c_name: 'welcome',
 )
 
 sources += files(


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