[file-roller] Fix implementation and use of the alternative package name lookup



commit 95aafc3c70f75e4a3b70619f6d0471c9240733a1
Author: Iain Nicol <iainn src gnome org>
Date:   Sun May 22 11:42:03 2011 +0100

    Fix implementation and use of the alternative package name lookup
    
    Any ``real_name'' which was found was not getting used before.
    
    Also, when the lookup is unsuccessful, this means there is no
    /alternative/ package name.  Thus we should use the hard-coded package
    name as the real_name for our PackageKit installation request.
    
    [bug #603757]

 src/dlg-package-installer.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/dlg-package-installer.c b/src/dlg-package-installer.c
index 6056c7d..f8feff7 100644
--- a/src/dlg-package-installer.c
+++ b/src/dlg-package-installer.c
@@ -138,10 +138,12 @@ get_packages_real_names (char **names)
 		real_name = g_key_file_get_string (key_file, "Package Matches", names[i], NULL);
 		if (real_name != NULL)
 			real_name = g_strstrip (real_name);
-		if ((real_name == NULL) || (strncmp (real_name, "", 1) == 0))
-			real_names[i] = g_strdup (real_name);
-
-		g_free (real_name);
+		if ((real_name == NULL) || (strncmp (real_name, "", 1) == 0)) {
+			g_free (real_name);
+			real_name = g_strdup (names[i]);
+		}
+		real_names[i] = real_name;
+		real_name = NULL;
 	}
 
 	g_free (filename);
@@ -197,7 +199,7 @@ install_packages (InstallerData *idata)
 					   "InstallPackageNames",
 					   g_variant_new ("(u^ass)",
 							  xid,
-							  names,
+							  real_names,
 							  "hide-confirm-search,hide-finished,hide-warning"),
 					   G_DBUS_CALL_FLAGS_NONE,
 					   G_MAXINT,



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