[tepl] Buffer: create TeplFile with the AbstractFactory



commit 5a9fb10603766d1624bcff9417d62a296ba17b0f
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Aug 25 11:40:17 2017 +0200

    Buffer: create TeplFile with the AbstractFactory

 tepl/tepl-buffer.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/tepl/tepl-buffer.c b/tepl/tepl-buffer.c
index 9d62385..997fc7a 100644
--- a/tepl/tepl-buffer.c
+++ b/tepl/tepl-buffer.c
@@ -18,6 +18,7 @@
  */
 
 #include "tepl-buffer.h"
+#include "tepl-abstract-factory.h"
 #include "tepl-file.h"
 #include "tepl-utils.h"
 
@@ -379,10 +380,12 @@ static void
 tepl_buffer_init (TeplBuffer *buffer)
 {
        TeplBufferPrivate *priv;
+       TeplAbstractFactory *factory;
 
        priv = tepl_buffer_get_instance_private (buffer);
 
-       priv->file = tepl_file_new ();
+       factory = tepl_abstract_factory_get_singleton ();
+       priv->file = tepl_abstract_factory_create_file (factory);
 
        g_signal_connect_object (priv->file,
                                 "notify::short-name",
@@ -415,6 +418,8 @@ tepl_buffer_new (void)
  * Returns the #TeplFile of @buffer. The returned object is guaranteed to be the
  * same for the lifetime of @buffer.
  *
+ * #TeplBuffer creates the #TeplFile with tepl_abstract_factory_create_file().
+ *
  * Returns: (transfer none): the associated #TeplFile.
  * Since: 1.0
  */


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