Subversion Repositories spk

Rev

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

Rev 175 Rev 178
Line 286... Line 286...
286
}
286
}
287
 
287
 
288
C_File *CBaseFile::addFile(const Utils::String &file, const Utils::String &dir, FileType type, int game, bool packed)
288
C_File *CBaseFile::addFile(const Utils::String &file, const Utils::String &dir, FileType type, int game, bool packed)
289
{
289
{
290
	C_File *newfile = new C_File(file);
290
	C_File *newfile = new C_File(file);
291
	newfile->SetDir(dir);
291
	newfile->setDir(dir);
292
	newfile->setFileType(type);
292
	newfile->setFileType(type);
293
	newfile->setGame(game);
293
	newfile->setGame(game);
294
 
294
 
295
	if (packed)
295
	if (packed)
296
	{
296
	{
Line 579... Line 579...
579
		{
579
		{
580
			if (!fit->UncompressData(progress))
580
			if (!fit->UncompressData(progress))
581
			{
581
			{
582
				if (fit->GetCompressionType() == SPKCOMPRESS_7ZIP)
582
				if (fit->GetCompressionType() == SPKCOMPRESS_7ZIP)
583
				{
583
				{
584
					if (!fit->UncompressToFile("temp", this, false, progress))
584
					if (!fit->uncompressToFile("temp", this, false, progress))
585
						return false;
585
						return false;
586
					else
586
					else
587
					{
587
					{
588
						uncomprToFile = true;
588
						uncomprToFile = true;
589
						fit->SetFullDir("temp");
589
						fit->setFullDir("temp");
590
					}
590
					}
591
				}
591
				}
592
 
592
 
593
				if (!uncomprToFile)
593
				if (!uncomprToFile)
594
					return false;
594
					return false;
Line 604... Line 604...
604
size_t CBaseFile::fileSize() const
604
size_t CBaseFile::fileSize() const
605
{
605
{
606
	size_t fullsize = 1000;
606
	size_t fullsize = 1000;
607
 
607
 
608
	for (CListNode<C_File>* node = m_lFiles.Front(); node; node = node->next())
608
	for (CListNode<C_File>* node = m_lFiles.Front(); node; node = node->next())
609
		fullsize += node->Data()->GetUncompressedDataSize();
609
		fullsize += node->Data()->uncompressedDataSize();
610
 
610
 
611
	if (m_pIconFile)
611
	if (m_pIconFile)
612
		fullsize += m_pIconFile->GetUncompressedDataSize();
612
		fullsize += m_pIconFile->uncompressedDataSize();
613
 
613
 
614
	return fullsize;
614
	return fullsize;
615
}
615
}
616
 
616
 
617
/*
617
/*
Line 691... Line 691...
691
 
691
 
692
		// compress the file
692
		// compress the file
693
		if (!m_pIconFile->CompressData(m_SHeader2.iDataCompression, progress))
693
		if (!m_pIconFile->CompressData(m_SHeader2.iDataCompression, progress))
694
			m_pIconFile->SetDataCompression(SPKCOMPRESS_NONE);
694
			m_pIconFile->SetDataCompression(SPKCOMPRESS_NONE);
695
 
695
 
696
		line += "Icon:" + Utils::String::Number(m_pIconFile->GetDataSize() + (long)4) + ":" + m_pIconFile->GetUncompressedDataSize() + ":" + (long)m_pIconFile->GetCompressionType() + ":" + _sIconExt + "\n";
696
		line += "Icon:" + Utils::String::Number(m_pIconFile->GetDataSize() + (long)4) + ":" + m_pIconFile->uncompressedDataSize() + ":" + (long)m_pIconFile->GetCompressionType() + ":" + _sIconExt + "\n";
697
		if (header)
697
		if (header)
698
		{
698
		{
699
			++header->iNumFiles;
699
			++header->iNumFiles;
700
			header->lFullSize += (m_pIconFile->GetDataSize() + 4);
700
			header->lFullSize += (m_pIconFile->GetDataSize() + 4);
701
		}
701
		}
Line 736... Line 736...
736
 
736
 
737
		if (file->IsShared())
737
		if (file->IsShared())
738
			command = "$" + command;
738
			command = "$" + command;
739
 
739
 
740
		if (file->dir().empty())
740
		if (file->dir().empty())
741
			line += command + ":" + (file->GetDataSize() + (long)4) + ":" + file->GetUncompressedDataSize() + ":" + (long)file->GetCompressionType() + ":" + (long)file->GetCreationTime() + ":" + ((file->IsCompressedToFile()) ? "1" : "0") + ":" + file->filename() + ":NULL:" + (long)file->game() + "\n";
741
			line += command + ":" + (file->GetDataSize() + (long)4) + ":" + file->uncompressedDataSize() + ":" + (long)file->GetCompressionType() + ":" + (long)file->GetCreationTime() + ":" + ((file->IsCompressedToFile()) ? "1" : "0") + ":" + file->filename() + ":NULL:" + (long)file->game() + "\n";
742
		else
742
		else
743
			line += command + ":" + (file->GetDataSize() + (long)4) + ":" + file->GetUncompressedDataSize() + ":" + (long)file->GetCompressionType() + ":" + (long)file->GetCreationTime() + ":" + ((file->IsCompressedToFile()) ? "1" : "0") + ":" + file->filename() + ":" + file->dir() + ":" + (long)file->game() + "\n";
743
			line += command + ":" + (file->GetDataSize() + (long)4) + ":" + file->uncompressedDataSize() + ":" + (long)file->GetCompressionType() + ":" + (long)file->GetCreationTime() + ":" + ((file->IsCompressedToFile()) ? "1" : "0") + ":" + file->filename() + ":" + file->dir() + ":" + (long)file->game() + "\n";
744
 
744
 
745
		if (header)
745
		if (header)
746
		{
746
		{
747
			++header->iNumFiles;
747
			++header->iNumFiles;
748
			header->lFullSize += (file->GetDataSize() + 4);
748
			header->lFullSize += (file->GetDataSize() + 4);
Line 902... Line 902...
902
		// only do fake patchs
902
		// only do fake patchs
903
		if ( !fit->IsFakePatch() )
903
		if ( !fit->IsFakePatch() )
904
			continue;
904
			continue;
905
 
905
 
906
		// we should only have cat and dat files, but lets check just incase they have been added incorrectly
906
		// we should only have cat and dat files, but lets check just incase they have been added incorrectly
907
		if ( !fit->CheckFileExt ("cat") && !fit->CheckFileExt("dat") )
907
		if ( !fit->checkFileExt ("cat") && !fit->checkFileExt("dat") )
908
			continue;
908
			continue;
909
 
909
 
910
		// search for the name on the list
910
		// search for the name on the list
911
		Utils::String newname;
911
		Utils::String newname;
912
		bool isOpposite = false;
912
		bool isOpposite = false;
Line 954... Line 954...
954
{
954
{
955
	if ( !bEnable )
955
	if ( !bEnable )
956
	{
956
	{
957
		if ( (fit->GetFileType() == FILETYPE_UNINSTALL) || (fit->GetFileType() == FILETYPE_README) || (fit->GetFileType() == FILETYPE_ADVERT) )
957
		if ( (fit->GetFileType() == FILETYPE_UNINSTALL) || (fit->GetFileType() == FILETYPE_README) || (fit->GetFileType() == FILETYPE_ADVERT) )
958
			bEnable = true;
958
			bEnable = true;
959
		else if ( (fit->GetFileType() == FILETYPE_EXTRA) && (fit->GetDir().Left(7).ToLower() == "Extras/") )
959
		else if ( (fit->GetFileType() == FILETYPE_EXTRA) && (fit->dir().left(7).lower() == "Extras/") )
960
			bEnable = true;
960
			bEnable = true;
961
		else if ( (IsPatch()) && (fit->GetFileType() == FILETYPE_MOD) && (!fit->IsFakePatch()) )
961
		else if ( (IsPatch()) && (fit->GetFileType() == FILETYPE_MOD) && (!fit->IsFakePatch()) )
962
			bEnable = true;
962
			bEnable = true;
963
 
963
 
964
		if ( bEnable ) CLog::logf(CLog::Log_Install, 3, "Filetype(%d) is always enabled, setting enabled flag", fit->GetFileType());
964
		if ( bEnable ) CLog::logf(CLog::Log_Install, 3, "Filetype(%d) is always enabled, setting enabled flag", fit->GetFileType());
Line 976... Line 976...
976
	if ( !fit->UncompressData ( progress ) )
976
	if ( !fit->UncompressData ( progress ) )
977
	{
977
	{
978
		CLog::log(CLog::Log_Install, 2, "Failed to uncompress data, attempting file decompression");
978
		CLog::log(CLog::Log_Install, 2, "Failed to uncompress data, attempting file decompression");
979
		if ( fit->GetCompressionType() == SPKCOMPRESS_7ZIP )
979
		if ( fit->GetCompressionType() == SPKCOMPRESS_7ZIP )
980
		{
980
		{
981
			if ( fit->UncompressToFile ( NullString, this, false, progress ) )
981
			if ( fit->uncompressToFile(Utils::String::Null(), this, false, progress ) )
982
				*uncomprToFile = true;
982
				*uncomprToFile = true;
983
		}
983
		}
984
 
984
 
985
		if ( !uncomprToFile )
985
		if ( !uncomprToFile )
986
		{
986
		{
Line 1044... Line 1044...
1044
			if ( pFile->IsFakePatch() )
1044
			if ( pFile->IsFakePatch() )
1045
				pFile->setFilename ( filename + "PluginManager/Disabled/FakePatches/FakePatch_" + this->getNameValidFile() + "_" + this->author() + "_" + pFile->name() );
1045
				pFile->setFilename ( filename + "PluginManager/Disabled/FakePatches/FakePatch_" + this->getNameValidFile() + "_" + this->author() + "_" + pFile->name() );
1046
			else if ( pFile->isAutoTextFile() )
1046
			else if ( pFile->isAutoTextFile() )
1047
				pFile->setFilename ( filename + "PluginManager/Disabled/TextFiles/Text_" + this->getNameValidFile() + "_" + this->author() + "_" + pFile->name() );
1047
				pFile->setFilename ( filename + "PluginManager/Disabled/TextFiles/Text_" + this->getNameValidFile() + "_" + this->author() + "_" + pFile->name() );
1048
			else
1048
			else
1049
				pFile->SetFullDir ( filename + "PluginManager/Disabled/" + pFile->getDirectory(this) );
1049
				pFile->setFullDir ( filename + "PluginManager/Disabled/" + pFile->getDirectory(this) );
1050
		}
1050
		}
1051
		pFile->SetDisabled(true);
1051
		pFile->SetDisabled(true);
1052
	}
1052
	}
1053
 
1053
 
1054
	CLog::logf(CLog::Log_Install, 2, "Adjusting the file pointer to correct install destintation, %s", pFile->filePointer().c_str());
1054
	CLog::logf(CLog::Log_Install, 2, "Adjusting the file pointer to correct install destintation, %s", pFile->filePointer().c_str());
Line 1105... Line 1105...
1105
				fromcat.removeFile(tofile);
1105
				fromcat.removeFile(tofile);
1106
				CLog::logf(CLog::Log_Install, 2, "Removing file from existing mod, %s::%s", pCheckFile->filePointer().token("::", 1).c_str(), tofile.c_str());
1106
				CLog::logf(CLog::Log_Install, 2, "Removing file from existing mod, %s::%s", pCheckFile->filePointer().token("::", 1).c_str(), tofile.c_str());
1107
			}
1107
			}
1108
 
1108
 
1109
			CLog::logf(CLog::Log_Install, 1, "Adjusting existing file name %s => %s", pCheckFile->filePointer().c_str(), fit->filePointer().c_str());
1109
			CLog::logf(CLog::Log_Install, 1, "Adjusting existing file name %s => %s", pCheckFile->filePointer().c_str(), fit->filePointer().c_str());
1110
			pCheckFile->SetFilename ( fit->GetFilePointer() );
1110
			pCheckFile->setFilename(fit->filePointer());
1111
			CLog::logf(CLog::Log_Install, 2, "Adjusting In Mod setting, %s => %s", pCheckFile->getInMod().c_str(), fit->getInMod().c_str());
1111
			CLog::logf(CLog::Log_Install, 2, "Adjusting In Mod setting, %s => %s", pCheckFile->getInMod().c_str(), fit->getInMod().c_str());
1112
			pCheckFile->setInMod(fit->getInMod());
1112
			pCheckFile->setInMod(fit->getInMod());
1113
		}
1113
		}
1114
		else {
1114
		else {
1115
			Utils::String to = pCheckFile->getDirectory(this);
1115
			Utils::String to = pCheckFile->getDirectory(this);
Line 1122... Line 1122...
1122
				if ( errorStr )	errorStr->pushBack(to, ERRORLOG(SPKINSTALL_CREATEDIRECTORY));
1122
				if ( errorStr )	errorStr->pushBack(to, ERRORLOG(SPKINSTALL_CREATEDIRECTORY));
1123
			}
1123
			}
1124
 
1124
 
1125
			Utils::String destfile = sDestination + "/" + pCheckFile->getNameDirectory(this);
1125
			Utils::String destfile = sDestination + "/" + pCheckFile->getNameDirectory(this);
1126
			if ( CFileIO(destfile).ExistsOld() ) CFileIO::Remove(destfile);
1126
			if ( CFileIO(destfile).ExistsOld() ) CFileIO::Remove(destfile);
1127
			CLog::logf(CLog::Log_Install, 1, "Adjusting existing filename, %s => %s", pCheckFile->GetFilePointer().c_str(), destfile.c_str());
1127
			CLog::logf(CLog::Log_Install, 1, "Adjusting existing filename, %s => %s", pCheckFile->filePointer().c_str(), destfile.c_str());
1128
			rename ( pCheckFile->filePointer().c_str(), destfile.c_str() );
1128
			rename ( pCheckFile->filePointer().c_str(), destfile.c_str() );
1129
			pCheckFile->setFilename (sDestination + "/" + pCheckFile->getNameDirectory(this) );
1129
			pCheckFile->setFilename (sDestination + "/" + pCheckFile->getNameDirectory(this) );
1130
		}
1130
		}
1131
		pCheckFile->SetDisabled(false);
1131
		pCheckFile->SetDisabled(false);
1132
 
1132
 
Line 1214... Line 1214...
1214
	for ( CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next() )
1214
	for ( CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next() )
1215
	{
1215
	{
1216
		C_File *fit = node->Data();
1216
		C_File *fit = node->Data();
1217
 
1217
 
1218
		// start the install process, check if we need to the file enabled or disabled
1218
		// start the install process, check if we need to the file enabled or disabled
1219
		CLog::logf(CLog::Log_Install, 1, "Preparing to install file: %s", fit->GetNameDirectory(this).c_str());
1219
		CLog::logf(CLog::Log_Install, 1, "Preparing to install file: %s", fit->getNameDirectory(this).c_str());
1220
		bool fileEnabled = _install_setEnabled(enabled, fit);
1220
		bool fileEnabled = _install_setEnabled(enabled, fit);
1221
 
1221
 
1222
		// check if the file is for the correct game version
1222
		// check if the file is for the correct game version
1223
		if (!fit->isForGame(packages->GetGame())) 
1223
		if (!fit->isForGame(packages->GetGame())) 
1224
		{
1224
		{
Line 1622... Line 1622...
1622
		dir = Utils::String::Null();
1622
		dir = Utils::String::Null();
1623
	}
1623
	}
1624
 
1624
 
1625
	file->setFileType(type);
1625
	file->setFileType(type);
1626
	file->SetCreationTime ( time );
1626
	file->SetCreationTime ( time );
1627
	file->SetName ( name );
1627
	file->setName(name);
1628
	file->SetDir ( dir );
1628
	file->setDir(dir);
1629
	file->SetDataSize ( size - 4 );
1629
	file->SetDataSize ( size - 4 );
1630
	file->SetDataCompression ( compression );
1630
	file->SetDataCompression ( compression );
1631
	file->SetUncompressedDataSize ( usize );
1631
	file->SetUncompressedDataSize ( usize );
1632
	file->SetShared ( shared );
1632
	file->SetShared ( shared );
1633
	file->SetCompressedToFile ( compressToFile );
1633
	file->SetCompressedToFile ( compressToFile );
Line 2068... Line 2068...
2068
	}
2068
	}
2069
 
2069
 
2070
	// now finally, write all the file data
2070
	// now finally, write all the file data
2071
	if ( m_pIconFile ) {
2071
	if ( m_pIconFile ) {
2072
		if ( progress )	progress->UpdateFile(m_pIconFile);
2072
		if ( progress )	progress->UpdateFile(m_pIconFile);
2073
		file.writeSize(m_pIconFile->GetUncompressedDataSize());
2073
		file.writeSize(m_pIconFile->uncompressedDataSize());
2074
		file.write(m_pIconFile->GetData(), m_pIconFile->GetDataSize());
2074
		file.write(m_pIconFile->GetData(), m_pIconFile->GetDataSize());
2075
		if ( progress )	progress->IncDone(m_pIconFile->GetDataSize());
2075
		if ( progress )	progress->IncDone(m_pIconFile->GetDataSize());
2076
	}
2076
	}
2077
 
2077
 
2078
	for ( CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next() )
2078
	for ( CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next() )
2079
	{
2079
	{
2080
		C_File *f = node->Data();
2080
		C_File *f = node->Data();
2081
		if ( progress )	progress->UpdateFile(f);
2081
		if ( progress )	progress->UpdateFile(f);
2082
		file.writeSize(f->GetUncompressedDataSize());
2082
		file.writeSize(f->uncompressedDataSize());
2083
		unsigned char *data = f->GetData();
2083
		unsigned char *data = f->GetData();
2084
		size_t remaining = f->GetDataSize();
2084
		size_t remaining = f->GetDataSize();
2085
		while ( remaining )	{
2085
		while ( remaining )	{
2086
			size_t writeSize = WRITECHUNK;
2086
			size_t writeSize = WRITECHUNK;
2087
			if ( writeSize > remaining ) writeSize = remaining;
2087
			if ( writeSize > remaining ) writeSize = remaining;
Line 2108... Line 2108...
2108
		if (!data)
2108
		if (!data)
2109
		{
2109
		{
2110
			// attempt a file decompress
2110
			// attempt a file decompress
2111
			if (file->GetCompressionType() == SPKCOMPRESS_7ZIP)
2111
			if (file->GetCompressionType() == SPKCOMPRESS_7ZIP)
2112
			{
2112
			{
2113
				if (file->UncompressToFile(dir, this, includedir, progress))
2113
				if (file->uncompressToFile(dir, this, includedir, progress))
2114
					return true;
2114
					return true;
2115
			}
2115
			}
2116
			return false;
2116
			return false;
2117
		}
2117
		}
2118
 
2118
 
Line 2152... Line 2152...
2152
		if (!data)
2152
		if (!data)
2153
		{
2153
		{
2154
			// attempt a file decompress
2154
			// attempt a file decompress
2155
			if (file->GetCompressionType() == SPKCOMPRESS_7ZIP)
2155
			if (file->GetCompressionType() == SPKCOMPRESS_7ZIP)
2156
			{
2156
			{
2157
				if (file->UncompressToFile(Dir.dir(), this, includedir, progress))
2157
				if (file->uncompressToFile(Dir.dir(), this, includedir, progress))
2158
					return true;
2158
					return true;
2159
			}
2159
			}
2160
			return false;
2160
			return false;
2161
		}
2161
		}
2162
 
2162
 
Line 2248... Line 2248...
2248
		Dir.create(fit->getDirectory(this));
2248
		Dir.create(fit->getDirectory(this));
2249
 
2249
 
2250
		long size = 0;
2250
		long size = 0;
2251
		unsigned char *data = fit->UncompressData(&size, progress);
2251
		unsigned char *data = fit->UncompressData(&size, progress);
2252
		if ((!data) && (fit->GetCompressionType() == SPKCOMPRESS_7ZIP)) {
2252
		if ((!data) && (fit->GetCompressionType() == SPKCOMPRESS_7ZIP)) {
2253
			if (!fit->UncompressToFile(Dir.dir(), this, includedir, progress)) return false;
2253
			if (!fit->uncompressToFile(Dir.dir(), this, includedir, progress)) return false;
2254
		}
2254
		}
2255
		else if ((!data) || (!fit->writeToDir(Dir.dir(), this, includedir, Utils::String::Null(), data, size))) return false;
2255
		else if ((!data) || (!fit->writeToDir(Dir.dir(), this, includedir, Utils::String::Null(), data, size))) return false;
2256
	}
2256
	}
2257
 
2257
 
2258
	delete File;
2258
	delete File;
Line 2647... Line 2647...
2647
			}
2647
			}
2648
		}
2648
		}
2649
 
2649
 
2650
		s += " " + name;
2650
		s += " " + name;
2651
		if(!files.contains(s))
2651
		if(!files.contains(s))
2652
			files.pushBack(s, f->Data()->GetFileTypeString().ToString());
2652
			files.pushBack(s, f->Data()->fileTypeString());
2653
	}
2653
	}
2654
 
2654
 
2655
 
2655
 
2656
	if ( !files.empty() )
2656
	if ( !files.empty() )
2657
	{
2657
	{
Line 3079... Line 3079...
3079
	if ( match )
3079
	if ( match )
3080
	{
3080
	{
3081
		// file link
3081
		// file link
3082
		if ( !match->GetData() )
3082
		if ( !match->GetData() )
3083
			match->ReadFromFile();
3083
			match->ReadFromFile();
3084
		match->ChangeBaseName(to);
3084
		match->changeBaseName(to);
3085
	}
3085
	}
3086
 
3086
 
3087
	// file link
3087
	// file link
3088
	if ( !f->GetData() )
3088
	if ( !f->GetData() )
3089
		f->ReadFromFile();
3089
		f->ReadFromFile();
3090
 
3090
 
3091
	f->ChangeBaseName(to);
3091
	f->changeBaseName(to);
3092
}
3092
}
3093
 
3093
 
3094
void CBaseFile::convertAutoText(C_File *f) const
3094
void CBaseFile::convertAutoText(C_File *f) const
3095
{
3095
{
3096
	Utils::String to;
3096
	Utils::String to;
3097
	if ( f->baseName().contains("-L") )
3097
	if ( f->baseName().contains("-L") )
3098
		to = "0000-L" + f->baseName().token("-L", 2);
3098
		to = "0000-L" + f->baseName().token("-L", 2);
3099
	else if ( f->GetBaseName().IsIn("-l") )
3099
	else if ( f->baseName().contains("-l") )
3100
		to = "0000-L" + f->baseName().token("-l", 2);
3100
		to = "0000-L" + f->baseName().token("-l", 2);
3101
	else
3101
	else
3102
		to = f->baseName().left(-4) + "0000";
3102
		to = f->baseName().left(-4) + "0000";
3103
 
3103
 
3104
	// file link
3104
	// file link
3105
	if ( !f->GetData() )
3105
	if ( !f->GetData() )
3106
		f->ReadFromFile();
3106
		f->ReadFromFile();
3107
 
3107
 
3108
	f->ChangeBaseName(to);
3108
	f->changeBaseName(to);
3109
}
3109
}
3110
 
3110
 
3111
void CBaseFile::convertFakePatch(C_File *f) const
3111
void CBaseFile::convertFakePatch(C_File *f) const
3112
{
3112
{
3113
	// find next available fake patch
3113
	// find next available fake patch
Line 3138... Line 3138...
3138
 
3138
 
3139
	// file link
3139
	// file link
3140
	if ( !f->GetData() )
3140
	if ( !f->GetData() )
3141
		f->ReadFromFile();
3141
		f->ReadFromFile();
3142
 
3142
 
3143
	f->ChangeBaseName(to);
3143
	f->changeBaseName(to);
3144
	if ( match )
3144
	if ( match )
3145
	{
3145
	{
3146
		// file link
3146
		// file link
3147
		if ( !match->GetData() )
3147
		if ( !match->GetData() )
3148
			match->ReadFromFile();
3148
			match->ReadFromFile();
3149
		match->ChangeBaseName(to);
3149
		match->changeBaseName(to);
3150
	}
3150
	}
3151
}
3151
}
3152
 
3152
 
3153
C_File *CBaseFile::findMatchingMod(C_File *f) const
3153
C_File *CBaseFile::findMatchingMod(C_File *f) const
3154
{
3154
{
3155
	for ( CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next() )
3155
	for ( CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next() )
3156
	{
3156
	{
3157
		if ( node->Data()->GetFileType() != FILETYPE_MOD )
3157
		if ( node->Data()->GetFileType() != FILETYPE_MOD )
3158
			continue;
3158
			continue;
3159
		 
3159
		 
3160
		if ( f->GetFileExt().Compare(node->Data()->GetFileExt()) )
3160
		if ( f->fileExt().Compare(node->Data()->fileExt()) )
3161
			continue;
3161
			continue;
3162
 
3162
 
3163
		if ( f->GetBaseName().Compare(node->Data()->GetBaseName()) )
3163
		if ( f->baseName().Compare(node->Data()->baseName()) )
3164
			return node->Data();
3164
			return node->Data();
3165
	}
3165
	}
3166
 
3166
 
3167
	return NULL;
3167
	return NULL;
3168
}
3168
}
Line 3171... Line 3171...
3171
{
3171
{
3172
	if ( f->GetFileType() == FILETYPE_MOD )
3172
	if ( f->GetFileType() == FILETYPE_MOD )
3173
	{
3173
	{
3174
		C_File *match = this->findMatchingMod(f);
3174
		C_File *match = this->findMatchingMod(f);
3175
		if ( match )
3175
		if ( match )
3176
			match->ChangeBaseName(baseName);
3176
			match->changeBaseName(baseName);
3177
	}
3177
	}
3178
 
3178
 
3179
	// need to edit the file
3179
	// need to edit the file
3180
	if (f->GetFileType() == FILETYPE_SCRIPT || f->GetFileType() == FILETYPE_UNINSTALL)
3180
	if (f->GetFileType() == FILETYPE_SCRIPT || f->GetFileType() == FILETYPE_UNINSTALL)
3181
		f->RenameScript(baseName);
3181
		f->renameScript(baseName);
3182
 
3182
 
3183
	f->ChangeBaseName(baseName);
3183
	f->changeBaseName(baseName);
3184
}
3184
}
3185
 
3185
 
3186
void CBaseFile::addWebMirror(const Utils::String& str) 
3186
void CBaseFile::addWebMirror(const Utils::String& str) 
3187
{ 
3187
{ 
3188
	if (!_lMirrors.contains(str))
3188
	if (!_lMirrors.contains(str))