Fixed searchclients to handle new Google URLs correctly; added GUI
[movie-schedule] / src / ui / scheduleentryitem.cpp
1 // Copyright 2010 Jochen Becher
2 //
3 // This file is part of MovieSchedule.
4 //
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.
9 //
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.
14 //
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/>.
17
18 #include "scheduleentryitem.h"
19
20 ScheduleEntryItem::ScheduleEntryItem() :
21         _is_schedule_date_item(false)
22 {
23 }
24
25 ScheduleEntryItem::ScheduleEntryItem(QDate schedule_date) :
26         _is_schedule_date_item(true),
27         _schedule_date(schedule_date)
28 {
29 }
30
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())
36 {
37     _schedule_entry.SetMovie(&_movie);
38     _schedule_entry.SetCinema(&_cinema);
39 }
40
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),
45         _movie(rhs._movie),
46         _cinema(rhs._cinema)
47 {
48     _schedule_entry.SetMovie(&_movie);
49     _schedule_entry.SetCinema(&_cinema);
50 }
51
52 ScheduleEntryItem &ScheduleEntryItem::operator= (const ScheduleEntryItem &rhs)
53 {
54     if (this != &rhs) {
55         _is_schedule_date_item = rhs._is_schedule_date_item;
56         _schedule_date = rhs._schedule_date;
57         _schedule_entry = rhs._schedule_entry;
58         _movie = rhs._movie;
59         _cinema = rhs._cinema;
60         _schedule_entry.SetMovie(&_movie);
61         _schedule_entry.SetCinema(&_cinema);
62     }
63     return *this;
64 }