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