Changeset View
Changeset View
Standalone View
Standalone View
plugins/flake/textshape/kotext/KoTextEditor_undo.cpp
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Line(s) | 163 | if (!title.isEmpty()) | |||
---|---|---|---|---|---|
164 | commandTitle = title; | 164 | commandTitle = title; | ||
165 | else | 165 | else | ||
166 | commandTitle = kundo2_i18n("Text"); | 166 | commandTitle = kundo2_i18n("Text"); | ||
167 | debugText << "returning now. commandStack is not modified at this stage"; | 167 | debugText << "returning now. commandStack is not modified at this stage"; | ||
168 | return; | 168 | return; | ||
169 | } | 169 | } | ||
170 | if (newState == NoOp && !commandStack.isEmpty()) { | 170 | if (newState == NoOp && !commandStack.isEmpty()) { | ||
171 | //Calling updateState to NoOp when the commandStack isn't empty means that the current headCommand on the commandStack is finished. Further UndoTextCommands do not belong to it. So we pop it. | 171 | //Calling updateState to NoOp when the commandStack isn't empty means that the current headCommand on the commandStack is finished. Further UndoTextCommands do not belong to it. So we pop it. | ||
172 | //If after poping the headCommand we still have some commands on the commandStack means we have not finished with the highest "macro". In that case we need to stay in the "Custom" state. | 172 | //If after popping the headCommand we still have some commands on the commandStack means we have not finished with the highest "macro". In that case we need to stay in the "Custom" state. | ||
173 | //On the contrary, an empty commandStack means we have finished with the "macro". In that case, we set the editor to NoOp state. A signal from the QTextDocument should also generate a new headCommand. | 173 | //On the contrary, an empty commandStack means we have finished with the "macro". In that case, we set the editor to NoOp state. A signal from the QTextDocument should also generate a new headCommand. | ||
174 | debugText << "we are in a macro and update the state to NoOp. this means that the command on top of the commandStack is finished. we should pop it"; | 174 | debugText << "we are in a macro and update the state to NoOp. this means that the command on top of the commandStack is finished. we should pop it"; | ||
175 | debugText << "commandStack count before: " << commandStack.count(); | 175 | debugText << "commandStack count before: " << commandStack.count(); | ||
176 | commandStack.pop(); | 176 | commandStack.pop(); | ||
177 | debugText << "commandStack count after: " << commandStack.count(); | 177 | debugText << "commandStack count after: " << commandStack.count(); | ||
178 | if (commandStack.isEmpty()) { | 178 | if (commandStack.isEmpty()) { | ||
179 | debugText << "we have no more commands on the commandStack. the macro is complete. next signal induced command will need to be parented to a new headCommand. Also the editor should go to NoOp"; | 179 | debugText << "we have no more commands on the commandStack. the macro is complete. next signal induced command will need to be parented to a new headCommand. Also the editor should go to NoOp"; | ||
180 | addNewCommand = true; | 180 | addNewCommand = true; | ||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |