//
//
// EmuFront is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// it under the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation and appearing in the file gpl.txt included in the
+// packaging of this file.
//
// EmuFront is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// along with EmuFront. If not, see <http://www.gnu.org/licenses/>.
#include "emufrontfileobject.h"
+#include <QDebug>
EmuFrontFileObject::EmuFrontFileObject()
: EmuFrontObject(-1, ""), file(0) { }
: EmuFrontObject(id, name), file(file) {}
EmuFrontFileObject::EmuFrontFileObject(const EmuFrontFileObject &pl)
- : EmuFrontObject(pl.id, pl.name)
+ : EmuFrontObject(pl)
{
EmuFrontFile *f = pl.file;
- file = new EmuFrontFile(*f);
+ file = f ? new EmuFrontFile(*f) : 0;
}
EmuFrontFileObject::~EmuFrontFileObject()
{
- if (file) delete file;
+ qDebug() << "EmuFrontFileObject " << name << " dying";
+ if (file) qDebug() << "File " << file->getName() << " will also be deleted.";
+ delete file;
}
EmuFrontFileObject& EmuFrontFileObject::operator =(const EmuFrontFileObject &ob)
if (this == &ob) return (*this);
id = ob.id;
name = ob.name;
- if (file) delete file;
+ delete file;
EmuFrontFile *f = ob.file;
file = new EmuFrontFile(*f);
return (*this);