@@ -1562,7 +1562,7 @@ - (BOOL)verifyQuit
- (IBAction) do_about_menu_item: (id) sender
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- char *icon_path_c = get_relocated_path(CONFIG_QEMU_ICONDIR "/hicolor/512x512/apps/qemu.png");
+ char *icon_path_c = find_bundle(CONFIG_QEMU_ICONDIR "/hicolor/512x512/apps/qemu.png");
NSString *icon_path = [NSString stringWithUTF8String:icon_path_c];
g_free(icon_path_c);
NSImage *icon = [[NSImage alloc] initWithContentsOfFile:icon_path];
@@ -2321,7 +2321,7 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
s->opts = opts;
theme = gtk_icon_theme_get_default();
- dir = get_relocated_path(CONFIG_QEMU_ICONDIR);
+ dir = find_bundle(CONFIG_QEMU_ICONDIR);
gtk_icon_theme_prepend_search_path(theme, dir);
g_free(dir);
g_set_prgname("qemu");
@@ -1,13 +1,29 @@
+icons = [
+ {
+ 'source': 'qemu_32x32.bmp',
+ 'install': 'hicolor' / '32x32' / 'apps' / 'qemu.bmp',
+ },
+ {
+ 'source': 'qemu.svg',
+ 'install': 'hicolor' / 'scalable' / 'apps' / 'qemu.svg',
+ },
+]
+
foreach s: [16, 24, 32, 48, 64, 128, 256, 512]
s = '@0@x@0@'.format(s.to_string())
- install_data('qemu_@0@.png'.format(s),
- rename: 'qemu.png',
- install_dir: qemu_icondir / 'hicolor' / s / 'apps')
+ icons += {
+ 'source': 'qemu_@0@.png'.format(s),
+ 'install': 'hicolor' / s / 'apps' / 'qemu.png',
+ }
endforeach
-install_data('qemu_32x32.bmp',
- rename: 'qemu.bmp',
- install_dir: qemu_icondir / 'hicolor' / '32x32' / 'apps')
+foreach icon: icons
+ source = icon.get('source')
+ install = icon.get('install')
+
+ install_data(source,
+ rename: fs.name(install),
+ install_dir: qemu_icondir / fs.parent(install))
-install_data('qemu.svg',
- install_dir: qemu_icondir / 'hicolor' / 'scalable' / 'apps')
+ bundles += { qemu_bundledir / qemu_icondir / install: meson.current_source_dir() / source }
+endforeach
@@ -910,11 +910,11 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
}
#ifdef CONFIG_SDL_IMAGE
- dir = get_relocated_path(CONFIG_QEMU_ICONDIR "/hicolor/128x128/apps/qemu.png");
+ dir = find_bundle(CONFIG_QEMU_ICONDIR "/hicolor/128x128/apps/qemu.png");
icon = IMG_Load(dir);
#else
/* Load a 32x32x4 image. White pixels are transparent. */
- dir = get_relocated_path(CONFIG_QEMU_ICONDIR "/hicolor/32x32/apps/qemu.bmp");
+ dir = find_bundle(CONFIG_QEMU_ICONDIR "/hicolor/32x32/apps/qemu.bmp");
icon = SDL_LoadBMP(dir);
if (icon) {
uint32_t colorkey = SDL_MapRGB(icon->format, 255, 255, 255);
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> --- ui/cocoa.m | 2 +- ui/gtk.c | 2 +- ui/icons/meson.build | 32 ++++++++++++++++++++++++-------- ui/sdl2.c | 4 ++-- 4 files changed, 28 insertions(+), 12 deletions(-)