We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd476c3 commit f62f53fCopy full SHA for f62f53f
Userland/Applications/ImageViewer/ViewWidget.cpp
@@ -6,6 +6,7 @@
6
*/
7
8
#include "ViewWidget.h"
9
+#include <AK/LexicalPath.h>
10
#include <AK/MappedFile.h>
11
#include <AK/StringBuilder.h>
12
#include <LibCore/DirIterator.h>
@@ -63,12 +64,7 @@ void ViewWidget::navigate(Directions direction)
63
64
if (m_path == nullptr)
65
return;
66
- auto parts = m_path.split('/');
67
- parts.remove(parts.size() - 1);
68
- StringBuilder sb;
69
- sb.append("/");
70
- sb.join("/", parts);
71
- auto current_dir = sb.to_string();
+ auto current_dir = LexicalPath(m_path).parent().string();
72
73
if (m_files_in_same_dir.is_empty()) {
74
Core::DirIterator iterator(current_dir, Core::DirIterator::Flags::SkipDots);
0 commit comments