1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

Calendar: Move MonthListModel into Calendar.h

Previously, we had two versions of MonthListModel for the AddEventDialog
and the DatePickerDialog. Now, a unified version is in the Calendar.h
file, which can be used easily by anyone. Since that model and the
MeridiemListModel weren't used anymore in the AddEventDialog, I have
also removed them from there.
This commit is contained in:
david072 2023-11-17 21:10:13 +01:00 committed by Andrew Kaster
parent 5ed334e13a
commit 039114b728
5 changed files with 91 additions and 55 deletions

View file

@ -31,25 +31,6 @@ private:
ErrorOr<void> add_event_to_calendar();
class MonthListModel final : public GUI::Model {
public:
enum Column {
Month,
__Count,
};
static NonnullRefPtr<MonthListModel> create() { return adopt_ref(*new MonthListModel); }
virtual ~MonthListModel() override = default;
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; }
virtual ErrorOr<String> column_name(int) const override;
virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
private:
MonthListModel() = default;
};
class MeridiemListModel final : public GUI::Model {
public:
enum Column {