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