[gnome-builder/wip/chergert/sysprof] run-manager: be safer during unit testing
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/chergert/sysprof] run-manager: be safer during unit testing
- Date: Tue, 23 Aug 2016 01:57:47 +0000 (UTC)
commit 7dae330c74670c741db627996559a199d08be73b
Author: Christian Hergert <chergert redhat com>
Date: Mon Aug 22 18:57:36 2016 -0700
run-manager: be safer during unit testing
If we are in unit testing, there is a chance the application wont be
initialized fully and we want to avoid any errors during make check.
libide/runner/ide-run-manager.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/libide/runner/ide-run-manager.c b/libide/runner/ide-run-manager.c
index 3840db9..42c6ff9 100644
--- a/libide/runner/ide-run-manager.c
+++ b/libide/runner/ide-run-manager.c
@@ -532,6 +532,7 @@ ide_run_manager_add_handler (IdeRunManager *self,
IdeRunHandlerInfo *info;
g_autofree gchar *action_name = NULL;
const gchar *accels[] = { accel, NULL };
+ GApplication *app;
g_return_if_fail (IDE_IS_RUN_MANAGER (self));
g_return_if_fail (id != NULL);
@@ -546,11 +547,11 @@ ide_run_manager_add_handler (IdeRunManager *self,
info->handler_data = user_data;
info->handler_data_destroy = user_data_destroy;
+ app = g_application_get_default ();
action_name = g_strdup_printf ("run-manager.run-with-handler('%s')", id);
- gtk_application_set_accels_for_action (GTK_APPLICATION (g_application_get_default()),
- action_name,
- accels);
+ if (accel != NULL && app != NULL)
+ gtk_application_set_accels_for_action (GTK_APPLICATION (app), action_name, accels);
self->handlers = g_list_append (self->handlers, info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]