diff options
author | speles <speles@mail.ua> | 2021-03-01 23:27:37 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-07 11:00:36 +0100 |
commit | 6e16a5cdfa1b6921185ebb27a41c618f25f269ba (patch) | |
tree | 5c1ba75b0195c0323f530712f6212532cf18fa6f /Userland/Applications/SpaceAnalyzer/main.cpp | |
parent | 50de653cc998ac53901f748ac597c1d38e705938 (diff) | |
download | serenity-6e16a5cdfa1b6921185ebb27a41c618f25f269ba.zip |
Applications: Open folder with pre-selected file where appropriate :^)
Diffstat (limited to 'Userland/Applications/SpaceAnalyzer/main.cpp')
-rw-r--r-- | Userland/Applications/SpaceAnalyzer/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp index fb1892656c..9cd199e2a1 100644 --- a/Userland/Applications/SpaceAnalyzer/main.cpp +++ b/Userland/Applications/SpaceAnalyzer/main.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "TreeMapWidget.h" +#include <AK/LexicalPath.h> #include <AK/Queue.h> #include <AK/QuickSort.h> #include <AK/RefCounted.h> @@ -305,7 +306,8 @@ int main(int argc, char* argv[]) Desktop::Launcher::open(URL::create_with_file_protocol(get_absolute_path_to_selected_node(treemapwidget))); }); auto open_containing_folder_action = GUI::Action::create("Open Containing Folder", { Mod_Ctrl, Key_O }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"), [&](auto&) { - Desktop::Launcher::open(URL::create_with_file_protocol(get_absolute_path_to_selected_node(treemapwidget, false))); + LexicalPath path { get_absolute_path_to_selected_node(treemapwidget) }; + Desktop::Launcher::open(URL::create_with_file_protocol(path.dirname(), path.basename())); }); auto copy_path_action = GUI::Action::create("Copy Path to Clipboard", { Mod_Ctrl, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"), [&](auto&) { GUI::Clipboard::the().set_plain_text(get_absolute_path_to_selected_node(treemapwidget)); |