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 version 2 as published by
9 // the Free Software Foundation and appearing in the file gpl.txt included in the
10 // packaging of this file.
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/>.
23 #include "mediatype.h"
25 Setup::Setup() : EmuFrontObject(), platform(0), mediaType(0)
29 Setup::Setup(int id, Platform *plf, MediaType *mt, QStringList fileTypeExtensions)
32 .arg(plf ? plf->getName() : "")
33 .arg(mt ? mt->getName() : "")), platform(plf), mediaType(mt),
34 fileTypeExtensions(fileTypeExtensions){
44 Setup::Setup(const Setup &s)
46 fileTypeExtensions(s.fileTypeExtensions)
48 Platform *p = s.platform;
49 MediaType *m = s.mediaType;
50 qDebug() << "Setup copy constructor, platform is "
51 << p->getName() << p->getId() << ", mediatype is " << m->getName() << m->getId();
52 platform = new Platform(*p);
53 mediaType = new MediaType(*m);
56 Setup& Setup::operator =(const Setup &sup)
58 if (this == &sup) return *this;
61 if (platform) delete platform;
62 Platform *p = sup.platform;
63 MediaType *m = sup.mediaType;
64 platform = new Platform(*p);
65 if (mediaType) delete mediaType;
66 mediaType = new MediaType(*m);
71 /*bool Setup::operator ==(const Setup &sup)
74 // TODO: more precise ... this is exact copy from EmuFrontObject
75 return (id >= 0 && id == sup.id);
79 bool Setup::operator !=(const Setup &sup)
81 // TODO: more precise ... this is exact copy from EmuFrontObject
82 return !(*this == sup);
85 Platform* Setup::getPlatform() const
87 void Setup::setPlatform(Platform *plf)
90 MediaType* Setup::getMediaType() const
92 void Setup::setMediaType(MediaType *mt)
95 QStringList Setup::getSupportedFileTypeExtensions() const
96 { return fileTypeExtensions; }
97 void Setup::setSupportedFileTypeExtensions(QStringList ftx)
98 { fileTypeExtensions = ftx; }