From: Mikko Keinänen Date: Thu, 2 Dec 2010 21:27:05 +0000 (+0200) Subject: Cleanup. X-Git-Url: http://vcs.maemo.org/git/?p=emufront;a=commitdiff_plain;h=83e2108756796a55b4a6900ffd0b1066ca9fe74e Cleanup. --- diff --git a/src/db/emufrontfileobjectmodel.cpp b/src/db/emufrontfileobjectmodel.cpp index 6d9b1ad..48c1a6f 100644 --- a/src/db/emufrontfileobjectmodel.cpp +++ b/src/db/emufrontfileobjectmodel.cpp @@ -94,10 +94,9 @@ bool EmuFrontFileObjectModel::setName(int id, const QString &name) bool EmuFrontFileObjectModel::insertRows(int row, int count, const QModelIndex &parent) { if (parent.isValid()) - return false; + return false; // This is a flat model if (rowCount() < row) row = rowCount() + 1; - qDebug() << "Inserting " << count << " rows from row " << row; QSqlQuery q; q.prepare(QString("INSERT INTO %1 (id, name, fileid) " " VALUES (NULL, '', NULL) ").arg(tableName)); diff --git a/src/dialogs/emufrontdatadialog.cpp b/src/dialogs/emufrontdatadialog.cpp index e8ac4e4..61d2557 100644 --- a/src/dialogs/emufrontdatadialog.cpp +++ b/src/dialogs/emufrontdatadialog.cpp @@ -81,13 +81,11 @@ void EmuFrontDataDialog::deleteButtonClicked() void EmuFrontDataDialog::addButtonClicked() { - qDebug() << "Delete button clicked"; - int row = objectList->currentIndex().row(); - if (row == -1) row = 0; + int row = objectList->currentIndex().isValid() ? + objectList->currentIndex().row() : 0; model->insertRows(row, 1); QModelIndex ind = model->index(row, 1); if (!ind.isValid()){ - qDebug() << "Invalid index"; return; } objectList->setCurrentIndex(ind);