Subversion Repositories spk

Rev

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

Rev 160 Rev 162
Line 1490... Line 1490...
1490
	else if ( first.Compare("Date:") )				this->setCreationDate(rest);
1490
	else if ( first.Compare("Date:") )				this->setCreationDate(rest);
1491
	else if ( first.Compare("WebAddress:") )		this->setWebAddress(rest);
1491
	else if ( first.Compare("WebAddress:") )		this->setWebAddress(rest);
1492
	else if ( first.Compare("WebSite:") )			this->setWebSite(rest);
1492
	else if ( first.Compare("WebSite:") )			this->setWebSite(rest);
1493
	else if ( first.Compare("Email:") )				this->setEmail(rest);
1493
	else if ( first.Compare("Email:") )				this->setEmail(rest);
1494
	else if ( first.Compare("WebMirror1:") || first.Compare("Mirror1:") || first.Compare("WebMirror:") )
1494
	else if ( first.Compare("WebMirror1:") || first.Compare("Mirror1:") || first.Compare("WebMirror:") )
1495
		this->AddWebMirror(rest);
1495
		this->addWebMirror(rest);
1496
	else if ( first.Compare("WebMirror2:") || first.Compare("Mirror2:") )
1496
	else if ( first.Compare("WebMirror2:") || first.Compare("Mirror2:") )
1497
		this->AddWebMirror(rest);
1497
		this->addWebMirror(rest);
1498
	else if ( first.Compare("PluginType:") )		this->setPluginType(rest);
1498
	else if ( first.Compare("PluginType:") )		this->setPluginType(rest);
1499
	else if ( first.Compare("Desc:") )				this->setDescription(rest);
1499
	else if ( first.Compare("Desc:") )				this->setDescription(rest);
1500
	else if ( first.Compare("UninstallAfter:") )	this->addUninstallText(ParseLanguage(rest.token("|", 1)), false, rest.tokens("|", 2));
1500
	else if ( first.Compare("UninstallAfter:") )	this->addUninstallText(ParseLanguage(rest.token("|", 1)), false, rest.tokens("|", 2));
1501
	else if ( first.Compare("UninstallBefore:") )	this->addUninstallText(ParseLanguage(rest.token("|", 1)), true, rest.tokens("|", 2));
1501
	else if ( first.Compare("UninstallBefore:") )	this->addUninstallText(ParseLanguage(rest.token("|", 1)), true, rest.tokens("|", 2));
1502
	else if ( first.Compare("InstallAfter:") )		this->addInstallText(ParseLanguage(rest.token("|", 1)), false, rest.tokens("|", 2));
1502
	else if ( first.Compare("InstallAfter:") )		this->addInstallText(ParseLanguage(rest.token("|", 1)), false, rest.tokens("|", 2));
Line 1936... Line 1936...
1936
	if ( !this->webAddress().empty() )	values += "WebAddress: "	+ this->webAddress()	+ "\n";
1936
	if ( !this->webAddress().empty() )	values += "WebAddress: "	+ this->webAddress()	+ "\n";
1937
	if ( !this->webSite().empty() )		values += "WebSite: "		+ this->webSite()		+ "\n";
1937
	if ( !this->webSite().empty() )		values += "WebSite: "		+ this->webSite()		+ "\n";
1938
	if ( !this->email().empty() )		values += "Email: "			+ this->email()			+ "\n";
1938
	if ( !this->email().empty() )		values += "Email: "			+ this->email()			+ "\n";
1939
	if ( !this->forumLink().empty() )	values += "ForumLink: "		+ this->forumLink()		+ "\n";
1939
	if ( !this->forumLink().empty() )	values += "ForumLink: "		+ this->forumLink()		+ "\n";
1940
 
1940
 
1941
	for ( SStringList *str = m_lMirrors.Head(); str; str = str->;next )
1941
	for(auto itr = _lMirrors.begin(); itr != _lMirrors.end(); itr++)
1942
		values += Utils::String("WebMirror: ") + str->str.ToString() + "\n";
1942
		values += Utils::String("WebMirror: ") + (*itr)->str + "\n";
1943
	if ( !this->description().empty() ) {
1943
	if ( !this->description().empty() ) {
1944
		Utils::String desc = this->description();
1944
		Utils::String desc = this->description();
1945
		desc = desc.findReplace("<newline>", "<br>");
1945
		desc = desc.findReplace("<newline>", "<br>");
1946
		desc = desc.findReplace("\n", "<br>");
1946
		desc = desc.findReplace("\n", "<br>");
1947
		desc.remove('\r');
1947
		desc.remove('\r');
Line 2554... Line 2554...
2554
		list->pushBack("# The email address of the author, to allow users to contract if needed");
2554
		list->pushBack("# The email address of the author, to allow users to contract if needed");
2555
		list->pushBack("Email: " + this->email());
2555
		list->pushBack("Email: " + this->email());
2556
		list->pushBack("");
2556
		list->pushBack("");
2557
	}
2557
	}
2558
 
2558
 
2559
	if ( m_lMirrors.Count() )
2559
	if (_lMirrors.size())
2560
	{
2560
	{
2561
		list->pushBack("# A link to the mirror address for the update file, can have many of these");
2561
		list->pushBack("# A link to the mirror address for the update file, can have many of these");
2562
		for ( SStringList *node = m_lMirrors.Head(); node; node = node->;next )
2562
		for(auto itr = _lMirrors.begin(); itr != _lMirrors.end(); itr++)
2563
			list->pushBack(Utils::String("WebMirror: ") + node->str.ToString());
2563
			list->pushBack(Utils::String("WebMirror: ") + (*itr)->str);
2564
		list->pushBack("");
2564
		list->pushBack("");
2565
	}
2565
	}
2566
 
2566
 
2567
	if ( m_bAutoGenerateUpdateFile )
2567
	if ( m_bAutoGenerateUpdateFile )
2568
	{
2568
	{
Line 2889... Line 2889...
2889
	else if (sFirst.Compare("WebSite"))		this->setWebSite(sRest);
2889
	else if (sFirst.Compare("WebSite"))		this->setWebSite(sRest);
2890
	else if (sFirst.Compare("ForumLink") || sFirst.Compare("Forum")) this->setForumLink(sRest);
2890
	else if (sFirst.Compare("ForumLink") || sFirst.Compare("Forum")) this->setForumLink(sRest);
2891
	else if (sFirst.Compare("Email"))			this->setEmail(sRest);
2891
	else if (sFirst.Compare("Email"))			this->setEmail(sRest);
2892
	else if (sFirst.Compare("WebAddress"))	this->setWebAddress(sRest);
2892
	else if (sFirst.Compare("WebAddress"))	this->setWebAddress(sRest);
2893
	else if (sFirst.Compare("WebMirror"))
2893
	else if (sFirst.Compare("WebMirror"))
2894
		this->AddWebMirror(sRest);
2894
		this->addWebMirror(sRest);
2895
	else if (sFirst.Compare("WebMirror1"))
2895
	else if (sFirst.Compare("WebMirror1"))
2896
		this->AddWebMirror(sRest);
2896
		this->addWebMirror(sRest);
2897
	else if (sFirst.Compare("WebMirror2"))
2897
	else if (sFirst.Compare("WebMirror2"))
2898
		this->AddWebMirror(sRest);
2898
		this->addWebMirror(sRest);
2899
	else if (sFirst.Compare("Ftp"))
2899
	else if (sFirst.Compare("Ftp"))
2900
		m_sFtpAddr = sRest;
2900
		m_sFtpAddr = sRest;
2901
	else if (sFirst.Compare("Ratings"))		_setRatings(sRest.token(" ", 1), sRest.token(" ", 2), sRest.token(" ", 3));
2901
	else if (sFirst.Compare("Ratings"))		_setRatings(sRest.token(" ", 1), sRest.token(" ", 2), sRest.token(" ", 3));
2902
	else if (sFirst.Compare("EaseOfUse"))		setEaseOfUse(sRest);
2902
	else if (sFirst.Compare("EaseOfUse"))		setEaseOfUse(sRest);
2903
	else if (sFirst.Compare("GameChanging"))	setGameChanging(sRest);
2903
	else if (sFirst.Compare("GameChanging"))	setGameChanging(sRest);
Line 3256... Line 3256...
3256
	// need to edit the file
3256
	// need to edit the file
3257
	if (f->GetFileType() == FILETYPE_SCRIPT || f->GetFileType() == FILETYPE_UNINSTALL)
3257
	if (f->GetFileType() == FILETYPE_SCRIPT || f->GetFileType() == FILETYPE_UNINSTALL)
3258
		f->RenameScript(baseName);
3258
		f->RenameScript(baseName);
3259
 
3259
 
3260
	f->ChangeBaseName(baseName);
3260
	f->ChangeBaseName(baseName);
-
 
3261
}
-
 
3262
 
-
 
3263
void CBaseFile::addWebMirror(const Utils::String& str) 
-
 
3264
{ 
-
 
3265
	if (!_lMirrors.contains(str))
-
 
3266
	{
-
 
3267
		_lMirrors.pushBack(str, "");
-
 
3268
		_changed();
-
 
3269
	}
-
 
3270
}
-
 
3271
 
-
 
3272
void CBaseFile::removeWebMirror(const Utils::String& str) 
-
 
3273
{ 
-
 
3274
	_lMirrors.remove(str, true); 
-
 
3275
	_changed(); 
3261
}
3276
}
3262
 
3277
 
3263
Utils::String CBaseFile::createUpdateFile(const Utils::String &dir) const
3278
Utils::String CBaseFile::createUpdateFile(const Utils::String &dir) const
3264
{
3279
{
3265
	Utils::String file = this->getNameValidFile() + "_" + this->author() + ".dat";
3280
	Utils::String file = this->getNameValidFile() + "_" + this->author() + ".dat";