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 platform = new Platform(*p);
51 mediaType = new MediaType(*m);
54 Setup& Setup::operator =(const Setup &sup)
56 if (this == &sup) return *this;
59 if (platform) delete platform;
60 Platform *p = sup.platform;
61 MediaType *m = sup.mediaType;
62 platform = new Platform(*p);
63 if (mediaType) delete mediaType;
64 mediaType = new MediaType(*m);
69 /*bool Setup::operator ==(const Setup &sup)
72 // TODO: more precise ... this is exact copy from EmuFrontObject
73 return (id >= 0 && id == sup.id);
77 bool Setup::operator !=(const Setup &sup)
79 // TODO: more precise ... this is exact copy from EmuFrontObject
80 return !(*this == sup);
83 Platform* Setup::getPlatform() const
85 void Setup::setPlatform(Platform *plf)
88 MediaType* Setup::getMediaType() const
90 void Setup::setMediaType(MediaType *mt)
93 QStringList Setup::getSupportedFileTypeExtensions() const
94 { return fileTypeExtensions; }
95 void Setup::setSupportedFileTypeExtensions(QStringList ftx)
96 { fileTypeExtensions = ftx; }