[gnome-builder/wip/libide-merge] workbench: add gb_workbench_add_temporary_file()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide-merge] workbench: add gb_workbench_add_temporary_file()
- Date: Mon, 23 Mar 2015 10:15:00 +0000 (UTC)
commit 0d253554ae4067e23884496c6caa4696d5edc316
Author: Christian Hergert <christian hergert me>
Date: Mon Mar 23 02:58:11 2015 -0700
workbench: add gb_workbench_add_temporary_file()
src/workbench/gb-workbench-actions.c | 7 +------
src/workbench/gb-workbench.c | 14 ++++++++++++++
src/workbench/gb-workbench.h | 1 +
3 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/src/workbench/gb-workbench-actions.c b/src/workbench/gb-workbench-actions.c
index 3d6a844..f74db96 100644
--- a/src/workbench/gb-workbench-actions.c
+++ b/src/workbench/gb-workbench-actions.c
@@ -55,15 +55,10 @@ gb_workbench_actions_new_document (GSimpleAction *action,
gpointer user_data)
{
GbWorkbench *self = user_data;
- IdeContext *context;
- IdeBufferManager *buffer_manager;
- g_autoptr(IdeBuffer) buffer = NULL;
g_assert (GB_IS_WORKBENCH (self));
- context = gb_workbench_get_context (self);
- buffer_manager = ide_context_get_buffer_manager (context);
- buffer = ide_buffer_manager_create_buffer (buffer_manager);
+ gb_workbench_add_temporary_buffer (self);
}
static void
diff --git a/src/workbench/gb-workbench.c b/src/workbench/gb-workbench.c
index 9d0c640..a2dc24f 100644
--- a/src/workbench/gb-workbench.c
+++ b/src/workbench/gb-workbench.c
@@ -749,3 +749,17 @@ gb_workbench_build_finish (GbWorkbench *self,
return g_task_propagate_boolean (task, error);
}
+
+void
+gb_workbench_add_temporary_buffer (GbWorkbench *self)
+{
+ IdeContext *context;
+ IdeBufferManager *buffer_manager;
+ g_autoptr(IdeBuffer) buffer = NULL;
+
+ g_return_if_fail (GB_IS_WORKBENCH (self));
+
+ context = gb_workbench_get_context (self);
+ buffer_manager = ide_context_get_buffer_manager (context);
+ buffer = ide_buffer_manager_create_buffer (buffer_manager);
+}
diff --git a/src/workbench/gb-workbench.h b/src/workbench/gb-workbench.h
index 8f0d65e..dc72648 100644
--- a/src/workbench/gb-workbench.h
+++ b/src/workbench/gb-workbench.h
@@ -43,6 +43,7 @@ IdeContext *gb_workbench_get_context (GbWorkbench *self);
GbWorkspace *gb_workbench_get_active_workspace (GbWorkbench *self);
void gb_workbench_set_active_workspace (GbWorkbench *self,
GbWorkspace *workspace);
+void gb_workbench_add_temporary_buffer (GbWorkbench *self);
void gb_workbench_open (GbWorkbench *self,
GFile *file);
void gb_workbench_open_uri_list (GbWorkbench *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]