comparison widgets/CommandHistory.cpp @ 706:97ea68f62c1f imaf_enc

Merge from default branch
author Chris Cannam
date Thu, 05 Dec 2013 09:47:02 +0000
parents 692a8b9804fe
children f428bd852580
comparison
equal deleted inserted replaced
678:26c5f7fd4807 706:97ea68f62c1f
141 CommandHistory::addCommand(Command *command, bool execute, bool bundle) 141 CommandHistory::addCommand(Command *command, bool execute, bool bundle)
142 { 142 {
143 if (!command) return; 143 if (!command) return;
144 144
145 #ifdef DEBUG_COMMAND_HISTORY 145 #ifdef DEBUG_COMMAND_HISTORY
146 SVDEBUG << "CommandHistory::addCommand: " << command->getName().toLocal8Bit().data() << " of type " << typeid(*command).name() << " at " << command << ": execute = " << execute << ", bundle = " << bundle << " (m_currentCompound = " << m_currentCompound << ", m_currentBundle = " << m_currentBundle << ")" << endl; 146 SVDEBUG << "CommandHistory::addCommand: " << command->getName() << " of type " << typeid(*command).name() << " at " << command << ": execute = " << execute << ", bundle = " << bundle << " (m_currentCompound = " << m_currentCompound << ", m_currentBundle = " << m_currentBundle << ")" << endl;
147 #endif 147 #endif
148 148
149 if (m_currentCompound) { 149 if (m_currentCompound) {
150 addToCompound(command, execute); 150 addToCompound(command, execute);
151 return; 151 return;
263 263
264 void 264 void
265 CommandHistory::addToCompound(Command *command, bool execute) 265 CommandHistory::addToCompound(Command *command, bool execute)
266 { 266 {
267 #ifdef DEBUG_COMMAND_HISTORY 267 #ifdef DEBUG_COMMAND_HISTORY
268 SVDEBUG << "CommandHistory::addToCompound: " << command->getName().toLocal8Bit().data() << endl; 268 SVDEBUG << "CommandHistory::addToCompound: " << command->getName() << endl;
269 #endif 269 #endif
270 if (!m_currentCompound) { 270 if (!m_currentCompound) {
271 SVDEBUG << "CommandHistory::addToCompound: ERROR: no compound operation in progress!" << endl; 271 SVDEBUG << "CommandHistory::addToCompound: ERROR: no compound operation in progress!" << endl;
272 return; 272 return;
273 } 273 }
279 void 279 void
280 CommandHistory::startCompoundOperation(QString name, bool execute) 280 CommandHistory::startCompoundOperation(QString name, bool execute)
281 { 281 {
282 if (m_currentCompound) { 282 if (m_currentCompound) {
283 SVDEBUG << "CommandHistory::startCompoundOperation: ERROR: compound operation already in progress!" << endl; 283 SVDEBUG << "CommandHistory::startCompoundOperation: ERROR: compound operation already in progress!" << endl;
284 std::cerr << "(name is " << m_currentCompound->getName().toLocal8Bit().data() << ")" << std::endl; 284 cerr << "(name is " << m_currentCompound->getName() << ")" << endl;
285 return; 285 return;
286 } 286 }
287 287
288 closeBundle(); 288 closeBundle();
289 289
434 CommandStack tempStack; 434 CommandStack tempStack;
435 435
436 for (i = 0; i < limit; ++i) { 436 for (i = 0; i < limit; ++i) {
437 #ifdef DEBUG_COMMAND_HISTORY 437 #ifdef DEBUG_COMMAND_HISTORY
438 Command *command = stack.top(); 438 Command *command = stack.top();
439 SVDEBUG << "CommandHistory::clipStack: Saving recent command: " << command->getName().toLocal8Bit().data() << " at " << command << endl; 439 SVDEBUG << "CommandHistory::clipStack: Saving recent command: " << command->getName() << " at " << command << endl;
440 #endif 440 #endif
441 tempStack.push(stack.top()); 441 tempStack.push(stack.top());
442 stack.pop(); 442 stack.pop();
443 } 443 }
444 444