[Libguestfs] [PATCH 3/9] Add support for Ubuntu logo

misc at zarb.org misc at zarb.org
Thu Oct 13 23:05:02 UTC 2011


From: Michael Scherer <misc at zarb.org>

Ths logo is present on Lucid Lynx, but may not always be installed, like
in case of a minimal installation ( or server ). While Edubuntu and Kubuntu
have different logo, I didn't check where it would be placed.
---
 src/inspect_icon.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/inspect_icon.c b/src/inspect_icon.c
index f418e4a..d04e2d4 100644
--- a/src/inspect_icon.c
+++ b/src/inspect_icon.c
@@ -53,6 +53,7 @@ static char *icon_favicon (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
 static char *icon_fedora (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
 static char *icon_rhel (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
 static char *icon_debian (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
+static char *icon_ubuntu (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
 static char *icon_mageia (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
 static char *icon_windows (guestfs_h *g, struct inspect_fs *fs, size_t *size_r);
 
@@ -127,6 +128,10 @@ guestfs__inspect_get_icon (guestfs_h *g, const char *root, size_t *size_r,
       r = icon_debian (g, fs, &size);
       break;
 
+    case OS_DISTRO_UBUNTU:
+      r = icon_ubuntu (g, fs, &size);
+      break;
+
     case OS_DISTRO_MAGEIA:
       r = icon_mageia (g, fs, &size);
       break;
@@ -140,7 +145,6 @@ guestfs__inspect_get_icon (guestfs_h *g, const char *root, size_t *size_r,
     case OS_DISTRO_PARDUS:
     case OS_DISTRO_SLACKWARE:
     case OS_DISTRO_TTYLINUX:
-    case OS_DISTRO_UBUNTU:
     case OS_DISTRO_WINDOWS:
     case OS_DISTRO_UNKNOWN:
     default: ;
@@ -282,7 +286,6 @@ icon_rhel (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
   return get_png (g, fs, SHADOWMAN_ICON, size_r, max_size);
 }
 
-/* NB: I've not located an Ubuntu logo yet. */
 #define DEBIAN_ICON "/usr/share/pixmaps/debian-logo.png"
 
 static char *
@@ -291,6 +294,14 @@ icon_debian (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
   return get_png (g, fs, DEBIAN_ICON, size_r, 2048);
 }
 
+#define UBUNTU_ICON "/usr/share/icons/gnome/24x24/places/ubuntu-logo.png"
+
+static char *
+icon_ubuntu (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
+{
+  return get_png (g, fs, UBUNTU_ICON, size_r, 2048);
+}
+
 #define MAGEIA_ICON "/usr/share/icons/mageia.png"
 
 static char *
-- 
1.7.1




More information about the Libguestfs mailing list