[gedit/wip/gtkapp: 18/19] Add support for stdin
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/gtkapp: 18/19] Add support for stdin
- Date: Sat, 17 Nov 2012 11:45:18 +0000 (UTC)
commit 2af7ba7cda9c6023c76fd6b695578ad3319645c0
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Jul 31 17:21:50 2012 +0200
Add support for stdin
gedit/gedit-app.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index 52b3fb7..a9a1c48 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -38,6 +38,7 @@
#include <locale.h>
#include <glib/gi18n.h>
+#include <glib.h>
#include <libpeas/peas-extension-set.h>
#include <gtksourceview/gtksourcestyleschememanager.h>
@@ -114,6 +115,7 @@ static gboolean background = FALSE;
static gboolean standalone = FALSE;
static gchar **remaining_args = NULL;
static const GeditEncoding *encoding = NULL;
+static GInputStream *stdin_stream = NULL;
static const GOptionEntry options[] =
{
@@ -561,6 +563,16 @@ gedit_app_activate (GApplication *application)
g_slist_free (loaded);
}
+ if (stdin_stream)
+ {
+ doc_created = gedit_window_create_tab_from_stream (window,
+ stdin_stream,
+ encoding,
+ line_position,
+ column_position,
+ TRUE) != NULL;
+ }
+
if (!doc_created || new_document)
{
gedit_debug_message (DEBUG_APP, "Create tab");
@@ -646,6 +658,8 @@ gedit_app_command_line (GApplication *application,
g_free (encoding_charset);
}
+ stdin_stream = g_application_command_line_get_stdin (command_line);
+
gedit_app_activate (application);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]