diff data/model/ModelDataTableModel.cpp @ 421:397fe91dc8e0

* Fix for data modification in data edit view... now why isn't the command appearing on the undo menu?
author Chris Cannam
date Wed, 11 Jun 2008 17:00:04 +0000
parents 50a956688baa
children 4caa28a0a8a2
line wrap: on
line diff
--- a/data/model/ModelDataTableModel.cpp	Wed Jun 11 16:13:25 2008 +0000
+++ b/data/model/ModelDataTableModel.cpp	Wed Jun 11 17:00:04 2008 +0000
@@ -22,7 +22,9 @@
 #include <iostream>
 
 ModelDataTableModel::ModelDataTableModel(TabularModel *m) :
-    m_model(m)
+    m_model(m),
+    m_sortColumn(0),
+    m_sortOrdering(Qt::AscendingOrder)
 {
     Model *baseModel = dynamic_cast<Model *>(m);
 
@@ -46,9 +48,12 @@
 ModelDataTableModel::setData(const QModelIndex &index, const QVariant &value, int role)
 {
     if (!index.isValid()) return false;
-    Command *command = m_model->setData(getUnsorted(index.row()),
-                                        index.column(), value, role);
+    std::cerr << "ModelDataTableModel::setData(" << index.row() << ", " << index.column() << ", " << value.toString().toStdString() << ", " << role << ")" << std::endl;
+    Command *command = m_model->getSetDataCommand(getUnsorted(index.row()),
+                                                  index.column(),
+                                                  value, role);
     if (command) {
+        std::cerr << "emitting executeCommand" << std::endl;
         emit executeCommand(command);
         return true;
     } else {
@@ -177,6 +182,6 @@
 void
 ModelDataTableModel::resort()
 {
-    //...
+    
 }