comparison base/CommandHistory.cpp @ 383:94fc0591ea43 1.2-stable

* merge from trunk (1.2 ended up being tracked from trunk, but we may want this branch for fixes later)
author Chris Cannam
date Wed, 27 Feb 2008 10:32:45 +0000
parents dc46851837d6
children
comparison
equal deleted inserted replaced
349:f39d33b0b265 383:94fc0591ea43
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