3 ** Copyright 2010 Mikko Keinänen
5 ** This file is part of EmuFront.
8 ** EmuFront is free software: you can redistribute it and/or modify
9 ** it under the terms of the GNU General Public License version 2 as published by
10 ** the Free Software Foundation and appearing in the file gpl.txt included in the
11 ** packaging of this file.
13 ** EmuFront is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ** GNU General Public License for more details.
18 ** You should have received a copy of the GNU General Public License
19 ** along with EmuFront. If not, see <http://www.gnu.org/licenses/>.
24 #include "mediatype.h"
26 Setup::Setup() : EmuFrontObject(), platform(0), mediaType(0)
30 Setup::Setup(int id, Platform *plf, MediaType *mt, QStringList fileTypeExtensions)
33 .arg(plf ? plf->getName() : "")
34 .arg(mt ? mt->getName() : "")), platform(plf), mediaType(mt),
35 fileTypeExtensions(fileTypeExtensions){
45 Setup::Setup(const Setup &s)
47 fileTypeExtensions(s.fileTypeExtensions)
49 Platform *p = s.platform;
50 MediaType *m = s.mediaType;
51 platform = new Platform(*p);
52 mediaType = new MediaType(*m);
55 Setup& Setup::operator =(const Setup &sup)
57 if (this == &sup) return *this;
60 if (platform) delete platform;
61 Platform *p = sup.platform;
62 MediaType *m = sup.mediaType;
63 platform = new Platform(*p);
64 if (mediaType) delete mediaType;
65 mediaType = new MediaType(*m);
70 /*bool Setup::operator ==(const Setup &sup)
73 // TODO: more precise ... this is exact copy from EmuFrontObject
74 return (id >= 0 && id == sup.id);
78 bool Setup::operator !=(const Setup &sup)
80 // TODO: more precise ... this is exact copy from EmuFrontObject
81 return !(*this == sup);
84 Platform* Setup::getPlatform() const
86 void Setup::setPlatform(Platform *plf)
89 MediaType* Setup::getMediaType() const
91 void Setup::setMediaType(MediaType *mt)
94 QStringList Setup::getSupportedFileTypeExtensions() const
95 { return fileTypeExtensions; }
96 void Setup::setSupportedFileTypeExtensions(QStringList ftx)
97 { fileTypeExtensions = ftx; }