summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Wilmet <swilmet@informatique-libre.be>2023-03-21 16:00:00 +0100
committerSébastien Wilmet <swilmet@informatique-libre.be>2023-03-21 16:00:00 +0100
commitc53e862acd41cb9c8a631ee7b17a7621dc934029 (patch)
tree087e4c0e7bb6e10bd212278a83da45829f3dcc33
parentbc5d8516c84cbad9dd423541c3e1a354b558c29d (diff)
downloadgedit-c53e862acd41cb9c8a631ee7b17a7621dc934029.tar.gz
Window: remove create_tab_from_stream()
_gedit_tab_load_stream() will be made public as a further step. The idea is to have smaller functions (smaller number of parameters, doing less things at a time).
-rw-r--r--docs/reference/api-breaks.xml6
-rw-r--r--docs/reference/gedit-sections.txt1
-rw-r--r--gedit/gedit-app.c21
-rw-r--r--gedit/gedit-window.c37
-rw-r--r--gedit/gedit-window.h7
5 files changed, 17 insertions, 55 deletions
diff --git a/docs/reference/api-breaks.xml b/docs/reference/api-breaks.xml
index bb58e3a8b..77865b0aa 100644
--- a/docs/reference/api-breaks.xml
+++ b/docs/reference/api-breaks.xml
@@ -24,6 +24,12 @@
the vapi. The latter is no longer generated.
</para>
</listitem>
+ <listitem>
+ <para>
+ The <code>gedit_window_create_tab_from_stream()</code> function has
+ been removed.
+ </para>
+ </listitem>
</itemizedlist>
</refsect1>
diff --git a/docs/reference/gedit-sections.txt b/docs/reference/gedit-sections.txt
index 22922b4c9..a7f6af280 100644
--- a/docs/reference/gedit-sections.txt
+++ b/docs/reference/gedit-sections.txt
@@ -227,7 +227,6 @@ GeditWindow
GeditWindowState
gedit_window_create_tab
gedit_window_create_tab_from_location
-gedit_window_create_tab_from_stream
gedit_window_close_tab
gedit_window_close_all_tabs
gedit_window_close_tabs
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index b954e9266..2b82df63f 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -43,6 +43,7 @@
#include "gedit-commands.h"
#include "gedit-preferences-dialog.h"
#include "gedit-tab.h"
+#include "gedit-tab-private.h"
#define GEDIT_PAGE_SETUP_FILE "gedit-page-setup"
#define GEDIT_PRINT_SETTINGS_FILE "gedit-print-settings"
@@ -314,19 +315,19 @@ open_files (GApplication *application,
gtk_widget_show (GTK_WIDGET (window));
}
- if (stdin_stream)
+ if (stdin_stream != NULL)
{
gedit_debug_message (DEBUG_APP, "Load stdin");
- tab = gedit_window_create_tab_from_stream (window,
- stdin_stream,
- encoding,
- line_position,
- column_position,
- TRUE);
- doc_created = tab != NULL;
-
- if (doc_created && command_line)
+ tab = gedit_window_create_tab (window, TRUE);
+ _gedit_tab_load_stream (tab,
+ stdin_stream,
+ encoding,
+ line_position,
+ column_position);
+ doc_created = TRUE;
+
+ if (command_line != NULL)
{
set_command_line_wait (GEDIT_APP (application),
tab);
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index e4f0da593..709fb0868 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -2996,43 +2996,6 @@ gedit_window_create_tab_from_location (GeditWindow *window,
}
/**
- * gedit_window_create_tab_from_stream:
- * @window: a #GeditWindow
- * @stream: a #GInputStream
- * @encoding: (allow-none): a #GtkSourceEncoding, or %NULL
- * @line_pos: the line position to visualize
- * @column_pos: the column position to visualize
- * @jump_to: %TRUE to set the new #GeditTab as active
- *
- * Returns: (transfer none): a new #GeditTab
- */
-GeditTab *
-gedit_window_create_tab_from_stream (GeditWindow *window,
- GInputStream *stream,
- const GtkSourceEncoding *encoding,
- gint line_pos,
- gint column_pos,
- gboolean jump_to)
-{
- GeditTab *tab;
-
- gedit_debug (DEBUG_WINDOW);
-
- g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL);
- g_return_val_if_fail (G_IS_INPUT_STREAM (stream), NULL);
-
- tab = gedit_window_create_tab (window, jump_to);
-
- _gedit_tab_load_stream (tab,
- stream,
- encoding,
- line_pos,
- column_pos);
-
- return tab;
-}
-
-/**
* gedit_window_get_active_tab:
* @window: a GeditWindow
*
diff --git a/gedit/gedit-window.h b/gedit/gedit-window.h
index f5ac19886..e5a801b70 100644
--- a/gedit/gedit-window.h
+++ b/gedit/gedit-window.h
@@ -88,13 +88,6 @@ GeditTab *gedit_window_create_tab_from_location (GeditWindow *window
gboolean create,
gboolean jump_to);
-GeditTab *gedit_window_create_tab_from_stream (GeditWindow *window,
- GInputStream *stream,
- const GtkSourceEncoding *encoding,
- gint line_pos,
- gint column_pos,
- gboolean jump_to);
-
void gedit_window_close_tab (GeditWindow *window,
GeditTab *tab);