From 807101e394d08833c2e63ad41f1dfe7217af3079 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Mon, 18 Apr 2022 12:06:46 +0200 Subject: [PATCH] ThemeEditor: Remove unused model classes They have been replaced by generic RoleModel class. --- Userland/Applications/ThemeEditor/main.cpp | 90 ---------------------- 1 file changed, 90 deletions(-) diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp index 4bcf3a5fed..b6397862b1 100644 --- a/Userland/Applications/ThemeEditor/main.cpp +++ b/Userland/Applications/ThemeEditor/main.cpp @@ -58,24 +58,6 @@ private: } }; -class ColorRoleModel final : public GUI::ItemListModel { -public: - explicit ColorRoleModel(Vector const& data) - : ItemListModel(data) - { - } - - virtual GUI::Variant data(GUI::ModelIndex const& index, GUI::ModelRole role) const override - { - if (role == GUI::ModelRole::Display) - return Gfx::to_string(m_data[(size_t)index.row()]); - if (role == GUI::ModelRole::Custom) - return m_data[(size_t)index.row()]; - - return ItemListModel::data(index, role); - } -}; - struct AlignmentValue { String title; Gfx::TextAlignment setting_value; @@ -110,78 +92,6 @@ private: Vector m_alignments; }; -class AlignmentRoleModel final : public GUI::ItemListModel { -public: - explicit AlignmentRoleModel(Vector const& data) - : ItemListModel(data) - { - } - - virtual GUI::Variant data(GUI::ModelIndex const& index, GUI::ModelRole role) const override - { - if (role == GUI::ModelRole::Display) - return Gfx::to_string(m_data[(size_t)index.row()]); - if (role == GUI::ModelRole::Custom) - return m_data[(size_t)index.row()]; - - return ItemListModel::data(index, role); - } -}; - -class FlagRoleModel final : public GUI::ItemListModel { -public: - explicit FlagRoleModel(Vector const& data) - : ItemListModel(data) - { - } - - virtual GUI::Variant data(GUI::ModelIndex const& index, GUI::ModelRole role) const override - { - if (role == GUI::ModelRole::Display) - return Gfx::to_string(m_data[(size_t)index.row()]); - if (role == GUI::ModelRole::Custom) - return m_data[(size_t)index.row()]; - - return ItemListModel::data(index, role); - } -}; - -class MetricRoleModel final : public GUI::ItemListModel { -public: - explicit MetricRoleModel(Vector const& data) - : ItemListModel(data) - { - } - - virtual GUI::Variant data(GUI::ModelIndex const& index, GUI::ModelRole role) const override - { - if (role == GUI::ModelRole::Display) - return Gfx::to_string(m_data[(size_t)index.row()]); - if (role == GUI::ModelRole::Custom) - return m_data[(size_t)index.row()]; - - return ItemListModel::data(index, role); - } -}; - -class PathRoleModel final : public GUI::ItemListModel { -public: - explicit PathRoleModel(Vector const& data) - : ItemListModel(data) - { - } - - virtual GUI::Variant data(GUI::ModelIndex const& index, GUI::ModelRole role) const override - { - if (role == GUI::ModelRole::Display) - return Gfx::to_string(m_data[(size_t)index.row()]); - if (role == GUI::ModelRole::Custom) - return m_data[(size_t)index.row()]; - - return ItemListModel::data(index, role); - } -}; - ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio recvfd sendfd thread rpath cpath wpath unix"));