[tepl] AmtkActionInfoCentralStore: rename get_instance() to get_singleton()



commit f4536c995dfb069daa397634b9ed17c26d8259ef
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Jul 29 15:00:34 2017 +0200

    AmtkActionInfoCentralStore: rename get_instance() to get_singleton()
    
    It makes the code clearer, we directly know that it's a singleton.
    
    It's like dh_book_manager_get_singleton() in Devhelp.

 amtk/amtk-action-info-central-store.c   |    6 +++---
 amtk/amtk-action-info-central-store.h   |    2 +-
 amtk/amtk-action-info-store.c           |    2 +-
 amtk/amtk-factory-menu.c                |    2 +-
 docs/reference/api-breaks.xml           |    6 ++++++
 docs/reference/tepl-3.0-sections.txt    |    2 +-
 testsuite/amtk/test-action-info-store.c |    2 +-
 7 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/amtk/amtk-action-info-central-store.c b/amtk/amtk-action-info-central-store.c
index 753a2fb..bae1fbe 100644
--- a/amtk/amtk-action-info-central-store.c
+++ b/amtk/amtk-action-info-central-store.c
@@ -96,13 +96,13 @@ amtk_action_info_central_store_init (AmtkActionInfoCentralStore *central_store)
 }
 
 /**
- * amtk_action_info_central_store_get_instance:
+ * amtk_action_info_central_store_get_singleton:
  *
  * Returns: (transfer none): the #AmtkActionInfoCentralStore singleton instance.
- * Since: 2.0
+ * Since: 3.0
  */
 AmtkActionInfoCentralStore *
-amtk_action_info_central_store_get_instance (void)
+amtk_action_info_central_store_get_singleton (void)
 {
        if (G_UNLIKELY (singleton == NULL))
        {
diff --git a/amtk/amtk-action-info-central-store.h b/amtk/amtk-action-info-central-store.h
index a2a561c..2b55ae6 100644
--- a/amtk/amtk-action-info-central-store.h
+++ b/amtk/amtk-action-info-central-store.h
@@ -56,7 +56,7 @@ struct _AmtkActionInfoCentralStoreClass
 GType          amtk_action_info_central_store_get_type         (void) G_GNUC_CONST;
 
 AmtkActionInfoCentralStore *
-               amtk_action_info_central_store_get_instance     (void);
+               amtk_action_info_central_store_get_singleton    (void);
 
 AmtkActionInfo *amtk_action_info_central_store_lookup          (AmtkActionInfoCentralStore *central_store,
                                                                 const gchar                *action_name);
diff --git a/amtk/amtk-action-info-store.c b/amtk/amtk-action-info-store.c
index be06d0a..0164b72 100644
--- a/amtk/amtk-action-info-store.c
+++ b/amtk/amtk-action-info-store.c
@@ -129,7 +129,7 @@ amtk_action_info_store_add (AmtkActionInfoStore *store,
                             g_strdup (action_name),
                             amtk_action_info_ref (info));
 
-       central_store = amtk_action_info_central_store_get_instance ();
+       central_store = amtk_action_info_central_store_get_singleton ();
        _amtk_action_info_central_store_add (central_store, info);
 }
 
diff --git a/amtk/amtk-factory-menu.c b/amtk/amtk-factory-menu.c
index fbb36c2..92c64ac 100644
--- a/amtk/amtk-factory-menu.c
+++ b/amtk/amtk-factory-menu.c
@@ -144,7 +144,7 @@ amtk_factory_menu_create_menu_item_full (AmtkFactoryMenu  *factory,
        g_return_val_if_fail (AMTK_IS_FACTORY_MENU (factory), NULL);
        g_return_val_if_fail (action_name != NULL, NULL);
 
-       central_store = amtk_action_info_central_store_get_instance ();
+       central_store = amtk_action_info_central_store_get_singleton ();
        action_info = amtk_action_info_central_store_lookup (central_store, action_name);
 
        if (action_info == NULL)
diff --git a/docs/reference/api-breaks.xml b/docs/reference/api-breaks.xml
index 2d56a08..adb76cf 100644
--- a/docs/reference/api-breaks.xml
+++ b/docs/reference/api-breaks.xml
@@ -76,6 +76,12 @@
           <code>GtefActionInfoStore:application</code> property.
         </para>
       </listitem>
+      <listitem>
+        <para>
+          Rename <code>gtef_action_info_central_store_get_instance()</code> to
+          <link 
linkend="amtk-action-info-central-store-get-singleton">amtk_action_info_central_store_get_singleton()</link>.
+        </para>
+      </listitem>
     </itemizedlist>
   </chapter>
 </part>
diff --git a/docs/reference/tepl-3.0-sections.txt b/docs/reference/tepl-3.0-sections.txt
index a459e61..c32705e 100644
--- a/docs/reference/tepl-3.0-sections.txt
+++ b/docs/reference/tepl-3.0-sections.txt
@@ -78,7 +78,7 @@ amtk_action_info_store_get_type
 <SECTION>
 <FILE>amtk-action-info-central-store</FILE>
 AmtkActionInfoCentralStore
-amtk_action_info_central_store_get_instance
+amtk_action_info_central_store_get_singleton
 amtk_action_info_central_store_lookup
 <SUBSECTION Standard>
 AMTK_ACTION_INFO_CENTRAL_STORE
diff --git a/testsuite/amtk/test-action-info-store.c b/testsuite/amtk/test-action-info-store.c
index 4a10bb0..b146621 100644
--- a/testsuite/amtk/test-action-info-store.c
+++ b/testsuite/amtk/test-action-info-store.c
@@ -50,7 +50,7 @@ test_add_entries (void)
        g_assert_cmpstr (amtk_action_info_get_icon_name (info1), ==, "document-open");
        g_assert (amtk_action_info_get_tooltip (info1) == NULL);
 
-       central_store = amtk_action_info_central_store_get_instance ();
+       central_store = amtk_action_info_central_store_get_singleton ();
        info2 = amtk_action_info_central_store_lookup (central_store, "win.open");
        g_assert (info1 == info2);
 


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