mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 14:05:15 +00:00
This was a workaround to be able to build on case-insensitive file systems where it might get confused about <string.h> vs <String.h>. Let's just not support building that way, so String.h can have an objectively nicer name. :^)
44 lines
1,016 B
C++
44 lines
1,016 B
C++
#pragma once
|
|
|
|
#include <AK/String.h>
|
|
#include <AK/Vector.h>
|
|
#include <LibGUI/GModel.h>
|
|
|
|
class DevicesModel final : public GModel {
|
|
public:
|
|
enum Column {
|
|
Device = 0,
|
|
Major,
|
|
Minor,
|
|
ClassName,
|
|
Type,
|
|
__Count
|
|
};
|
|
|
|
virtual ~DevicesModel() override;
|
|
static NonnullRefPtr<DevicesModel> create();
|
|
|
|
virtual int row_count(const GModelIndex&) const override;
|
|
virtual int column_count(const GModelIndex&) const override;
|
|
virtual String column_name(int column) const override;
|
|
virtual ColumnMetadata column_metadata(int column) const override;
|
|
virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
|
|
virtual void update() override;
|
|
|
|
private:
|
|
DevicesModel();
|
|
|
|
struct DeviceInfo {
|
|
String path;
|
|
unsigned major;
|
|
unsigned minor;
|
|
String class_name;
|
|
enum Type {
|
|
Block,
|
|
Character
|
|
};
|
|
Type type;
|
|
};
|
|
|
|
Vector<DeviceInfo> m_devices;
|
|
};
|