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

@ -725,8 +725,20 @@ namespace Pamac {
var pixbuf = new Gdk.Pixbuf.from_file (details.icon); var pixbuf = new Gdk.Pixbuf.from_file (details.icon);
app_image.pixbuf = pixbuf; app_image.pixbuf = pixbuf;
} catch (GLib.Error e) { } catch (GLib.Error e) {
app_image.pixbuf = package_icon; // some icons are not in the right repo
stderr.printf ("%s: %s\n", details.icon, e.message); 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 { } else {
app_image.pixbuf = package_icon; app_image.pixbuf = package_icon;

View File

@ -907,14 +907,17 @@ namespace Pamac {
if (appname != "") { if (appname != "") {
app_store.get_apps ().foreach ((app) => { app_store.get_apps ().foreach ((app) => {
if (get_app_name (app) == appname) { if (get_app_name (app) == appname) {
app_name = appname; if (app.get_pkgname_default () == alpm_pkg.name) {
try { app_name = appname;
long_desc = As.markup_convert_simple (get_app_description (app)); desc = get_app_summary (app);
} catch (Error e) { try {
stderr.printf ("Error: %s\n", e.message); 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 { } else {