Downgraded GPL license from v3 to v2 to be compatible with OSDaB-ZIP
[emufront] / src / dataobjects / filepathobject.cpp
1 // EmuFront
2 // Copyright 2010 Mikko Keinänen
3 //
4 // This file is part of EmuFront.
5 //
6 //
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.
11 //
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.
16 //
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/>.
19
20 #include "filepathobject.h"
21 #include "setup.h"
22
23 FilePathObject::FilePathObject() : EmuFrontObject(), setup(0)
24 { }
25
26 FilePathObject::FilePathObject(int id, QString name, int filetype)
27     : EmuFrontObject(id, name), type(filetype), setup(0) {}
28
29  FilePathObject::FilePathObject(int id, QString name, int filetype, Setup *setup)
30     : EmuFrontObject(id, name), type(filetype), setup(setup) {}
31
32 FilePathObject::~FilePathObject()
33 {
34     if (setup) delete setup;
35 }
36
37 FilePathObject::FilePathObject(const FilePathObject &fpobj)
38     : EmuFrontObject(fpobj.id, fpobj.name), type(fpobj.type)
39 {
40     Setup *s = fpobj.setup;
41     setup = new Setup(*s);
42 }
43
44 FilePathObject& FilePathObject::operator =(const FilePathObject &fpobj)
45 {
46     if (this == &fpobj) return *this;
47     id = fpobj.id;
48     name = fpobj.name;
49     type = fpobj.type;
50     if (setup) delete setup;
51     Setup *sup = fpobj.setup;
52     setup = new Setup(*sup);
53     return (*this);
54 }
55
56 Setup* FilePathObject::getSetup() const
57 { return setup; }
58 void FilePathObject::setSetup(Setup *sup)
59 { setup = sup; }
60
61 int FilePathObject::getType() const
62 { return type; }
63 void FilePathObject::setType(int t)
64 { type = t; }