Patch: Runtime disable remote loaded files



Hello

I happened to need evince not to load files remotely (eg. when you start
second evince, it asks the first one by dbus to open the files and
quits), because it made mozplugger swallowing not work. Disabling dbus
at compile time worked, but I thought it would be better to do it
run-time with a command line switch.

So, here is a patch to allow this. Is the parameter name ok? Or, should
the parameter be put into some other group/have different description?

While implementing this, I noticed a typo in code, fullscren. The second
patch fixes this.

Both of them are against revision 3353, which should be todays.

Are they OK? Could they be applied?

Thank you very much

With regards

-- 
Commenting perl code is useless. You have to fully parse it anyway to find comments.

Michal 'vorner' Vaner
Index: shell/main.c
===================================================================
--- shell/main.c	(revision 3353)
+++ shell/main.c	(working copy)
@@ -45,6 +45,7 @@
 static gboolean fullscren_mode = FALSE;
 static gboolean presentation_mode = FALSE;
 static gboolean unlink_temp_file = FALSE;
+static gboolean remote_disabled = FALSE;
 static gchar   *print_settings;
 static const char **file_arguments = NULL;
 
@@ -57,6 +58,7 @@
 	{ "find", 'l', 0, G_OPTION_ARG_STRING, &ev_find_string, N_("The word or phrase to find in the document"), N_("STRING")},
 	{ "unlink-tempfile", 'u', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &unlink_temp_file, NULL, NULL },
 	{ "print-settings", 't', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &print_settings, NULL, NULL },
+	{ "no-remote", 0, 0, G_OPTION_ARG_NONE, &remote_disabled, N_("Do not use dbus remote mode (each call means new process)"), NULL },
 	{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &file_arguments, NULL, N_("[FILE...]") },
 	{ NULL }
 };
@@ -353,14 +355,17 @@
 	args = arguments_parse ();
 
 #ifdef ENABLE_DBUS
-	if (!ev_application_register_service (EV_APP)) {
-		if (load_files_remote (file_arguments, args)) {
-			g_hash_table_destroy (args);
+	if (!remote_disabled)
+	{
+		if (!ev_application_register_service (EV_APP)) {
+			if (load_files_remote (file_arguments, args)) {
+				g_hash_table_destroy (args);
 
-			return 0;
+				return 0;
+			}
+		} else {
+			enable_metadata = TRUE;
 		}
-	} else {
-		enable_metadata = TRUE;
 	}
 #endif /* ENABLE_DBUS */
 
Index: shell/main.c
===================================================================
--- shell/main.c	(revision 3353)
+++ shell/main.c	(working copy)
@@ -42,7 +42,7 @@
 static gchar   *ev_page_label;
 static gchar   *ev_find_string;
 static gboolean preview_mode = FALSE;
-static gboolean fullscren_mode = FALSE;
+static gboolean fullscreen_mode = FALSE;
 static gboolean presentation_mode = FALSE;
 static gboolean unlink_temp_file = FALSE;
 static gchar   *print_settings;
@@ -51,7 +51,7 @@
 static const GOptionEntry goption_options[] =
 {
 	{ "page-label", 'p', 0, G_OPTION_ARG_STRING, &ev_page_label, N_("The page of the document to display."), N_("PAGE")},
-	{ "fullscreen", 'f', 0, G_OPTION_ARG_NONE, &fullscren_mode, N_("Run evince in fullscreen mode"), NULL },
+	{ "fullscreen", 'f', 0, G_OPTION_ARG_NONE, &fullscreen_mode, N_("Run evince in fullscreen mode"), NULL },
 	{ "presentation", 's', 0, G_OPTION_ARG_NONE, &presentation_mode, N_("Run evince in presentation mode"), NULL },
 	{ "preview", 'w', 0, G_OPTION_ARG_NONE, &preview_mode, N_("Run evince as a previewer"), NULL },
 	{ "find", 'l', 0, G_OPTION_ARG_STRING, &ev_find_string, N_("The word or phrase to find in the document"), N_("STRING")},
@@ -140,7 +140,7 @@
 		ev_page_label = NULL;
 	}
 
-	if (fullscren_mode)
+	if (fullscreen_mode)
 		mode = EV_WINDOW_MODE_FULLSCREEN;
 	else if (presentation_mode)
 		mode = EV_WINDOW_MODE_PRESENTATION;

Attachment: pgpIjNIb1OAwV.pgp
Description: PGP signature



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