[Kst] branches/work/kst/portto4/kst/src/libkstapp

Mike Fenton mike at staikos.net
Wed May 14 16:58:55 CEST 2008


SVN commit 807723 by fenton:

Fix crash in DataManager.  Update logic to properly support outputMatrices.


 M  +9 -1      datamanager.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/datamanager.cpp #807722:807723
@@ -208,7 +208,11 @@
     } else {
       DataObjectPtr dataObject = kst_cast<DataObject>(model->generateObjectList().at(_session->indexAt(position).parent().row()));
       if (dataObject) {
-        _currentObject = dataObject->outputVectors().values()[_session->indexAt(position).row()];
+        if (dataObject->outputVectors().count() > _session->indexAt(position).row()) {
+          _currentObject = dataObject->outputVectors().values()[_session->indexAt(position).row()];
+        } else {
+          _currentObject = dataObject->outputMatrices().values()[_session->indexAt(position).row() - dataObject->outputVectors().count()];
+        }
         if (_currentObject) {
           QAction *action = new QAction(_currentObject->tag().displayString(), this);
           action->setEnabled(false);
@@ -230,6 +234,10 @@
             action = new QAction(tr("Make Histogram"), this);
             connect(action, SIGNAL(triggered()), this, SLOT(showHistogramDialog()));
             actions.append(action);
+          } else if (MatrixPtr m = kst_cast<Matrix>(_currentObject)) {
+            action = new QAction(tr("Make Image"), this);
+            connect(action, SIGNAL(triggered()), this, SLOT(showImageDialog()));
+            actions.append(action);
           }
         }
       }


More information about the Kst mailing list