diff options
author | demostanis <demostanis@protonmail.com> | 2022-07-22 18:03:22 +0200 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-07-27 17:11:25 +0100 |
commit | 48766449e5f0385476d21299eb9190bbc4bd2a15 (patch) | |
tree | b12c67684fc22ed7a542d9f6b3fc27fd9f768201 /Userland/Services/LaunchServer/Launcher.h | |
parent | 031322fde39b83f5d2427a8d78b21df7f16543bd (diff) | |
download | serenity-48766449e5f0385476d21299eb9190bbc4bd2a15.zip |
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.
Diffstat (limited to 'Userland/Services/LaunchServer/Launcher.h')
-rw-r--r-- | Userland/Services/LaunchServer/Launcher.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Services/LaunchServer/Launcher.h b/Userland/Services/LaunchServer/Launcher.h index e9f918775e..8662e43ac0 100644 --- a/Userland/Services/LaunchServer/Launcher.h +++ b/Userland/Services/LaunchServer/Launcher.h @@ -24,6 +24,7 @@ struct Handler { Type handler_type; String name; String executable; + HashTable<String> mime_types {}; HashTable<String> file_types {}; HashTable<String> protocols {}; @@ -47,7 +48,9 @@ private: HashMap<String, Handler> m_handlers; HashMap<String, String> m_protocol_handlers; HashMap<String, String> m_file_handlers; + HashMap<String, String> m_mime_handlers; + Optional<String> mime_type_for_file(String path); Handler get_handler_for_executable(Handler::Type, String const&) const; void for_each_handler(String const& key, HashMap<String, String>& user_preferences, Function<bool(Handler const&)> f); void for_each_handler_for_path(String const&, Function<bool(Handler const&)> f); |