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.
This commit is contained in:
François Revol 2016-11-21 16:16:34 +01:00
parent bcce8cc7b4
commit 35146ef0c8

View File

@ -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;
}
}