1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:37:35 +00:00

FileManager+LaunchServer: Add launching FileManager with focus on file

This commit is contained in:
speles 2021-02-28 20:54:03 +02:00 committed by Andreas Kling
parent aa9c5d4418
commit e964d238b8
2 changed files with 20 additions and 5 deletions

View file

@ -298,8 +298,12 @@ bool Launcher::open_file_url(const URL& url)
}
// TODO: Make directory opening configurable
if (S_ISDIR(st.st_mode))
return spawn("/bin/FileManager", { url.path() });
if (S_ISDIR(st.st_mode)) {
Vector<String> fm_arguments { url.path() };
if (!url.fragment().is_empty())
fm_arguments.append(url.fragment());
return spawn("/bin/FileManager", fm_arguments);
}
if ((st.st_mode & S_IFMT) == S_IFREG && st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))
return spawn(url.path(), {});