Subversion Repositories spk

Rev

Rev 131 | Rev 171 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 131 Rev 170
Line 12... Line 12...
12
	_pInstallText(NULL),
12
	_pInstallText(NULL),
13
	_pUninstallText(NULL),
13
	_pUninstallText(NULL),
14
	_pAutoExtract(NULL),
14
	_pAutoExtract(NULL),
15
	_pAutoExport(NULL)
15
	_pAutoExport(NULL)
16
{
16
{
-
 
17
	_lNames = new Utils::CList<SNames>();
17
	_setDefaults();
18
	_setDefaults();
18
}
19
}
19
 
20
 
20
CCorePackage::~CCorePackage(void)
21
CCorePackage::~CCorePackage(void)
21
{
22
{
-
 
23
	if (_lNames)
-
 
24
		delete _lNames;
22
	if(_pInstallText)
25
	if(_pInstallText)
23
		delete _pInstallText;
26
		delete _pInstallText;
24
	if(_pUninstallText)
27
	if(_pUninstallText)
25
		delete _pUninstallText;
28
		delete _pUninstallText;
26
	if (_pAutoExtract)
29
	if (_pAutoExtract)
27
		delete _pAutoExtract;
30
		delete _pAutoExtract;
28
	if (_pAutoExport)
31
	if (_pAutoExport)
29
		delete _pAutoExport;
32
		delete _pAutoExport;
30
}
33
}
31
 
34
 
-
 
35
const Utils::String& CCorePackage::name(int lang) const
-
 
36
{ 
-
 
37
	for(auto itr = _lNames->begin(); itr != _lNames->end(); itr++)
-
 
38
	{
-
 
39
		if ((*itr)->iLanguage == lang)
-
 
40
			return (*itr)->sName;
-
 
41
	}
-
 
42
	return _sName; 
-
 
43
}
-
 
44
 
32
void CCorePackage::_setDefaults()
45
void CCorePackage::_setDefaults()
33
{
46
{
34
	_iRecommended = -1;
47
	_iRecommended = -1;
35
	_iGameChanging = -1;
48
	_iGameChanging = -1;
36
	_iEaseOfUse = -1;
49
	_iEaseOfUse = -1;
Line 48... Line 61...
48
	_pAutoExport = NULL;
61
	_pAutoExport = NULL;
49
	_pInstallText = new CInstallText;
62
	_pInstallText = new CInstallText;
50
	_pUninstallText = new CInstallText;
63
	_pUninstallText = new CInstallText;
51
 
64
 
52
	_iPluginType = PLUGIN_NORMAL;
65
	_iPluginType = PLUGIN_NORMAL;
-
 
66
 
-
 
67
	_lNames->deleteItems();
53
}
68
}
54
 
69
 
55
void CCorePackage::_setRatings(int iEase, int iChanging, int iRec)
70
void CCorePackage::_setRatings(int iEase, int iChanging, int iRec)
56
{
71
{
57
	_iRecommended = iRec;
72
	_iRecommended = iRec;
Line 146... Line 161...
146
	if (_pAutoExtract)
161
	if (_pAutoExtract)
147
		delete _pAutoExtract;
162
		delete _pAutoExtract;
148
	_pAutoExtract = NULL;
163
	_pAutoExtract = NULL;
149
}
164
}
150
 
165
 
-
 
166
 
-
 
167
void CCorePackage::removeName(int lang)
-
 
168
{
-
 
169
	auto itr = _lNames->begin();
-
 
170
	while (itr != _lNames->end())
-
 
171
	{
-
 
172
		if ((*itr)->iLanguage == lang)
-
 
173
		{
-
 
174
			SNames* n = *itr;
-
 
175
			itr = _lNames->remove(itr);
-
 
176
			delete n;
-
 
177
			_changed();
-
 
178
		}
-
 
179
		else 
-
 
180
			itr++;
-
 
181
	}
-
 
182
}
-
 
183
 
-
 
184
void CCorePackage::clearNames()
-
 
185
{
-
 
186
	_lNames->deleteItems();
-
 
187
}
-
 
188
 
-
 
189
void CCorePackage::addName(int lang, const Utils::String& name)
-
 
190
{
-
 
191
	for (auto n = _lNames->first(); n; n = _lNames->next())
-
 
192
	{
-
 
193
		if (n->iLanguage == lang)
-
 
194
		{
-
 
195
			n->sName = name;
-
 
196
			_changed();
-
 
197
			return;
-
 
198
		}
-
 
199
	}
-
 
200
 
-
 
201
	// not found, add a new entry
-
 
202
	SNames *n = new SNames;
-
 
203
	n->iLanguage = lang;
-
 
204
	n->sName = name;
-
 
205
	_lNames->push_back(n);
-
 
206
 
-
 
207
	_changed();
-
 
208
}
-
 
209
 
151
///////////////////////////////////////////////////////////////////////////////////////////////
210
///////////////////////////////////////////////////////////////////////////////////////////////
152
//	Install/Uninstall Texts
211
//	Install/Uninstall Texts
153
///////
212
///////
154
 
213
 
155
Utils::String CCorePackage::installText(int iLang, bool bBefore, bool bIncludeDefault) const
214
Utils::String CCorePackage::installText(int iLang, bool bBefore, bool bIncludeDefault) const