[gnome-software/wip/temp/ubuntu-xenial-rebased-corrected: 146/331] Simplify variable code



commit 29f553a23ebb4c45f8f090276733b521c93d6684
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Mar 8 12:00:43 2016 +1300

    Simplify variable code

 src/plugins/gs-plugin-apt.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/gs-plugin-apt.c b/src/plugins/gs-plugin-apt.c
index 8d66da2..f7d9f80 100644
--- a/src/plugins/gs-plugin-apt.c
+++ b/src/plugins/gs-plugin-apt.c
@@ -386,17 +386,16 @@ get_changelog (GsPlugin *plugin, GsApp *app)
        GString *details;
 
        // Need to know the source and version to download changelog
-       if (gs_app_get_source_default (app) == NULL ||
-           gs_app_get_update_version (app) == NULL)
+       source = gs_app_get_source_default (app);
+       version = gs_app_get_update_version (app);
+       if (source == NULL || version == NULL)
                return;
 
-       source = gs_app_get_source_default (app);
        if (g_str_has_prefix (source, "lib"))
                source_prefix = g_strdup_printf ("lib%c", source[3]);
        else
                source_prefix = g_strdup_printf ("%c", source[0]);
        current_version = gs_app_get_version (app);
-       version = gs_app_get_update_version (app);
        uri = g_strdup_printf ("http://changelogs.ubuntu.com/changelogs/binary/%s/%s/%s/changelog";, 
source_prefix, source, version);
        msg = soup_message_new (SOUP_METHOD_GET, uri);
 


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