mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 06:37:36 +00:00
FileManager: Don't show "." and ".." in directory views.
This commit is contained in:
parent
f18ed4f633
commit
900a3966e2
2 changed files with 3 additions and 1 deletions
|
@ -227,6 +227,8 @@ void DirectoryModel::update()
|
||||||
while (auto* de = readdir(dirp)) {
|
while (auto* de = readdir(dirp)) {
|
||||||
Entry entry;
|
Entry entry;
|
||||||
entry.name = de->d_name;
|
entry.name = de->d_name;
|
||||||
|
if (entry.name == "." || entry.name == "..")
|
||||||
|
continue;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int rc = lstat(String::format("%s/%s", m_path.characters(), de->d_name).characters(), &st);
|
int rc = lstat(String::format("%s/%s", m_path.characters(), de->d_name).characters(), &st);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ DirectoryView::DirectoryView(GWidget* parent)
|
||||||
m_table_view = new GTableView(this);
|
m_table_view = new GTableView(this);
|
||||||
m_table_view->set_model(GSortingProxyModel::create(m_model.copy_ref()));
|
m_table_view->set_model(GSortingProxyModel::create(m_model.copy_ref()));
|
||||||
|
|
||||||
model().set_key_column_and_sort_order(DirectoryModel::Column::Name, GSortOrder::Ascending);
|
m_table_view->model()->set_key_column_and_sort_order(DirectoryModel::Column::Name, GSortOrder::Ascending);
|
||||||
|
|
||||||
m_item_view->set_model_column(DirectoryModel::Column::Name);
|
m_item_view->set_model_column(DirectoryModel::Column::Name);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue