summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibDesktop/AppFile.cpp
diff options
context:
space:
mode:
authordemostanis <demostanis@protonmail.com>2022-07-22 18:03:22 +0200
committerSam Atkins <atkinssj@gmail.com>2022-07-27 17:11:25 +0100
commit48766449e5f0385476d21299eb9190bbc4bd2a15 (patch)
treeb12c67684fc22ed7a542d9f6b3fc27fd9f768201 /Userland/Libraries/LibDesktop/AppFile.cpp
parent031322fde39b83f5d2427a8d78b21df7f16543bd (diff)
downloadserenity-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/Libraries/LibDesktop/AppFile.cpp')
-rw-r--r--Userland/Libraries/LibDesktop/AppFile.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Libraries/LibDesktop/AppFile.cpp b/Userland/Libraries/LibDesktop/AppFile.cpp
index 1b7e0c9920..1ef20f3986 100644
--- a/Userland/Libraries/LibDesktop/AppFile.cpp
+++ b/Userland/Libraries/LibDesktop/AppFile.cpp
@@ -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;