some infos display improvements

This commit is contained in:
guinux 2017-09-16 10:30:28 +02:00
parent 6578218790
commit 36c76e18ef
2 changed files with 24 additions and 9 deletions

View File

@ -724,10 +724,22 @@ namespace Pamac {
try {
var pixbuf = new Gdk.Pixbuf.from_file (details.icon);
app_image.pixbuf = pixbuf;
} catch (GLib.Error e) {
// 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;
}

View File

@ -907,7 +907,9 @@ namespace Pamac {
if (appname != "") {
app_store.get_apps ().foreach ((app) => {
if (get_app_name (app) == appname) {
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) {
@ -916,6 +918,7 @@ namespace Pamac {
icon = get_app_icon (app, sync_pkg.db.name);
screenshot = get_app_screenshot (app);
}
}
});
} else {
// find if pkgname provides only one app