Data object removal implemented in the db layer. UI refreshing added
[emufront] / src / db / dbemufrontfileobject.cpp
index 4a411a7..0ee19a5 100644 (file)
@@ -5,9 +5,9 @@
 //
 //
 // 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
@@ -99,15 +99,10 @@ bool DbEmuFrontFileObject::deleteDataObject(int id) const
 
 }
 
-int DbEmuFrontFileObject::countDataObjectRefs(int id) const
-{
-    return 0; // TODO
-    // return countRows("imagecontainer", "platformid", id);
-}
-
 // WARNING: this will delete also all the databindings to selected platform
 bool DbEmuFrontFileObject::deleteDataObjectFromModel(QModelIndex *index)
 {
+    // TODO
     return false;
     //QSqlDatabase::database().transaction();
     //QSqlTableModel *tmodel = dynamic_cast<QSqlTableModel*>(sqlTableModel);
@@ -174,3 +169,8 @@ QSqlQueryModel* DbEmuFrontFileObject::getData()
     model->setHeaderData(EmuFrontFileObject_FileUpdateTime, Qt::Horizontal, tr("File update time"));*/
     return model;
 }
+
+QString DbEmuFrontFileObject::getDeleteObjectSql() const
+{
+    return QString("DELETE FROM %1 WHERE id=:id").arg(tableName);
+}