changeset 1742:eb64f542341b

fixed list of possible editors in popup menu
author nadvornik
date Mon, 07 Sep 2009 20:04:22 +0000
parents 77415a49cd99
children 1cc12c4b841a
files src/editors.c src/editors.h src/menu.c
diffstat 3 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/editors.c	Mon Sep 07 19:48:05 2009 +0000
+++ b/src/editors.c	Mon Sep 07 20:04:22 2009 +0000
@@ -319,7 +319,7 @@
 	if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "X-Geeqie-Filter", NULL)) editor->flags |= EDITOR_DEST;
 	if (g_key_file_get_boolean(key_file, DESKTOP_GROUP, "Terminal", NULL)) editor->flags |= EDITOR_TERMINAL;
 	
-	editor->flags |= editor_command_parse(editor, NULL, NULL);
+	editor->flags |= editor_command_parse(editor, NULL, FALSE, NULL);
 
 	if ((editor->flags & EDITOR_NO_PARAM) && !category_geeqie) editor->hidden = TRUE;
 
@@ -639,7 +639,7 @@
 } PathType;
 
 
-static gchar *editor_command_path_parse(const FileData *fd, PathType type, const EditorDescription *editor)
+static gchar *editor_command_path_parse(const FileData *fd, gboolean consider_sidecars, PathType type, const EditorDescription *editor)
 {
 	GString *string;
 	gchar *pathl;
@@ -668,7 +668,7 @@
 					break;
 					}
 
-				work2 = fd->sidecar_files;
+				work2 = consider_sidecars ? fd->sidecar_files : NULL;
 				while (work2)
 					{
 					FileData *sfd = work2->data;
@@ -741,7 +741,7 @@
 }
 
 
-EditorFlags editor_command_parse(const EditorDescription *editor, GList *list, gchar **output)
+EditorFlags editor_command_parse(const EditorDescription *editor, GList *list, gboolean consider_sidecars, gchar **output)
 {
 	EditorFlags flags = 0;
 	const gchar *p;
@@ -818,6 +818,7 @@
 							goto err;
 							}
 						pathl = editor_command_path_parse((FileData *)list->data,
+										  consider_sidecars,
 										  (*p == 'f') ? PATH_FILE : PATH_FILE_URL,
 										  editor);
 						if (!pathl)
@@ -851,7 +852,7 @@
 						while (work)
 							{
 							FileData *fd = work->data;
-							pathl = editor_command_path_parse(fd, (*p == 'F') ? PATH_FILE : PATH_FILE_URL, editor);
+							pathl = editor_command_path_parse(fd, consider_sidecars, (*p == 'F') ? PATH_FILE : PATH_FILE_URL, editor);
 							if (pathl)
 								{
 								ok = TRUE;
@@ -961,7 +962,7 @@
 
 	ed->pid = -1;
 	ed->flags = editor->flags;
-	ed->flags |= editor_command_parse(editor, list, &command);
+	ed->flags |= editor_command_parse(editor, list, TRUE, &command);
 
 	ok = !EDITOR_ERRORS(ed->flags);
 
--- a/src/editors.h	Mon Sep 07 19:48:05 2009 +0000
+++ b/src/editors.h	Mon Sep 07 20:04:22 2009 +0000
@@ -118,7 +118,7 @@
 gboolean is_valid_editor_command(const gchar *key);
 gboolean editor_blocks_file(const gchar *key);
 
-EditorFlags editor_command_parse(const EditorDescription *editor, GList *list, gchar **output);
+EditorFlags editor_command_parse(const EditorDescription *editor, GList *list, gboolean consider_sidecars, gchar **output);
 
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
--- a/src/menu.c	Mon Sep 07 19:48:05 2009 +0000
+++ b/src/menu.c	Mon Sep 07 20:04:22 2009 +0000
@@ -80,7 +80,7 @@
 		work = work->next;
 		gboolean active = TRUE;
 
-		if (fd_list && EDITOR_ERRORS(editor_command_parse(editor, fd_list, NULL)))
+		if (fd_list && EDITOR_ERRORS(editor_command_parse(editor, fd_list, FALSE, NULL)))
 			active = FALSE;
 
 		if (active)