Mercurial > geeqie
diff src/editors.c @ 731:fa8f7d7396cf
Introduce an helper function that returns the name of an editor.
It helps to reduce code redundancy.
author | zas_ |
---|---|
date | Thu, 22 May 2008 09:12:36 +0000 |
parents | 2d8a8e892b5e |
children | 8a8873e7a552 |
line wrap: on
line diff
--- a/src/editors.c Thu May 22 08:49:52 2008 +0000 +++ b/src/editors.c Thu May 22 09:12:36 2008 +0000 @@ -866,3 +866,13 @@ if (flags & EDITOR_ERROR_SKIPPED) return _("File was skipped."); return _("Unknown error."); } + +const gchar *editor_get_name(gint n) +{ + if (!is_valid_editor_command(n)) return NULL; + + if (options->editor[n].name && strlen(options->editor[n].name) > 0) + return options->editor[n].name; + + return _("(unknown)"); +}