summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorSpencer Dixon <spencercdixon@gmail.com>2021-06-21 20:27:02 -0400
committerAndreas Kling <kling@serenityos.org>2021-06-28 16:29:02 +0200
commitb9d1ef99ded6a0003b761210f4b08c99527966af (patch)
tree065a73881376c2b8fc80dafc16ad6908f2976576 /Userland
parentae20c178b98120e2403c80fde4b3e2c7a7df2fea (diff)
downloadserenity-b9d1ef99ded6a0003b761210f4b08c99527966af.zip
Assistant+Taskbar: Use AppFile::spawn() utility
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applications/Assistant/main.cpp1
-rw-r--r--Userland/Services/Taskbar/TaskbarWindow.cpp23
2 files changed, 2 insertions, 22 deletions
diff --git a/Userland/Applications/Assistant/main.cpp b/Userland/Applications/Assistant/main.cpp
index 22e33c397f..3c4c57b24d 100644
--- a/Userland/Applications/Assistant/main.cpp
+++ b/Userland/Applications/Assistant/main.cpp
@@ -121,7 +121,6 @@ public:
void search(String const& query)
{
-
m_app_provider.query(query, [=, this](auto results) {
recv_results(query, results);
});
diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp
index 739249de69..50a2ae7be6 100644
--- a/Userland/Services/Taskbar/TaskbarWindow.cpp
+++ b/Userland/Services/Taskbar/TaskbarWindow.cpp
@@ -331,27 +331,8 @@ void TaskbarWindow::wm_event(GUI::WMEvent& event)
case GUI::Event::WM_SuperSpaceKeyPressed: {
auto af_path = String::formatted("{}/{}", Desktop::AppFile::APP_FILES_DIRECTORY, "Assistant.af");
auto af = Desktop::AppFile::open(af_path);
- if (!af->is_valid()) {
- warnln("invalid app file when trying to open Assistant");
- return;
- }
- auto app_executable = af->executable();
-
- pid_t pid = fork();
- if (pid < 0) {
- perror("fork");
- } else if (pid == 0) {
- if (chdir(Core::StandardPaths::home_directory().characters()) < 0) {
- perror("chdir");
- exit(1);
- }
- execl(app_executable.characters(), app_executable.characters(), nullptr);
- perror("execl");
- VERIFY_NOT_REACHED();
- } else {
- if (disown(pid) < 0)
- perror("disown");
- }
+ if (!af->spawn())
+ warnln("failed to spawn 'Assistant' when requested via Super+Space");
break;
}
default: