mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:07:45 +00:00
LaunchServer+LibDesktop: Open from mime type
Before, LaunchServer would only open files based on their extension. This wouldn't work if the file had the wrong one.
This commit is contained in:
parent
031322fde3
commit
48766449e5
4 changed files with 65 additions and 12 deletions
|
@ -102,6 +102,17 @@ bool AppFile::run_in_terminal() const
|
|||
return m_config->read_bool_entry("App", "RunInTerminal", false);
|
||||
}
|
||||
|
||||
Vector<String> AppFile::launcher_mime_types() const
|
||||
{
|
||||
Vector<String> mime_types;
|
||||
for (auto& entry : m_config->read_entry("Launcher", "MimeTypes").split(',')) {
|
||||
entry = entry.trim_whitespace();
|
||||
if (!entry.is_empty())
|
||||
mime_types.append(entry);
|
||||
}
|
||||
return mime_types;
|
||||
}
|
||||
|
||||
Vector<String> AppFile::launcher_file_types() const
|
||||
{
|
||||
Vector<String> file_types;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue