[gedit/wip/gtkapp] Remove dbus and do not build fifo



commit aaaedb8c1156f81eb567ed8ddc52cc1ca949638d
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat May 5 12:28:17 2012 +0200

    Remove dbus and do not build fifo

 gedit/Makefile.am  |    7 -
 gedit/gedit-dbus.c | 1724 ----------------------------------------------------
 gedit/gedit-dbus.h |   71 ---
 gedit/gedit.c      |  103 ----
 4 files changed, 0 insertions(+), 1905 deletions(-)
---
diff --git a/gedit/Makefile.am b/gedit/Makefile.am
index 066357b..b38502c 100644
--- a/gedit/Makefile.am
+++ b/gedit/Makefile.am
@@ -106,7 +106,6 @@ NOINST_H_FILES =			\
 	gedit-close-button.h		\
 	gedit-close-confirmation-dialog.h \
 	gedit-command-line.h		\
-	gedit-dbus.h			\
 	gedit-dirs.h			\
 	gedit-document-input-stream.h	\
 	gedit-document-loader.h		\
@@ -189,7 +188,6 @@ libgedit_c_files =			\
 	gedit-commands-help.c		\
 	gedit-commands-search.c		\
 	gedit-commands-view.c		\
-	gedit-dbus.c			\
 	gedit-debug.c			\
 	gedit-dirs.c			\
 	gedit-document.c 		\
@@ -240,11 +238,6 @@ if !ENABLE_GVFS_METADATA
 libgedit_la_SOURCES += gedit-metadata-manager.c
 endif
 
-if !PLATFORM_WIN32
-libgedit_la_SOURCES += gedit-fifo.c
-NOINST_H_FILES += gedit-fifo.h
-endif
-
 ENUM_TYPES = 			\
 	gedit-notebook.h	\
 	$(INST_H_FILES)
diff --git a/gedit/gedit.c b/gedit/gedit.c
index b75337c..408a6b6 100644
--- a/gedit/gedit.c
+++ b/gedit/gedit.c
@@ -57,44 +57,6 @@
 #define METADATA_FILE "gedit-metadata.xml"
 #endif
 
-#ifdef G_OS_UNIX
-#include <gio/gunixinputstream.h>
-#include <unistd.h>
-#endif
-
-static gboolean
-gedit_main_load_from_stdin (GeditWindow *window,
-                            gboolean     jump_to)
-{
-#ifdef G_OS_UNIX
-	GInputStream *stream;
-	const GeditEncoding *encoding;
-	gint line_position;
-	gint column_position;
-	GeditCommandLine *command_line;
-
-	command_line = gedit_command_line_get_default ();
-
-	encoding = gedit_command_line_get_encoding (command_line);
-	line_position = gedit_command_line_get_line_position (command_line);
-	column_position = gedit_command_line_get_column_position (command_line);
-
-	/* Construct a stream for stdin */
-	stream = g_unix_input_stream_new (STDIN_FILENO, TRUE);
-
-	gedit_window_create_tab_from_stream (window,
-	                                     stream,
-	                                     encoding,
-	                                     line_position,
-	                                     column_position,
-	                                     jump_to);
-	g_object_unref (stream);
-	return TRUE;
-#else
-	return FALSE;
-#endif
-}
-
 static void
 gedit_main_window (void)
 {
@@ -135,11 +97,6 @@ gedit_main_window (void)
 		g_slist_free (loaded);
 	}
 
-	if (gedit_utils_can_read_from_stdin ())
-	{
-		doc_created = gedit_main_load_from_stdin (window, !doc_created);
-	}
-
 	if (!doc_created || gedit_command_line_get_new_document (command_line))
 	{
 		gedit_debug_message (DEBUG_APP, "Create tab");
@@ -225,15 +182,6 @@ main (int argc, char *argv[])
 	GeditCommandLine *command_line;
 	gboolean ret;
 	gboolean service = FALSE;
-#ifdef G_OS_UNIX
-	GeditDBus *dbus;
-	GeditDBusResult dbusret;
-#endif
-
-#ifdef OS_OSX
-	GPollFunc orig_poll_func;
-	GPollFunc gdk_poll_func;
-#endif
 
 #ifndef ENABLE_GVFS_METADATA
 	const gchar *cache_dir;
@@ -269,10 +217,6 @@ main (int argc, char *argv[])
 	g_free (metadata_filename);
 #endif
 
-#ifdef OS_OSX
-	orig_poll_func = g_main_context_get_poll_func (NULL);
-#endif
-
 	/* Parse command line arguments */
 	command_line = gedit_command_line_get_default ();
 
@@ -284,55 +228,8 @@ main (int argc, char *argv[])
 		return 1;
 	}
 
-#ifdef G_OS_UNIX
-#ifdef OS_OSX
-	/* Note: this is a bit of a hack. What happens here is that we are going to
-	 * store the poll function installed by gdk (happens in post-parse of options)
-	 * and replace it with the original main loop poll handler. We do this because
-	 * the gedit dbus stuff is going to run some main loops to run async gdbus calls.
-	 * The problem is that for OS X, the gdk poll func in the main context (which
-	 * will be run due to the fact that the main loops in our dbus code iterate the
-	 * main context) is going to process events from NSApp, INCLUDING apple events
-	 * such as OpenFiles. Since we are not setup yet, we are going to miss these
-	 * events. By swapping out the gdk poll func, and swapping it back in later,
-	 * we prevent this from happening. Note that we only do this when building
-	 * on OS X to prevent any possible future problems for other platforms.
-	 * This is a dirty hack, but it works for now.
-	 */
-	gdk_poll_func = g_main_context_get_poll_func (NULL);
-	g_main_context_set_poll_func (NULL, orig_poll_func);
-#endif
-
-	/* Run over dbus */
-	dbus = gedit_dbus_new ();
-	dbusret = gedit_dbus_run (dbus);
-
-#ifdef OS_OSX
-	g_main_context_set_poll_func (NULL, gdk_poll_func);
-#endif
-
-	switch (dbusret)
-	{
-		case GEDIT_DBUS_RESULT_SUCCESS:
-		case GEDIT_DBUS_RESULT_FAILED: /* fallthrough */
-			g_object_unref (command_line);
-			g_object_unref (dbus);
-
-			return dbusret == GEDIT_DBUS_RESULT_SUCCESS ? 0 : 1;
-		break;
-		case GEDIT_DBUS_RESULT_PROCEED_SERVICE:
-			service = TRUE;
-		break;
-		case GEDIT_DBUS_RESULT_PROCEED:
-		break;
-	}
-#endif
-
 	gedit_main (service);
 
-#ifdef G_OS_UNIX
-	g_object_unref (dbus);
-#endif
 	g_object_unref (command_line);
 
 	return 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]