diff data/model/SparseModel.h @ 387:7aa1de571880

* juggle some files around in order to free audioio, base, and system libraries from dependency on QtGui
author Chris Cannam
date Wed, 12 Mar 2008 17:42:56 +0000
parents 700cd3350391
children a1b6d2e33cab
line wrap: on
line diff
--- a/data/model/SparseModel.h	Sat Mar 01 16:17:44 2008 +0000
+++ b/data/model/SparseModel.h	Wed Mar 12 17:42:56 2008 +0000
@@ -18,7 +18,6 @@
 
 #include "Model.h"
 #include "base/Command.h"
-#include "base/CommandHistory.h"
 
 #include <iostream>
 
@@ -215,10 +214,11 @@
 	virtual void addCommand(Command *command) { addCommand(command, true); }
 
 	/**
-	 * If any points have been added or deleted, add this command
-	 * to the command history.  Otherwise delete the command.
+	 * If any points have been added or deleted, return this
+	 * command (so the caller can add it to the command history).
+	 * Otherwise delete the command.
 	 */
-	virtual void finish();
+	virtual Command *finish();
 
     protected:
 	virtual void addCommand(Command *command, bool executeFirst);
@@ -600,11 +600,11 @@
 }
 
 template <typename PointType>
-void
+Command *
 SparseModel<PointType>::EditCommand::finish()
 {
     if (!m_commands.empty()) {
-	CommandHistory::getInstance()->addCommand(this, false);
+        return this;
     } else {
         delete this;
     }