aboutsummaryrefslogtreecommitdiff
path: root/ui/gtk.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-08-18 11:59:27 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-30 19:11:36 +0200
commit77d910fb6aaea60381e487073845ad2152a9e1f6 (patch)
tree1b3a4fb2b0fb0e1ef7b21e168998d37d28fee3cf /ui/gtk.c
parenta9eacf8b4dd1d13f89fb735236e32dcfafef3e93 (diff)
ui: relocate paths to icons and translations
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r--ui/gtk.c10
1 files changed, 8 insertions, 2 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");