1 /***************************************************************************
2  *   Copyright (C) 2005-2009 by Rajko Albrecht                             *
3  *   ral@alwins-world.de                                                   *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
19  ***************************************************************************/
20 #include "commitmodelhelper.h"
21 #include "svnqt/commititem.h"
22 
23 #include <KLocalizedString>
24 
CommitModelNode(const svn::CommitItem & aItem)25 CommitModelNode::CommitModelNode(const svn::CommitItem &aItem)
26     : m_Content(), m_Checkable(false), m_Checked(false)
27 {
28     QString what;
29     QString action;
30     switch (aItem.actionType()) {
31     case 'A':
32     case 'a':
33         action = i18n("Add");
34         break;
35     case 'C':
36     case 'c':
37         action = i18n("Copy");
38         break;
39     case 'D':
40     case 'd':
41         action = i18n("Delete");
42         break;
43     case 'M':
44     case 'm':
45         action = i18n("Modify (content or property)");
46         break;
47     case 'R':
48     case 'r':
49         action = i18n("Replace");
50         break;
51     case 'L':
52     case 'l':
53         action = i18n("(Un)Lock");
54         break;
55     }
56     if (aItem.path().isEmpty()) {
57         what = aItem.url();
58     } else {
59         what = aItem.path();
60     }
61     m_Content = CommitActionEntry(what, action);
62 }
63 
CommitModelNode(const CommitActionEntry & aContent,bool checked)64 CommitModelNode::CommitModelNode(const CommitActionEntry &aContent, bool checked)
65     : m_Content(aContent), m_Checkable(true), m_Checked(checked)
66 {
67 }
68 
~CommitModelNode()69 CommitModelNode::~CommitModelNode()
70 {
71 }
72