comparison base/CommandHistory.cpp @ 384:6f6ab834449d spectrogram-cache-rejig

* Merge from trunk
author Chris Cannam
date Wed, 27 Feb 2008 11:59:42 +0000
parents dc46851837d6
children
comparison
equal deleted inserted replaced
337:a6fab10ff9e6 384:6f6ab834449d
214 214
215 void 215 void
216 CommandHistory::addToCompound(Command *command, bool execute) 216 CommandHistory::addToCompound(Command *command, bool execute)
217 { 217 {
218 // std::cerr << "CommandHistory::addToCompound: " << command->getName().toLocal8Bit().data() << std::endl; 218 // std::cerr << "CommandHistory::addToCompound: " << command->getName().toLocal8Bit().data() << std::endl;
219 if (!m_currentCompound) {
220 std::cerr << "CommandHistory::addToCompound: ERROR: no compound operation in progress!" << std::endl;
221 return;
222 }
219 223
220 if (execute) command->execute(); 224 if (execute) command->execute();
221 m_currentCompound->addCommand(command); 225 m_currentCompound->addCommand(command);
222 } 226 }
223 227
225 CommandHistory::startCompoundOperation(QString name, bool execute) 229 CommandHistory::startCompoundOperation(QString name, bool execute)
226 { 230 {
227 if (m_currentCompound) { 231 if (m_currentCompound) {
228 std::cerr << "CommandHistory::startCompoundOperation: ERROR: compound operation already in progress!" << std::endl; 232 std::cerr << "CommandHistory::startCompoundOperation: ERROR: compound operation already in progress!" << std::endl;
229 std::cerr << "(name is " << m_currentCompound->getName().toLocal8Bit().data() << ")" << std::endl; 233 std::cerr << "(name is " << m_currentCompound->getName().toLocal8Bit().data() << ")" << std::endl;
234 return;
230 } 235 }
231 236
232 closeBundle(); 237 closeBundle();
233 238
234 m_currentCompound = new MacroCommand(name); 239 m_currentCompound = new MacroCommand(name);
238 void 243 void
239 CommandHistory::endCompoundOperation() 244 CommandHistory::endCompoundOperation()
240 { 245 {
241 if (!m_currentCompound) { 246 if (!m_currentCompound) {
242 std::cerr << "CommandHistory::endCompoundOperation: ERROR: no compound operation in progress!" << std::endl; 247 std::cerr << "CommandHistory::endCompoundOperation: ERROR: no compound operation in progress!" << std::endl;
248 return;
243 } 249 }
244 250
245 MacroCommand *toAdd = m_currentCompound; 251 MacroCommand *toAdd = m_currentCompound;
246 m_currentCompound = 0; 252 m_currentCompound = 0;
247 253