]> git.sesse.net Git - kdenlive/blob - src/commands/addextradatacommand.cpp
Use KLocalizedString (for i18n only, in kf5 it will necessary => use a script for...
[kdenlive] / src / commands / addextradatacommand.cpp
1 /***************************************************************************
2                           addextradatacommand.cpp  -  description
3                              -------------------
4     begin                : 2012
5     copyright            : (C) 2012 by Jean-Baptiste Mardelle
6     email                : jb@kdenlive.org
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18
19 #include "addextradatacommand.h"
20 #include "customtrackview.h"
21
22 #include <KLocalizedString>
23
24 AddExtraDataCommand::AddExtraDataCommand(CustomTrackView *view, const QString&id, const QString&key, const QString &oldData, const QString &newData, QUndoCommand * parent) :
25         QUndoCommand(parent),
26         m_view(view),
27         m_oldData(oldData),
28         m_newData(newData),
29         m_key(key),
30         m_id(id)
31 {
32     if (m_newData.isEmpty())
33         setText(i18n("Delete data"));
34     else
35         setText(i18n("Add data"));
36 }
37
38
39 // virtual
40 void AddExtraDataCommand::undo()
41 {
42     m_view->addData(m_id, m_key, m_oldData);
43 }
44 // virtual
45 void AddExtraDataCommand::redo()
46 {
47     m_view->addData(m_id, m_key, m_newData);
48 }
49