feat: support set application's working directory
Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
@ -141,13 +141,14 @@ int processExecStart(msg_ptr &msg, const std::deque<std::string_view> &execArgs)
|
||||
|
||||
DBusValueType getPropType(std::string_view key)
|
||||
{
|
||||
static std::unordered_map<std::string_view, DBusValueType> map{{"Environment", DBusValueType::ArrayOfString}};
|
||||
static std::unordered_map<std::string_view, DBusValueType> map{{"Environment", DBusValueType::ArrayOfString},
|
||||
{"WorkingDirectory", DBusValueType::String}};
|
||||
|
||||
if (auto it = map.find(key); it != map.cend()) {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return DBusValueType::Default;
|
||||
return DBusValueType::String; // fallback to string
|
||||
}
|
||||
|
||||
int appendPropValue(msg_ptr &msg, DBusValueType type, std::string_view value)
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
enum class ExitCode { SystemdError = -3, InvalidInput = -2, InternalError = -1, Done = 0, Waiting = 1 };
|
||||
|
||||
enum class DBusValueType { Default, ArrayOfString };
|
||||
enum class DBusValueType { String, ArrayOfString };
|
||||
|
||||
using msg_ptr = sd_bus_message *;
|
||||
using bus_ptr = sd_bus *;
|
||||
|
@ -8,7 +8,7 @@
|
||||
std::unique_ptr<VariantValue> creatValueHandler(msg_ptr &msg, DBusValueType type)
|
||||
{
|
||||
switch (type) {
|
||||
case DBusValueType::Default:
|
||||
case DBusValueType::String:
|
||||
return std::make_unique<StringValue>(msg);
|
||||
case DBusValueType::ArrayOfString:
|
||||
return std::make_unique<ASValue>(msg);
|
||||
|
Reference in New Issue
Block a user