[libadwaita/msvc: 18/19] src/: More styling fixes and cleanups




commit f98639f27815f81b91df6378d64719aa75170f72
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jan 19 10:21:46 2022 +0800

    src/: More styling fixes and cleanups
    
    We also skip building init_portal() in adw-settings.c on Windows since it does
    not apply there.

 src/adw-avatar.c             |  1 +
 src/adw-preferences-window.c | 11 ++++-------
 src/adw-settings.c           |  2 +-
 3 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/adw-avatar.c b/src/adw-avatar.c
index 8550d387..1e8308f2 100644
--- a/src/adw-avatar.c
+++ b/src/adw-avatar.c
@@ -90,6 +90,7 @@ extract_initials_from_text (const char *text)
 
   if (normalized == NULL) {
     g_free (p);
+
     return NULL;
   }
 
diff --git a/src/adw-preferences-window.c b/src/adw-preferences-window.c
index 30c1b37b..a17dd7a9 100644
--- a/src/adw-preferences-window.c
+++ b/src/adw-preferences-window.c
@@ -125,7 +125,7 @@ strip_mnemonic (const char *src)
 
   *dest = 0;
 
-  return g_steal_pointer (&new_str);
+  return new_str;
 }
 
 static gboolean
@@ -153,8 +153,7 @@ filter_search_results (AdwPreferencesRow    *row,
 
   if (!!strstr (title, terms)) {
     result = TRUE;
-  }
-  else if (ADW_IS_ACTION_ROW (row)) {
+  } else if (ADW_IS_ACTION_ROW (row)) {
     char *subtitle = g_utf8_casefold (adw_action_row_get_subtitle (ADW_ACTION_ROW (row)), -1);
 
     if (!!strstr (subtitle, terms))
@@ -214,10 +213,8 @@ create_search_row_subtitle (AdwPreferencesWindow *self,
     else
       page_title = g_strdup (title);
 
-    if (g_strcmp0 (page_title, "") == 0) {
-      g_free (page_title);
-      page_title = NULL;
-    }
+    if (g_strcmp0 (page_title, "") == 0)
+      g_clear_pointer (&page_title, g_free);
   }
 
   if (group_title) {
diff --git a/src/adw-settings.c b/src/adw-settings.c
index 344cbe62..5bcecb15 100644
--- a/src/adw-settings.c
+++ b/src/adw-settings.c
@@ -82,6 +82,7 @@ set_high_contrast (AdwSettings *self,
     g_object_notify_by_pspec (G_OBJECT (self), props[PROP_HIGH_CONTRAST]);
 }
 
+#ifndef G_OS_WIN32
 /* Settings portal */
 
 static gboolean
@@ -92,7 +93,6 @@ get_disable_portal (void)
   return disable_portal && disable_portal[0] == '1';
 }
 
-#ifndef G_OS_WIN32
 static gboolean
 read_portal_setting (AdwSettings  *self,
                      const char   *schema,


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