summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibDesktop
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2022-10-15 19:07:21 -0600
committerLinus Groh <mail@linusgroh.de>2022-10-17 01:37:58 +0200
commit05e7b338adf20193cad52897f22bab58aaef3d61 (patch)
treef3f1b2b1987df7947ef44e88c5da3c655b2f8a94 /Userland/Libraries/LibDesktop
parent953520df491e0f83204fb2e8d9e4a9e4c7906686 (diff)
downloadserenity-05e7b338adf20193cad52897f22bab58aaef3d61.zip
LibDesktop+Taskbar: Add 'WorkingDirectory' property to app files
Diffstat (limited to 'Userland/Libraries/LibDesktop')
-rw-r--r--Userland/Libraries/LibDesktop/AppFile.cpp7
-rw-r--r--Userland/Libraries/LibDesktop/AppFile.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/Userland/Libraries/LibDesktop/AppFile.cpp b/Userland/Libraries/LibDesktop/AppFile.cpp
index d37a3c4a8e..64910f410b 100644
--- a/Userland/Libraries/LibDesktop/AppFile.cpp
+++ b/Userland/Libraries/LibDesktop/AppFile.cpp
@@ -82,6 +82,11 @@ String AppFile::category() const
return m_config->read_entry("App", "Category").trim_whitespace();
}
+String AppFile::working_directory() const
+{
+ return m_config->read_entry("App", "WorkingDirectory").trim_whitespace();
+}
+
String AppFile::icon_path() const
{
return m_config->read_entry("App", "IconPath").trim_whitespace();
@@ -145,7 +150,7 @@ bool AppFile::spawn() const
if (!is_valid())
return false;
- auto pid = Core::Process::spawn(executable());
+ auto pid = Core::Process::spawn(executable(), Span<String const> {}, working_directory());
if (pid.is_error())
return false;
diff --git a/Userland/Libraries/LibDesktop/AppFile.h b/Userland/Libraries/LibDesktop/AppFile.h
index de0d4d2e0b..9a116fd96c 100644
--- a/Userland/Libraries/LibDesktop/AppFile.h
+++ b/Userland/Libraries/LibDesktop/AppFile.h
@@ -29,6 +29,7 @@ public:
String executable() const;
String category() const;
String description() const;
+ String working_directory() const;
String icon_path() const;
GUI::Icon icon() const;
bool run_in_terminal() const;