~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to krita/image/kis_undo_adapter.cc

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
KisUndoAdapter::KisUndoAdapter(KoDocument* doc): m_doc(doc)
26
26
{
27
 
    m_undo = true;
28
27
}
29
28
 
30
29
KisUndoAdapter::~KisUndoAdapter()
43
42
        m_undoListeners.remove(index);
44
43
}
45
44
 
 
45
void KisUndoAdapter::notifyCommandAdded(const QUndoCommand *command)
 
46
{
 
47
    if (!command) {
 
48
        kWarning() << "Empty command!";
 
49
        return;
 
50
    }
 
51
    foreach(KisCommandHistoryListener*  l, m_undoListeners) {
 
52
        l->notifyCommandAdded(command);
 
53
    }
 
54
 
 
55
}
 
56
 
46
57
void KisUndoAdapter::notifyCommandExecuted(const QUndoCommand *command)
47
58
{
48
59
    if (!command) {
63
74
void KisUndoAdapter::addCommand(QUndoCommand *command)
64
75
{
65
76
    m_doc->addCommand(command);
66
 
    foreach(KisCommandHistoryListener*  l, m_undoListeners) {
67
 
        l->notifyCommandAdded(command);
68
 
    }
 
77
    notifyCommandAdded(command);
69
78
}
70
79
 
71
80
void KisUndoAdapter::undoLastCommand()
86
95
    m_doc->undoStack()->undo();
87
96
}
88
97
 
89
 
void KisUndoAdapter::setUndo(bool undo)
90
 
{
91
 
    m_undo = undo;
92
 
}
93
 
 
94
 
bool KisUndoAdapter::undo() const
95
 
{
96
 
    return m_undo;
97
 
}
98
 
 
99
98
void KisUndoAdapter::beginMacro(const QString& macroName)
100
99
{
101
100
    m_doc->beginMacro(macroName);