1 // Copyright 2010 Jochen Becher
3 // This file is part of MovieSchedule.
5 // MovieSchedule is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // MovieSchedule is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with MovieSchedule. If not, see <http://www.gnu.org/licenses/>.
18 #include "scheduleentryitem.h"
20 ScheduleEntryItem::ScheduleEntryItem() :
21 _is_schedule_date_item(false)
25 ScheduleEntryItem::ScheduleEntryItem(QDate schedule_date) :
26 _is_schedule_date_item(true),
27 _schedule_date(schedule_date)
31 ScheduleEntryItem::ScheduleEntryItem(const ScheduleEntry &schedule_entry) :
32 _is_schedule_date_item(false),
33 _schedule_entry(schedule_entry),
34 _movie(*schedule_entry.GetMovie()),
35 _cinema(*schedule_entry.GetCinema())
37 _schedule_entry.SetMovie(&_movie);
38 _schedule_entry.SetCinema(&_cinema);
41 ScheduleEntryItem::ScheduleEntryItem(const ScheduleEntryItem &rhs) :
42 _is_schedule_date_item(rhs._is_schedule_date_item),
43 _schedule_date(rhs._schedule_date),
44 _schedule_entry(rhs._schedule_entry),
48 _schedule_entry.SetMovie(&_movie);
49 _schedule_entry.SetCinema(&_cinema);
52 ScheduleEntryItem &ScheduleEntryItem::operator= (const ScheduleEntryItem &rhs)
55 _is_schedule_date_item = rhs._is_schedule_date_item;
56 _schedule_date = rhs._schedule_date;
57 _schedule_entry = rhs._schedule_entry;
59 _cinema = rhs._cinema;
60 _schedule_entry.SetMovie(&_movie);
61 _schedule_entry.SetCinema(&_cinema);