mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03:00
FileManager: Make DirectoryView API's take String instead of StringView
This commit is contained in:
parent
1f684c8123
commit
0528dc9b87
Notes:
sideshowbarker
2024-07-18 19:32:42 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0528dc9b876
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user