mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
ImageViewer: Use LexicalPath to grab current_dir
This commit is contained in:
parent
dd476c35cb
commit
f62f53f723
Notes:
sideshowbarker
2024-07-18 10:02:13 +09:00
Author: https://github.com/abyesilyurt
Commit: f62f53f723
Pull-request: https://github.com/SerenityOS/serenity/pull/8570
1 changed files with 2 additions and 6 deletions
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "ViewWidget.h"
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/MappedFile.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
|
@ -63,12 +64,7 @@ void ViewWidget::navigate(Directions direction)
|
|||
if (m_path == nullptr)
|
||||
return;
|
||||
|
||||
auto parts = m_path.split('/');
|
||||
parts.remove(parts.size() - 1);
|
||||
StringBuilder sb;
|
||||
sb.append("/");
|
||||
sb.join("/", parts);
|
||||
auto current_dir = sb.to_string();
|
||||
auto current_dir = LexicalPath(m_path).parent().string();
|
||||
|
||||
if (m_files_in_same_dir.is_empty()) {
|
||||
Core::DirIterator iterator(current_dir, Core::DirIterator::Flags::SkipDots);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue