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



commit 153d2849a3d0fdb002dd75b1ad26ca93e5864d4a
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 8145bd6..54a7797 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 6e71518..6658799 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;
@@ -266,10 +214,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 ();
 
@@ -281,55 +225,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]