[gnome-software] Use g_build_filename instead of a printf



commit 15384429511700ba0a10b84859b6cf41b8aab4b7
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Nov 5 16:43:44 2015 +1300

    Use g_build_filename instead of a printf

 src/plugins/gs-plugin-epiphany.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/gs-plugin-epiphany.c b/src/plugins/gs-plugin-epiphany.c
index 9732d8d..1d32afb 100644
--- a/src/plugins/gs-plugin-epiphany.c
+++ b/src/plugins/gs-plugin-epiphany.c
@@ -183,9 +183,10 @@ gs_plugin_app_install (GsPlugin *plugin, GsApp *app,
                return FALSE;
 
        /* symlink it to somewhere the shell will notice */
-       app_desktop = g_strdup_printf ("%s/applications/%s",
-                                      g_get_user_data_dir (),
-                                      gs_app_get_id (app));
+       app_desktop = g_build_filename (g_get_user_data_dir (),
+                                       "applications",
+                                       gs_app_get_id (app),
+                                       NULL);
        symlink_desktop = g_file_new_for_path (app_desktop);
        ret = g_file_make_symbolic_link (symlink_desktop,
                                         epi_desktop,
@@ -228,9 +229,10 @@ gs_plugin_app_remove (GsPlugin *plugin, GsApp *app,
 
        /* remove the shared desktop file */
        basename = g_file_get_basename (file_epi);
-       app_desktop = g_strdup_printf ("%s/applications/%s",
-                                  g_get_user_data_dir (),
-                                  gs_app_get_id (app));
+       app_desktop = g_build_filename (g_get_user_data_dir (),
+                                       "applications",
+                                       gs_app_get_id (app),
+                                       NULL);
        file_app = g_file_new_for_path (app_desktop);
        if (!g_file_delete (file_app, NULL, error))
                return FALSE;


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