From 36c76e18efac11a5c02ab59442770c5748c2561e Mon Sep 17 00:00:00 2001 From: guinux Date: Sat, 16 Sep 2017 10:30:28 +0200 Subject: [PATCH] some infos display improvements --- src/manager_window.vala | 16 ++++++++++++++-- src/user_daemon.vala | 17 ++++++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/manager_window.vala b/src/manager_window.vala index ba2c1f2..5288442 100644 --- a/src/manager_window.vala +++ b/src/manager_window.vala @@ -725,8 +725,20 @@ namespace Pamac { var pixbuf = new Gdk.Pixbuf.from_file (details.icon); app_image.pixbuf = pixbuf; } catch (GLib.Error e) { - app_image.pixbuf = package_icon; - stderr.printf ("%s: %s\n", details.icon, e.message); + // some icons are not in the right repo + string icon = details.icon; + if ("extra" in details.icon) { + icon = details.icon.replace ("extra", "community"); + } else if ("community" in details.icon) { + icon = details.icon.replace ("community", "extra"); + } + try { + var pixbuf = new Gdk.Pixbuf.from_file (icon); + app_image.pixbuf = pixbuf; + } catch (GLib.Error e) { + app_image.pixbuf = package_icon; + stderr.printf ("%s: %s\n", details.icon, e.message); + } } } else { app_image.pixbuf = package_icon; diff --git a/src/user_daemon.vala b/src/user_daemon.vala index 4f1e0a2..246b175 100644 --- a/src/user_daemon.vala +++ b/src/user_daemon.vala @@ -907,14 +907,17 @@ namespace Pamac { if (appname != "") { app_store.get_apps ().foreach ((app) => { if (get_app_name (app) == appname) { - app_name = appname; - try { - long_desc = As.markup_convert_simple (get_app_description (app)); - } catch (Error e) { - stderr.printf ("Error: %s\n", e.message); + if (app.get_pkgname_default () == alpm_pkg.name) { + app_name = appname; + desc = get_app_summary (app); + try { + long_desc = As.markup_convert_simple (get_app_description (app)); + } catch (Error e) { + stderr.printf ("Error: %s\n", e.message); + } + icon = get_app_icon (app, sync_pkg.db.name); + screenshot = get_app_screenshot (app); } - icon = get_app_icon (app, sync_pkg.db.name); - screenshot = get_app_screenshot (app); } }); } else {