summaryrefslogtreecommitdiffstats
path: root/src/svnfrontend/fronthelpers/propertyitem.cpp
blob: 9e7aa767cc2c5bcbcb14dd83e49c801c10721598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "propertyitem.h"
#include <tdelocale.h>
#include <kiconloader.h>

PropertyListViewItem::PropertyListViewItem(TDEListView *parent,const TQString&aName,const TQString&aValue)
    : TDEListViewItem(parent),m_currentName(aName),m_startName(aName),m_currentValue(aValue),m_startValue(aValue),m_deleted(false)
{
    setMultiLinesEnabled(true);
    setText(0,startName());
    setText(1,startValue());
}

PropertyListViewItem::PropertyListViewItem(TDEListView *parent)
    : TDEListViewItem(parent),m_currentName(""),m_startName(""),m_currentValue(""),m_startValue(""),m_deleted(false)
{
    setMultiLinesEnabled(true);
    setText(0,startName());
    setText(1,startValue());
}

PropertyListViewItem::~PropertyListViewItem()
{
}

void PropertyListViewItem::checkValue()
{
    m_currentValue=text(1);
}

void PropertyListViewItem::checkName()
{
    m_currentName=text(0);
}

bool PropertyListViewItem::different()const
{
    return m_currentName!=m_startName || m_currentValue!=m_startValue || deleted();
}

void PropertyListViewItem::deleteIt()
{
    m_deleted = true;
    setPixmap(0,TDEGlobal::iconLoader()->loadIcon("cancel",TDEIcon::Desktop,16));
}

void PropertyListViewItem::unDeleteIt()
{
    m_deleted = false;
    setPixmap(0,TQPixmap());
}

bool PropertyListViewItem::protected_Property(const TQString&what)
{
    if (what.compare("svn:special")!=0) return false;
    return true;
}