summaryrefslogtreecommitdiffstats
path: root/languages/cpp/creategettersetterconfiguration.cpp
blob: ace72d148e24f4f9f2b937f70863b4d028e18250 (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
57
58
59
60
61
62
//
// C++ Implementation: %{MODULE}
//
// Description: 
//
//
// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "creategettersetterconfiguration.h"

#include "cppsupportpart.h"

#include <domutil.h>

#include <tqdom.h>
#include <tdemessagebox.h>
TQString CreateGetterSetterConfiguration::defaultPath = TQString::fromLatin1( "/kdevcppsupport/creategettersetter" );

CreateGetterSetterConfiguration::CreateGetterSetterConfiguration( CppSupportPart * part ) 
: TQObject(part), m_part(part), m_settings(0)
{
	init();
}


CreateGetterSetterConfiguration::~CreateGetterSetterConfiguration()
{
}

void CreateGetterSetterConfiguration::init( )
{
	m_settings = m_part->projectDom();
	if (m_settings == 0)
		return;
	
	m_prefixGet = DomUtil::readEntry( *m_settings, defaultPath + "/prefixGet", "" );
	m_prefixSet = DomUtil::readEntry( *m_settings, defaultPath + "/prefixSet", "set" );
	m_prefixVariable = TQStringList::split(",", DomUtil::readEntry( *m_settings, defaultPath + "/prefixVariable", "m_,_" ));
	m_parameterName =  DomUtil::readEntry( *m_settings, defaultPath + "/parameterName", "theValue" );
	m_isInlineGet = DomUtil::readBoolEntry(*m_settings, defaultPath + "/inlineGet", true );
	m_isInlineSet = DomUtil::readBoolEntry(*m_settings, defaultPath + "/inlineSet", true );
}

void CreateGetterSetterConfiguration::store( )
{
	if (m_settings == 0)
		return;
	
	DomUtil::writeEntry( *m_settings, defaultPath + "/prefixGet", m_prefixGet );
	DomUtil::writeEntry( *m_settings, defaultPath + "/prefixSet", m_prefixSet );
	DomUtil::writeEntry( *m_settings, defaultPath + "/prefixVariable", m_prefixVariable.join(",") );
	DomUtil::writeEntry( *m_settings, defaultPath + "/parameterName", m_parameterName );
	DomUtil::writeBoolEntry(*m_settings, defaultPath + "/inlineGet", m_isInlineGet );
	DomUtil::writeBoolEntry(*m_settings, defaultPath + "/inlineSet", m_isInlineSet );
}

#include "creategettersetterconfiguration.moc"

//kate: indent-mode csands; tab-width 4; space-indent off;