Source code repository is hosted at Gitorious from now on.
[emufront] / src / dataobjects / executable.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 "executable.h"
21 #include "setup.h"
22
23 Executable::Executable() : EmuFrontObject(), executable(""), options(""), setup(0), type(-1) { }
24
25 Executable::Executable(int id, QString name)
26     : EmuFrontObject(id, name), executable(""), options(""), setup(0), type(-1)
27 {}
28
29 Executable::Executable(int id, QString name, QString executable,
30     QString options, Setup* setup, int type)
31     : EmuFrontObject(id, name), executable(executable),
32     options(options), setup(setup), type(type)
33 {}
34
35 Executable::Executable(const Executable &e)
36     : EmuFrontObject(e.id, e.name), executable(e.executable),
37     options(e.options), type(e.type)
38 {
39     Setup *s = e.setup;
40     setup = new Setup(*s);
41 }
42
43 Executable::~Executable()
44 {
45     delete setup;
46 }
47
48 Executable& Executable::operator =(const Executable &e)
49 {
50     if (this == &e) return *this;
51     id = e.id;
52     name = e.name;
53     executable = e.executable;
54     options = e.options;
55     type = e.type;
56     Setup *s = e.setup;
57     if (setup) delete setup;
58     setup = new Setup(*s);
59     return (*this);
60 }
61
62 QString Executable::getExecutable() const
63 { return executable; }
64
65 void Executable::setExecutable(QString e)
66 { executable = e; }
67
68 QString Executable::getOptions() const
69 { return options; }
70
71 void Executable::setOptions(QString o)
72 { options = o; }
73
74 Setup* Executable::getSetup() const
75 { return setup; }
76
77 void Executable::setSetup(Setup* s)
78 { setup = s; }
79
80 int Executable::getType() const
81 { return type; }
82
83 void Executable::setType(int t)
84 { type = t; }