author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/undo.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | kaddressbook/undo.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kaddressbook/undo.h b/kaddressbook/undo.h index 843bc26..a8ba2ee 100644 --- a/kaddressbook/undo.h +++ b/kaddressbook/undo.h | |||
@@ -16,25 +16,25 @@ | |||
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef UNDO_H | 24 | #ifndef UNDO_H |
25 | #define UNDO_H | 25 | #define UNDO_H |
26 | 26 | ||
27 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | #include <qptrstack.h> | 28 | #include <q3ptrstack.h> |
29 | #include <qstring.h> | 29 | #include <qstring.h> |
30 | 30 | ||
31 | class Command | 31 | class Command |
32 | { | 32 | { |
33 | public: | 33 | public: |
34 | Command() {} | 34 | Command() {} |
35 | virtual ~Command() {}; | 35 | virtual ~Command() {}; |
36 | virtual QString name() = 0; | 36 | virtual QString name() = 0; |
37 | virtual void redo() = 0; // egcs requires these methods to have | 37 | virtual void redo() = 0; // egcs requires these methods to have |
38 | virtual void undo() = 0; // implementations (Seems like a bug) | 38 | virtual void undo() = 0; // implementations (Seems like a bug) |
39 | // pure virtual may not work | 39 | // pure virtual may not work |
40 | }; | 40 | }; |
@@ -58,25 +58,25 @@ class StackBase : public QObject | |||
58 | Command *top(); | 58 | Command *top(); |
59 | void clear(); | 59 | void clear(); |
60 | 60 | ||
61 | signals: | 61 | signals: |
62 | void changed(); | 62 | void changed(); |
63 | 63 | ||
64 | protected: | 64 | protected: |
65 | /** Protect the pop method so users must call undo/redo to properly | 65 | /** Protect the pop method so users must call undo/redo to properly |
66 | * use the stack, however the subclasses need it to modify the stack. | 66 | * use the stack, however the subclasses need it to modify the stack. |
67 | */ | 67 | */ |
68 | Command *pop(); | 68 | Command *pop(); |
69 | 69 | ||
70 | QPtrStack<Command> mCommandStack; | 70 | Q3PtrStack<Command> mCommandStack; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | class UndoStack : public StackBase | 73 | class UndoStack : public StackBase |
74 | { | 74 | { |
75 | public: | 75 | public: |
76 | static UndoStack *instance(); | 76 | static UndoStack *instance(); |
77 | void undo(); | 77 | void undo(); |
78 | 78 | ||
79 | protected: | 79 | protected: |
80 | UndoStack(); | 80 | UndoStack(); |
81 | static UndoStack* instance_; | 81 | static UndoStack* instance_; |
82 | }; | 82 | }; |