[gnome-latex] Update DhDconfMigration utility class



commit b3550057f1a9a6807e52362e28513a32e6c415bf
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed May 29 15:23:06 2019 +0200

    Update DhDconfMigration utility class
    
    It pulls an API improvement, the rename of free() to sync_and_free().

 src/liblatexila/dh-dconf-migration.c | 44 +++++++++++++++++++-----------------
 src/liblatexila/dh-dconf-migration.h | 32 ++++++++++++++------------
 src/liblatexila/latexila-utils.c     |  2 +-
 3 files changed, 41 insertions(+), 37 deletions(-)
---
diff --git a/src/liblatexila/dh-dconf-migration.c b/src/liblatexila/dh-dconf-migration.c
index fae9bfa..304b697 100644
--- a/src/liblatexila/dh-dconf-migration.c
+++ b/src/liblatexila/dh-dconf-migration.c
@@ -1,19 +1,21 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 /*
- * Copyright (C) 2018 Sébastien Wilmet <swilmet gnome org>
+ * This file is part of Devhelp.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * Copyright (C) 2018, 2019 Sébastien Wilmet <swilmet gnome org>
  *
- * This program is distributed in the hope that it will be useful,
+ * Devhelp is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License,
+ * or (at your option) any later version.
+ *
+ * Devhelp is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ * along with Devhelp.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "dh-dconf-migration.h"
@@ -61,18 +63,6 @@ _dh_dconf_migration_new (void)
         return migration;
 }
 
-void
-_dh_dconf_migration_free (DhDconfMigration *migration)
-{
-        if (migration == NULL)
-                return;
-
-        dconf_client_sync (migration->client);
-
-        g_object_unref (migration->client);
-        g_free (migration);
-}
-
 /*
  * _dh_dconf_migration_migrate_key:
  * @migration: a #DhDconfMigration.
@@ -138,3 +128,15 @@ _dh_dconf_migration_migrate_key (DhDconfMigration *migration,
 
         va_end (old_key_paths);
 }
+
+void
+_dh_dconf_migration_sync_and_free (DhDconfMigration *migration)
+{
+        if (migration == NULL)
+                return;
+
+        dconf_client_sync (migration->client);
+
+        g_object_unref (migration->client);
+        g_free (migration);
+}
diff --git a/src/liblatexila/dh-dconf-migration.h b/src/liblatexila/dh-dconf-migration.h
index 4bcfdcd..5b263f9 100644
--- a/src/liblatexila/dh-dconf-migration.h
+++ b/src/liblatexila/dh-dconf-migration.h
@@ -1,19 +1,21 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
 /*
- * Copyright (C) 2018 Sébastien Wilmet <swilmet gnome org>
+ * This file is part of Devhelp.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * Copyright (C) 2018, 2019 Sébastien Wilmet <swilmet gnome org>
  *
- * This program is distributed in the hope that it will be useful,
+ * Devhelp is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation, either version 3 of the License,
+ * or (at your option) any later version.
+ *
+ * Devhelp is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ * along with Devhelp.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef DH_DCONF_MIGRATION_H
@@ -26,16 +28,16 @@ G_BEGIN_DECLS
 typedef struct _DhDconfMigration DhDconfMigration;
 
 G_GNUC_INTERNAL
-DhDconfMigration *      _dh_dconf_migration_new         (void);
+DhDconfMigration *      _dh_dconf_migration_new                 (void);
 
 G_GNUC_INTERNAL
-void                    _dh_dconf_migration_free        (DhDconfMigration *migration);
+void                    _dh_dconf_migration_migrate_key         (DhDconfMigration *migration,
+                                                                 const gchar      *new_key_path,
+                                                                 const gchar      *first_old_key_path,
+                                                                 ...);
 
 G_GNUC_INTERNAL
-void                    _dh_dconf_migration_migrate_key (DhDconfMigration *migration,
-                                                         const gchar      *new_key_path,
-                                                         const gchar      *first_old_key_path,
-                                                         ...);
+void                    _dh_dconf_migration_sync_and_free       (DhDconfMigration *migration);
 
 G_END_DECLS
 
diff --git a/src/liblatexila/latexila-utils.c b/src/liblatexila/latexila-utils.c
index 2d921f0..af9dbd4 100644
--- a/src/liblatexila/latexila-utils.c
+++ b/src/liblatexila/latexila-utils.c
@@ -567,7 +567,7 @@ migrate_latexila_to_gnome_latex_gsettings (void)
                g_free (cur_latexila_key);
        }
 
-       _dh_dconf_migration_free (migration);
+       _dh_dconf_migration_sync_and_free (migration);
 #else
        g_warning ("LaTeXila -> GNOME LaTeX dconf migration not supported.");
 #endif


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