[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 52/57] ui: relocate paths to icons and translations
From: |
Paolo Bonzini |
Subject: |
[PULL 52/57] ui: relocate paths to icons and translations |
Date: |
Sat, 19 Sep 2020 11:59:11 -0400 |
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
ui/gtk.c | 10 ++++++++--
ui/sdl2.c | 9 +++++++--
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index 1c59de2af4..b11594d817 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -51,6 +51,7 @@
#include <math.h>
#include "trace.h"
+#include "qemu/cutils.h"
#include "ui/input.h"
#include "sysemu/runstate.h"
#include "sysemu/sysemu.h"
@@ -2202,6 +2203,7 @@ static void gtk_display_init(DisplayState *ds,
DisplayOptions *opts)
GtkDisplayState *s = g_malloc0(sizeof(*s));
GdkDisplay *window_display;
GtkIconTheme *theme;
+ char *dir;
if (!gtkinit) {
fprintf(stderr, "gtk initialization failed\n");
@@ -2211,7 +2213,9 @@ static void gtk_display_init(DisplayState *ds,
DisplayOptions *opts)
s->opts = opts;
theme = gtk_icon_theme_get_default();
- gtk_icon_theme_prepend_search_path(theme, CONFIG_QEMU_ICONDIR);
+ dir = get_relocated_path(CONFIG_QEMU_ICONDIR);
+ gtk_icon_theme_prepend_search_path(theme, dir);
+ g_free(dir);
g_set_prgname("qemu");
s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@@ -2227,7 +2231,9 @@ static void gtk_display_init(DisplayState *ds,
DisplayOptions *opts)
* sure that we don't accidentally break implicit assumptions. */
setlocale(LC_MESSAGES, "");
setlocale(LC_CTYPE, "C.UTF-8");
- bindtextdomain("qemu", CONFIG_QEMU_LOCALEDIR);
+ dir = get_relocated_path(CONFIG_QEMU_LOCALEDIR);
+ bindtextdomain("qemu", dir);
+ g_free(dir);
bind_textdomain_codeset("qemu", "UTF-8");
textdomain("qemu");
diff --git a/ui/sdl2.c b/ui/sdl2.c
index b23a8f0a8e..abad7f981e 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -25,6 +25,7 @@
#include "qemu/osdep.h"
#include "qemu/module.h"
+#include "qemu/cutils.h"
#include "ui/console.h"
#include "ui/input.h"
#include "ui/sdl2.h"
@@ -795,6 +796,7 @@ static void sdl2_display_init(DisplayState *ds,
DisplayOptions *o)
int i;
SDL_SysWMinfo info;
SDL_Surface *icon = NULL;
+ char *dir;
assert(o->type == DISPLAY_TYPE_SDL);
@@ -868,15 +870,18 @@ static void sdl2_display_init(DisplayState *ds,
DisplayOptions *o)
}
#ifdef CONFIG_SDL_IMAGE
- icon = IMG_Load(CONFIG_QEMU_ICONDIR "/hicolor/128x128/apps/qemu.png");
+ dir = get_relocated_path(CONFIG_QEMU_ICONDIR
"/hicolor/128x128/apps/qemu.png");
+ icon = IMG_Load(dir);
#else
/* Load a 32x32x4 image. White pixels are transparent. */
- icon = SDL_LoadBMP(CONFIG_QEMU_ICONDIR "/hicolor/32x32/apps/qemu.bmp");
+ dir = get_relocated_path(CONFIG_QEMU_ICONDIR
"/hicolor/32x32/apps/qemu.bmp");
+ icon = SDL_LoadBMP(dir);
if (icon) {
uint32_t colorkey = SDL_MapRGB(icon->format, 255, 255, 255);
SDL_SetColorKey(icon, SDL_TRUE, colorkey);
}
#endif
+ g_free(dir);
if (icon) {
SDL_SetWindowIcon(sdl2_console[0].real_window, icon);
}
--
2.26.2
- [PULL 13/57] Simplify the .gitignore file, (continued)
- [PULL 13/57] Simplify the .gitignore file, Paolo Bonzini, 2020/09/19
- [PULL 15/57] numa: drop support for '-numa node' (without memory specified), Paolo Bonzini, 2020/09/19
- [PULL 26/57] hw/char/serial-{isa, pci}: Alias QDEV properties from generic serial object, Paolo Bonzini, 2020/09/19
- [PULL 29/57] hw: megasas: consider 'iov_count=0' is an error in megasas_map_sgl, Paolo Bonzini, 2020/09/19
- [PULL 31/57] meson: move libudev test, Paolo Bonzini, 2020/09/19
- [PULL 45/57] oslib-posix: relocate path to /var, Paolo Bonzini, 2020/09/19
- [PULL 21/57] hw/char/serial: Assert serial_ioport_read/write offset fits 8 bytes, Paolo Bonzini, 2020/09/19
- [PULL 32/57] meson: move libmpathpersist test, Paolo Bonzini, 2020/09/19
- [PULL 47/57] net: relocate paths to helpers and scripts, Paolo Bonzini, 2020/09/19
- [PULL 35/57] configure: fix --meson=/path/to/meson, Paolo Bonzini, 2020/09/19
- [PULL 52/57] ui: relocate paths to icons and translations,
Paolo Bonzini <=
- [PULL 18/57] hw/mips/mipssim: Use MMIO serial device on fake ISA I/O, Paolo Bonzini, 2020/09/19
- [PULL 40/57] meson: report accelerator support, Paolo Bonzini, 2020/09/19
- [PULL 53/57] configure: use a platform-neutral prefix, Paolo Bonzini, 2020/09/19
- [PULL 20/57] configure: rename QEMU_GA_MSI_ENABLED to CONFIG_QGA_MSI, Paolo Bonzini, 2020/09/19
- [PULL 22/57] hw/char/serial: Replace commented DPRINTF() by trace event, Paolo Bonzini, 2020/09/19
- [PULL 25/57] hw/char/serial: Make 'wakeup' property boolean, Paolo Bonzini, 2020/09/19
- [PULL 41/57] oslib: do not call g_strdup from qemu_get_exec_dir, Paolo Bonzini, 2020/09/19
- [PULL 56/57] checkpatch: avoid error on cover letter files, Paolo Bonzini, 2020/09/19
- [PULL 38/57] meson: qtest: set "depends" correctly, Paolo Bonzini, 2020/09/19
- [PULL 44/57] cutils: introduce get_relocated_path, Paolo Bonzini, 2020/09/19