LibGUI: Run clang-format on everything.

This commit is contained in:
Andreas Kling 2019-06-07 11:46:02 +02:00
parent bc951ca565
commit 7ad8790d80
Notes: sideshowbarker 2024-07-19 13:41:50 +09:00
43 changed files with 525 additions and 363 deletions

View file

@ -1,17 +1,22 @@
#include <LibGUI/GFileSystemModel.h>
#include <LibCore/CDirIterator.h>
#include <AK/FileSystemPath.h>
#include <AK/StringBuilder.h>
#include <sys/stat.h>
#include <LibCore/CDirIterator.h>
#include <LibGUI/GFileSystemModel.h>
#include <dirent.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
struct GFileSystemModel::Node {
String name;
Node* parent { nullptr };
Vector<Node*> children;
enum Type { Unknown, Directory, File };
enum Type
{
Unknown,
Directory,
File
};
Type type { Unknown };
bool has_traversed { false };
@ -111,15 +116,15 @@ GModelIndex GFileSystemModel::index(const StringView& path) const
}
}
if (!found)
return { };
return {};
}
return { };
return {};
}
String GFileSystemModel::path(const GModelIndex& index) const
{
if (!index.is_valid())
return { };
return {};
auto& node = *(Node*)index.internal_data();
node.reify_if_needed(*this);
return node.full_path(*this);
@ -172,11 +177,11 @@ GModelIndex GFileSystemModel::index(int row, int column, const GModelIndex& pare
GModelIndex GFileSystemModel::parent_index(const GModelIndex& index) const
{
if (!index.is_valid())
return { };
return {};
auto& node = *(const Node*)index.internal_data();
if (!node.parent) {
ASSERT(&node == m_root);
return { };
return {};
}
return node.parent->index(*this);
}
@ -184,7 +189,7 @@ GModelIndex GFileSystemModel::parent_index(const GModelIndex& index) const
GVariant GFileSystemModel::data(const GModelIndex& index, Role role) const
{
if (!index.is_valid())
return { };
return {};
auto& node = *(const Node*)index.internal_data();
if (role == GModel::Role::Display)
return node.name;
@ -196,7 +201,7 @@ GVariant GFileSystemModel::data(const GModelIndex& index, Role role) const
}
return m_file_icon;
}
return { };
return {};
}
int GFileSystemModel::column_count(const GModelIndex&) const