summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibDesktop/Launcher.cpp5
-rw-r--r--Libraries/LibDesktop/Launcher.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/Libraries/LibDesktop/Launcher.cpp b/Libraries/LibDesktop/Launcher.cpp
index 8a42beebc8..39b6888810 100644
--- a/Libraries/LibDesktop/Launcher.cpp
+++ b/Libraries/LibDesktop/Launcher.cpp
@@ -44,7 +44,9 @@ auto Launcher::Details::from_details_str(const String& details_str) -> NonnullRe
details->name = obj.get("name").to_string();
if (auto type_value = obj.get_ptr("type")) {
auto type_str = type_value->to_string();
- if (type_str == "userpreferred")
+ if (type_str == "app")
+ details->launcher_type = LauncherType::Application;
+ else if (type_str == "userpreferred")
details->launcher_type = LauncherType::UserPreferred;
else if (type_str == "userdefault")
details->launcher_type = LauncherType::UserDefault;
@@ -83,6 +85,7 @@ bool Launcher::open(const URL& url, const String& handler_name)
bool Launcher::open(const URL& url, const Details& details)
{
+ ASSERT(details.launcher_type != LauncherType::Application); // Launcher should not be used to execute arbitrary applications
return open(url, details.executable);
}
diff --git a/Libraries/LibDesktop/Launcher.h b/Libraries/LibDesktop/Launcher.h
index 0dc0748231..3a42b1ae82 100644
--- a/Libraries/LibDesktop/Launcher.h
+++ b/Libraries/LibDesktop/Launcher.h
@@ -38,6 +38,7 @@ class Launcher {
public:
enum class LauncherType {
Default = 0,
+ Application,
UserPreferred,
UserDefault
};