FileManager: Make DirectoryView API's take String instead of StringView

This commit is contained in:
Andreas Kling 2021-04-17 00:46:13 +02:00
parent 1f684c8123
commit 0528dc9b87
Notes: sideshowbarker 2024-07-18 19:32:42 +09:00
2 changed files with 5 additions and 5 deletions

View File

@ -392,7 +392,7 @@ void DirectoryView::set_view_mode(ViewMode mode)
VERIFY_NOT_REACHED();
}
void DirectoryView::add_path_to_history(const StringView& path)
void DirectoryView::add_path_to_history(String path)
{
if (m_path_history.size() && m_path_history.at(m_path_history_position) == path)
return;
@ -400,11 +400,11 @@ void DirectoryView::add_path_to_history(const StringView& path)
if (m_path_history_position < m_path_history.size())
m_path_history.resize(m_path_history_position + 1);
m_path_history.append(path);
m_path_history.append(move(path));
m_path_history_position = m_path_history.size() - 1;
}
void DirectoryView::open(const StringView& path)
void DirectoryView::open(String const& path)
{
auto real_path = Core::File::real_path_for(path);

View File

@ -67,7 +67,7 @@ public:
virtual ~DirectoryView() override;
void open(const StringView& path);
void open(String const& path);
String path() const { return model().root_path(); }
void open_parent_directory();
void open_previous_directory();
@ -173,7 +173,7 @@ private:
NonnullRefPtr<GUI::SortingProxyModel> m_sorting_model;
size_t m_path_history_position { 0 };
Vector<String> m_path_history;
void add_path_to_history(const StringView& path);
void add_path_to_history(String);
RefPtr<GUI::Label> m_error_label;