[devhelp/wip/book-manager-singleton] BookManager: deprecate new()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp/wip/book-manager-singleton] BookManager: deprecate new()
- Date: Mon, 1 May 2017 14:04:50 +0000 (UTC)
commit abe58e9f321fe8c88c4fe510637b1c8c8efa4cda
Author: Sébastien Wilmet <swilmet gnome org>
Date: Mon May 1 15:27:27 2017 +0200
BookManager: deprecate new()
src/dh-book-manager.c | 6 ++++--
src/dh-book-manager.h | 4 +++-
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/dh-book-manager.c b/src/dh-book-manager.c
index 2d5768f..6188458 100644
--- a/src/dh-book-manager.c
+++ b/src/dh-book-manager.c
@@ -807,12 +807,14 @@ dh_book_manager_init (DhBookManager *book_manager)
/**
* dh_book_manager_new:
*
- * Returns: a new #DhBookManager object.
+ * Returns: (transfer full): the #DhBookManager singleton instance. You need to
+ * unref it when no longer needed.
+ * Deprecated: 3.26: Call dh_book_manager_get_singleton() instead.
*/
DhBookManager *
dh_book_manager_new (void)
{
- return g_object_new (DH_TYPE_BOOK_MANAGER, NULL);
+ return g_object_ref (dh_book_manager_get_singleton ());
}
/**
diff --git a/src/dh-book-manager.h b/src/dh-book-manager.h
index dee9188..5841f52 100644
--- a/src/dh-book-manager.h
+++ b/src/dh-book-manager.h
@@ -43,13 +43,15 @@ struct _DhBookManagerClass {
GType dh_book_manager_get_type (void) G_GNUC_CONST;
DhBookManager *dh_book_manager_get_singleton (void);
-DhBookManager *dh_book_manager_new (void);
GList *dh_book_manager_get_books (DhBookManager *book_manager);
gboolean dh_book_manager_get_group_by_language (DhBookManager *book_manager);
void dh_book_manager_set_group_by_language (DhBookManager *book_manager,
gboolean group_by_language);
G_DEPRECATED
+DhBookManager *dh_book_manager_new (void);
+
+G_DEPRECATED
void dh_book_manager_populate (DhBookManager *book_manager);
G_GNUC_INTERNAL
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]