From 422425593df585b879ca45b19849da48be463fe5 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Fri, 27 Jul 2007 16:09:36 +0000 Subject: Fix crashes, add Puppy Linux as a recognized distribution. --- hardinfo2/arch/linux/common/os.h | 9 +++++++++ hardinfo2/computer.h | 1 + hardinfo2/iconcache.c | 8 ++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) (limited to 'hardinfo2') diff --git a/hardinfo2/arch/linux/common/os.h b/hardinfo2/arch/linux/common/os.h index 0fe06709..e4f35e95 100644 --- a/hardinfo2/arch/linux/common/os.h +++ b/hardinfo2/arch/linux/common/os.h @@ -185,6 +185,15 @@ computer_get_os(void) os->distro = g_strdup(buf); } } + + if (g_str_equal(distro_db[i].codename, "ppy")) { + gchar *tmp; + + tmp = g_strdup_printf("Puppy Linux %.2f", atof(os->distro) / 100.0); + g_free(os->distro); + os->distro = tmp; + } + os->distrocode = g_strdup(distro_db[i].codename); break; diff --git a/hardinfo2/computer.h b/hardinfo2/computer.h index a6956122..ceb2b2a0 100644 --- a/hardinfo2/computer.h +++ b/hardinfo2/computer.h @@ -34,6 +34,7 @@ static struct { { DB_PREFIX "SuSE-release", "suse" }, { DB_PREFIX "sun-release", "sun" }, { DB_PREFIX "zenwalk-version", "zen" }, + { DB_PREFIX "puppyversion", "ppy" }, /* * RedHat must be the *last* one to be checked, since * some distros (like Mandrake) includes a redhat-relase diff --git a/hardinfo2/iconcache.c b/hardinfo2/iconcache.c index 49325e39..af4f98c0 100644 --- a/hardinfo2/iconcache.c +++ b/hardinfo2/iconcache.c @@ -48,7 +48,9 @@ GdkPixbuf *icon_cache_get_pixbuf(const gchar * file) g_free(path); } - g_object_ref(icon); + if (icon) { + g_object_ref(icon); + } return icon; } @@ -81,7 +83,9 @@ GdkPixbuf *icon_cache_get_pixbuf_at_size(const gchar * file, gint wid, g_free(path); } - g_object_ref(icon); + if (icon) { + g_object_ref(icon); + } return icon; } -- cgit v1.2.3