Added a QList for editable column indexes. bool ok gets false in default
[emufront] / src / models / filepathmodel.cpp
index 3f38bb5..6462527 100644 (file)
@@ -1,21 +1,23 @@
-// EmuFront
-// Copyright 2010 Mikko Keinänen
-//
-// This file is part of EmuFront.
-//
-//
-// EmuFront is free software: you can redistribute it and/or modify
-// 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with EmuFront.  If not, see <http://www.gnu.org/licenses/>.
+/*
+** EmuFront
+** Copyright 2010 Mikko Keinänen
+**
+** This file is part of EmuFront.
+**
+**
+** EmuFront is free software: you can redistribute it and/or modify
+** 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
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with EmuFront.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
 #include "filepathmodel.h"
 #include "emufrontfile.h"
@@ -88,6 +90,7 @@ bool FilePathModel::setData(const QModelIndex &index, const QVariant &value, int
         ok = setFilePath(id, value.toString());
         break;
     default:
+        ok = false;
         qDebug() << "File path model, this shouldn't be happening!";
     }
     refresh();
@@ -122,7 +125,7 @@ bool FilePathModel::insertRows(int row, int count, const QModelIndex &parent)
         "VALUES (NULL, '', :filetype, :setupid, :lastscanned )"));
     beginInsertRows(QModelIndex(), row, row + count - 1);
     for(int i = 0; i < count; ++i) {
-        q.bindValue(":filetype", EmuFrontFile::FileType_MediaImage);
+        q.bindValue(":filetype", EmuFrontFile::FileType_MediaImageContainer);
         q.bindValue(":setupid", supId);
         q.bindValue(":lastscanned", 0);
         if (!q.exec()) {