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 // Foobar 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 Foobar. If not, see <http://www.gnu.org/licenses/>.
22 #include "mediatype.h"
24 Setup::Setup() : EmuFrontObject(), platform(0), mediaType(0)
28 Setup::Setup(int id, Platform *plf, MediaType *mt, QStringList fileTypeExtensions)
31 .arg(plf ? plf->getName() : "")
32 .arg(mt ? mt->getName() : "")), platform(plf), mediaType(mt),
33 fileTypeExtensions(fileTypeExtensions){
43 Setup::Setup(const Setup &s)
44 : EmuFrontObject(s.getId(), s.getName()),
45 fileTypeExtensions(s.fileTypeExtensions)
47 Platform *p = s.platform;
48 MediaType *m = s.mediaType;
49 platform = new Platform(*p);
50 mediaType = new MediaType(*m);
53 Setup& Setup::operator =(const Setup &sup)
55 if (this == &sup) return *this;
58 if (platform) delete platform;
59 Platform *p = sup.platform;
60 MediaType *m = sup.mediaType;
61 platform = new Platform(*p);
62 if (mediaType) delete mediaType;
63 mediaType = new MediaType(*m);
67 Platform* Setup::getPlatform() const
69 void Setup::setPlatform(Platform *plf)
72 MediaType* Setup::getMediaType() const
74 void Setup::setMediaType(MediaType *mt)
77 QStringList Setup::getSupportedFileTypeExtensions() const
78 { return fileTypeExtensions; }
79 void Setup::setSupportedFileTypeExtensions(QStringList ftx)
80 { fileTypeExtensions = ftx; }