2 // Copyright 2010 Mikko Keinänen
4 // This file is part of EmuFront.
7 // EmuFront is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // EmuFront is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with EmuFront. If not, see <http://www.gnu.org/licenses/>.
20 #include "mediaimagecontainer.h"
22 MediaImageContainer::MediaImageContainer()
23 : EmuFrontFile(EmuFrontFile::FileType_MediaImageContainer)
25 lstMediaImage = QList<MediaImage*>();
29 MediaImageContainer::MediaImageContainer(int id, QString name, QString checksum, int size, QList<MediaImage *>images, Setup *setup)
30 : EmuFrontFile(id, name, checksum, size, EmuFrontFile::FileType_MediaImageContainer), lstMediaImage(images), setup(setup)
33 MediaImageContainer::MediaImageContainer(QString name, QString checksum, int size, QList<MediaImage *>images, Setup *setup)
34 : EmuFrontFile(-1, name, checksum, size, EmuFrontFile::FileType_MediaImageContainer), lstMediaImage(images), setup(setup)
37 MediaImageContainer::~MediaImageContainer()
39 qDeleteAll(lstMediaImage);
43 MediaImageContainer::MediaImageContainer(MediaImageContainer &mic)
46 lstMediaImage = QList<MediaImage*>();
47 foreach(MediaImage *mi, mic.lstMediaImage)
48 lstMediaImage.append(new MediaImage(*mi));
49 setup = new Setup(*(mic.setup));
52 MediaImageContainer& MediaImageContainer::operator =(MediaImageContainer &mic)
54 if (this == &mic) return *this;
58 checkSum = mic.checkSum;
60 qDeleteAll(lstMediaImage);
61 foreach(MediaImage *mi, mic.lstMediaImage)
62 lstMediaImage.append(new MediaImage(*mi));
63 setup = new Setup(*(mic.setup));
67 void MediaImageContainer::setMediaImages(QList<MediaImage *> list)
69 qDeleteAll(lstMediaImage);
73 QList<MediaImage *> MediaImageContainer::getMediaImages() const
74 { return lstMediaImage; }
76 void MediaImageContainer::addMediaImage(MediaImage *mi)
77 { lstMediaImage.append(mi); }
79 Setup* MediaImageContainer::getSetup() const
82 void MediaImageContainer::setSetup(Setup *s)