summaryrefslogtreecommitdiffabout
path: root/kaddressbook/undo.cpp
Unidiff
Diffstat (limited to 'kaddressbook/undo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/undo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kaddressbook/undo.cpp b/kaddressbook/undo.cpp
index 4442087..a6c1580 100644
--- a/kaddressbook/undo.cpp
+++ b/kaddressbook/undo.cpp
@@ -53,67 +53,67 @@ Command *StackBase::pop()
53 Command *c = mCommandStack.pop(); 53 Command *c = mCommandStack.pop();
54 if (c) 54 if (c)
55 emit changed(); 55 emit changed();
56 56
57 return c; 57 return c;
58} 58}
59 59
60/////////////////////////////// 60///////////////////////////////
61// UndoStack 61// UndoStack
62 62
63UndoStack* UndoStack::instance_ = 0; 63UndoStack* UndoStack::instance_ = 0;
64 64
65UndoStack::UndoStack() 65UndoStack::UndoStack()
66 : StackBase() 66 : StackBase()
67{ 67{
68 // setAutoDelete( true ); 68 // setAutoDelete( true );
69} 69}
70 70
71UndoStack* UndoStack::instance() 71UndoStack* UndoStack::instance()
72{ 72{
73 if (!instance_) 73 if (!instance_)
74 instance_ = new UndoStack(); 74 instance_ = new UndoStack();
75 return instance_; 75 return instance_;
76} 76}
77 77
78void UndoStack::undo() 78void UndoStack::undo()
79{ 79{
80 if (isEmpty()) 80 if (isEmpty())
81 return; 81 return;
82 82
83 Command *command = pop(); 83 Command *command = pop();
84 command->undo(); 84 command->undo();
85 85
86 RedoStack::instance()->push( command ); 86 RedoStack::instance()->push( command );
87} 87}
88 88
89//////////////////// 89////////////////////
90// RedoStack 90// RedoStack
91 91
92RedoStack* RedoStack::instance_ = 0; 92RedoStack* RedoStack::instance_ = 0;
93 93
94RedoStack::RedoStack() 94RedoStack::RedoStack()
95{ 95{
96 mCommandStack.setAutoDelete( true ); 96 mCommandStack.setAutoDelete( true );
97} 97}
98 98
99RedoStack* RedoStack::instance() 99RedoStack* RedoStack::instance()
100{ 100{
101 if (!instance_) 101 if (!instance_)
102 instance_ = new RedoStack(); 102 instance_ = new RedoStack();
103 return instance_; 103 return instance_;
104} 104}
105 105
106void RedoStack::redo() 106void RedoStack::redo()
107{ 107{
108 Command *command; 108 Command *command;
109 if (isEmpty()) 109 if (isEmpty())
110 return; 110 return;
111 111
112 command = pop(); 112 command = pop();
113 command->redo(); 113 command->redo();
114 UndoStack::instance()->push( command ); 114 UndoStack::instance()->push( command );
115} 115}
116 116
117#ifndef KAB_EMBEDDED 117#ifndef KAB_EMBEDDED_
118#include "undo.moc" 118#include "moc_undo.cpp"
119#endif //KAB_EMBEDDED 119#endif //KAB_EMBEDDED