[gnome-builder] terminal: avoid config manager when no project is loaded
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] terminal: avoid config manager when no project is loaded
- Date: Thu, 2 May 2019 18:44:14 +0000 (UTC)
commit b080eec004d554fbaaf8571aca052319bed444c3
Author: Christian Hergert <chergert redhat com>
Date: Thu May 2 11:44:02 2019 -0700
terminal: avoid config manager when no project is loaded
We still need to make the foundry initialize the runtime manager in
some situations, but this lets us avoid the config manager access.
src/libide/terminal/ide-terminal-popover.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/libide/terminal/ide-terminal-popover.c b/src/libide/terminal/ide-terminal-popover.c
index fd7b6fbf5..da7cb6666 100644
--- a/src/libide/terminal/ide-terminal-popover.c
+++ b/src/libide/terminal/ide-terminal-popover.c
@@ -146,8 +146,6 @@ ide_terminal_popover_context_set_cb (GtkWidget *widget,
{
IdeTerminalPopover *self = (IdeTerminalPopover *)widget;
IdeRuntimeManager *runtime_manager;
- IdeConfigManager *config_manager;
- IdeConfig *config;
g_assert (IDE_IS_TERMINAL_POPOVER (self));
g_assert (!context || IDE_IS_CONTEXT (context));
@@ -155,14 +153,21 @@ ide_terminal_popover_context_set_cb (GtkWidget *widget,
if (context == NULL)
return;
- config_manager = ide_config_manager_from_context (context);
- config = ide_config_manager_get_current (config_manager);
runtime_manager = ide_runtime_manager_from_context (context);
- if (config != NULL)
+ if (ide_context_has_project (context))
{
- g_free (self->selected);
- self->selected = g_strdup (ide_config_get_runtime_id (config));
+ IdeConfigManager *config_manager;
+ IdeConfig *config;
+
+ config_manager = ide_config_manager_from_context (context);
+ config = ide_config_manager_get_current (config_manager);
+
+ if (config != NULL)
+ {
+ g_free (self->selected);
+ self->selected = g_strdup (ide_config_get_runtime_id (config));
+ }
}
g_clear_object (&self->filter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]