[epiphany/wip/exalm/cleanups] notification-container: Make get_num_children() private



commit 37138f9826323423fe3f4b228f4f584ad1c73b14
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Nov 29 14:05:46 2021 +0500

    notification-container: Make get_num_children() private

 lib/ephy-notification-container.c | 32 ++++++++++++++++----------------
 lib/ephy-notification-container.h |  1 -
 2 files changed, 16 insertions(+), 17 deletions(-)
---
diff --git a/lib/ephy-notification-container.c b/lib/ephy-notification-container.c
index 376513ce0..302f0b921 100644
--- a/lib/ephy-notification-container.c
+++ b/lib/ephy-notification-container.c
@@ -69,13 +69,28 @@ ephy_notification_container_get_default (void)
                        NULL);
 }
 
+static guint
+get_num_children (EphyNotificationContainer *self)
+{
+  GList *children;
+  guint retval;
+
+  g_assert (EPHY_IS_NOTIFICATION_CONTAINER (self));
+
+  children = gtk_container_get_children (GTK_CONTAINER (self->grid));
+  retval = g_list_length (children);
+  g_list_free (children);
+
+  return retval;
+}
+
 static void
 notification_close_cb (EphyNotification          *notification,
                        EphyNotificationContainer *self)
 {
   gtk_container_remove (GTK_CONTAINER (self->grid), GTK_WIDGET (notification));
 
-  if (ephy_notification_container_get_num_children (self) == 0) {
+  if (get_num_children (self) == 0) {
     gtk_widget_hide (GTK_WIDGET (self));
     gtk_revealer_set_reveal_child (GTK_REVEALER (self), FALSE);
   }
@@ -107,18 +122,3 @@ ephy_notification_container_add_notification (EphyNotificationContainer *self,
 
   g_signal_connect (notification, "close", G_CALLBACK (notification_close_cb), self);
 }
-
-guint
-ephy_notification_container_get_num_children (EphyNotificationContainer *self)
-{
-  GList *children;
-  guint retval;
-
-  g_assert (EPHY_IS_NOTIFICATION_CONTAINER (self));
-
-  children = gtk_container_get_children (GTK_CONTAINER (self->grid));
-  retval = g_list_length (children);
-  g_list_free (children);
-
-  return retval;
-}
diff --git a/lib/ephy-notification-container.h b/lib/ephy-notification-container.h
index 5cb5b43b3..dc4348ecb 100644
--- a/lib/ephy-notification-container.h
+++ b/lib/ephy-notification-container.h
@@ -32,6 +32,5 @@ EphyNotificationContainer *ephy_notification_container_get_default      (void);
 
 void                       ephy_notification_container_add_notification (EphyNotificationContainer *self,
                                                                          GtkWidget                 
*notification);
-guint                      ephy_notification_container_get_num_children (EphyNotificationContainer *self);
 
 G_END_DECLS


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