Implemented Executable editor (for configurating emulators).
[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 as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
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() { }
24
25 Executable::Executable(int id, QString name)
26     : EmuFrontObject(id, name) {}
27
28 Executable::Executable(int id, QString name, QString executable,
29     QString options, Setup*, int type)
30     : EmuFrontObject(id, name), executable(executable),
31     options(options), setup(setup), type(type)
32 {}
33
34 Executable::Executable(const Executable &e)
35     : EmuFrontObject(e.id, e.name), executable(e.executable),
36     options(e.options), type(e.type)
37 {
38     Setup *s = e.setup;
39     setup = new Setup(*s);
40 }
41
42 Executable::~Executable()
43 {
44     delete setup;
45 }
46
47 Executable& Executable::operator =(const Executable &e)
48 {
49     if (this == &e) return *this;
50     id = e.id;
51     name = e.name;
52     executable = e.executable;
53     options = e.options;
54     type = e.type;
55     Setup *s = e.setup;
56     if (setup) delete setup;
57     setup = new Setup(*s);
58     return (*this);
59 }
60
61 QString Executable::getExecutable() const
62 { return executable; }
63
64 void Executable::setExecutable(QString e)
65 { executable = e; }
66
67 QString Executable::getOptions() const
68 { return options; }
69
70 void Executable::setOptions(QString o)
71 { options = o; }
72
73 Setup* Executable::getSetup() const
74 { return setup; }
75
76 void Executable::setSetup(Setup* s)
77 { setup = s; }
78
79 int Executable::getType() const
80 { return type; }
81
82 void Executable::setType(int t)
83 { type = t; }