Mercurial > hg > svgui
comparison widgets/CommandHistory.cpp @ 1414:fa986b91d77f
Merge from branch fix-static-analysis
author | Chris Cannam |
---|---|
date | Wed, 09 Jan 2019 15:24:51 +0000 |
parents | c8a6fd3f9dff |
children | bd1a7c84da8c |
comparison
equal
deleted
inserted
replaced
1413:0930a27ebea2 | 1414:fa986b91d77f |
---|---|
39 | 39 |
40 #include <typeinfo> | 40 #include <typeinfo> |
41 | 41 |
42 //#define DEBUG_COMMAND_HISTORY 1 | 42 //#define DEBUG_COMMAND_HISTORY 1 |
43 | 43 |
44 CommandHistory *CommandHistory::m_instance = 0; | 44 CommandHistory *CommandHistory::m_instance = nullptr; |
45 | 45 |
46 CommandHistory::CommandHistory() : | 46 CommandHistory::CommandHistory() : |
47 m_undoLimit(50), | 47 m_undoLimit(50), |
48 m_redoLimit(50), | 48 m_redoLimit(50), |
49 m_menuLimit(15), | 49 m_menuLimit(15), |
50 m_savedAt(0), | 50 m_savedAt(0), |
51 m_currentCompound(0), | 51 m_currentCompound(nullptr), |
52 m_executeCompound(false), | 52 m_executeCompound(false), |
53 m_currentBundle(0), | 53 m_currentBundle(nullptr), |
54 m_bundling(false), | 54 m_bundling(false), |
55 m_bundleTimer(0), | 55 m_bundleTimer(nullptr), |
56 m_bundleTimeout(3000) | 56 m_bundleTimeout(3000) |
57 { | 57 { |
58 IconLoader loader; | 58 IconLoader loader; |
59 QIcon undoIcon(loader.load("undo")); | 59 QIcon undoIcon(loader.load("undo")); |
60 QIcon redoIcon(loader.load("redo")); | 60 QIcon redoIcon(loader.load("redo")); |
252 #ifdef DEBUG_COMMAND_HISTORY | 252 #ifdef DEBUG_COMMAND_HISTORY |
253 cerr << "CommandHistory::closeBundle" << endl; | 253 cerr << "CommandHistory::closeBundle" << endl; |
254 #endif | 254 #endif |
255 emit activity(m_currentBundle->getName()); | 255 emit activity(m_currentBundle->getName()); |
256 } | 256 } |
257 m_currentBundle = 0; | 257 m_currentBundle = nullptr; |
258 m_currentBundleName = ""; | 258 m_currentBundleName = ""; |
259 } | 259 } |
260 | 260 |
261 void | 261 void |
262 CommandHistory::bundleTimerTimeout() | 262 CommandHistory::bundleTimerTimeout() |
314 #ifdef DEBUG_COMMAND_HISTORY | 314 #ifdef DEBUG_COMMAND_HISTORY |
315 cerr << "CommandHistory::endCompoundOperation: " << m_currentCompound->getName() << endl; | 315 cerr << "CommandHistory::endCompoundOperation: " << m_currentCompound->getName() << endl; |
316 #endif | 316 #endif |
317 | 317 |
318 MacroCommand *toAdd = m_currentCompound; | 318 MacroCommand *toAdd = m_currentCompound; |
319 m_currentCompound = 0; | 319 m_currentCompound = nullptr; |
320 | 320 |
321 if (toAdd->haveCommands()) { | 321 if (toAdd->haveCommands()) { |
322 | 322 |
323 // We don't execute the macro command here, because we have | 323 // We don't execute the macro command here, because we have |
324 // been executing the individual commands as we went along if | 324 // been executing the individual commands as we went along if |