From 35146ef0c8f72526683f306a07d5cc70a070fe85 Mon Sep 17 00:00:00 2001 From: François Revol Date: Mon, 21 Nov 2016 16:16:34 +0100 Subject: haiku: try to open source in preferred app for source-code first We still fall back to the hardcoded list, but we first check for the user's prefered code editor. --- frontends/beos/gui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'frontends') diff --git a/frontends/beos/gui.cpp b/frontends/beos/gui.cpp index 8c6614d17..254fa9059 100644 --- a/frontends/beos/gui.cpp +++ b/frontends/beos/gui.cpp @@ -877,6 +877,7 @@ void nsbeos_gui_view_source(struct hlcache_handle *content) // apps to try const char *editorSigs[] = { + "text/x-source-code", "application/x-vnd.beunited.pe", "application/x-vnd.XEmacs", "application/x-vnd.Haiku-StyledEdit", @@ -891,10 +892,11 @@ void nsbeos_gui_view_source(struct hlcache_handle *content) BMessenger msgr(editorSigs[i], team); if (msgr.SendMessage(&m) >= B_OK) break; + } err = be_roster->Launch(editorSigs[i], (BMessage *)&m, &team); - if (err >= B_OK) + if (err >= B_OK || err == B_ALREADY_RUNNING) break; } } -- cgit v1.2.3