| Line 81... |
Line 81... |
| 81 |
}
|
81 |
}
|
| 82 |
|
82 |
|
| 83 |
m_lNames.clear(true);
|
83 |
m_lNames.clear(true);
|
| 84 |
}
|
84 |
}
|
| 85 |
|
85 |
|
| 86 |
CyString CBaseFile::GetLanguageName ( int lang )
|
86 |
CyString CBaseFile::GetLanguageName ( int lang ) const
|
| 87 |
{
|
87 |
{
|
| 88 |
for ( CListNode<SNames> *node = m_lNames.Front(); node; node = node->next() )
|
88 |
for ( CListNode<SNames> *node = m_lNames.Front(); node; node = node->next() )
|
| 89 |
{
|
89 |
{
|
| 90 |
SNames *n = node->Data();
|
90 |
SNames *n = node->Data();
|
| 91 |
if ( n->iLanguage == lang )
|
91 |
if ( n->iLanguage == lang )
|
| Line 1064... |
Line 1064... |
| 1064 |
pCheckFile->SetInMod(fit->GetInMod());
|
1064 |
pCheckFile->SetInMod(fit->GetInMod());
|
| 1065 |
}
|
1065 |
}
|
| 1066 |
else {
|
1066 |
else {
|
| 1067 |
CyString to = pCheckFile->GetDirectory(this);
|
1067 |
CyString to = pCheckFile->GetDirectory(this);
|
| 1068 |
CDirIO Dir(sDestination);
|
1068 |
CDirIO Dir(sDestination);
|
| 1069 |
if ( !Dir.Exists(to) ) {
|
1069 |
if ( !Dir.exists(to.ToString()) ) {
|
| 1070 |
if ( !Dir.Create ( to ) ) {
|
1070 |
if ( !Dir.Create ( to ) ) {
|
| 1071 |
if ( errorStr ) errorStr->PushBack(to, ERRORLOG(SPKINSTALL_CREATEDIRECTORY_FAIL));
|
1071 |
if ( errorStr ) errorStr->PushBack(to, ERRORLOG(SPKINSTALL_CREATEDIRECTORY_FAIL));
|
| 1072 |
return false;
|
1072 |
return false;
|
| 1073 |
}
|
1073 |
}
|
| 1074 |
if ( errorStr ) errorStr->PushBack(to, ERRORLOG(SPKINSTALL_CREATEDIRECTORY));
|
1074 |
if ( errorStr ) errorStr->PushBack(to, ERRORLOG(SPKINSTALL_CREATEDIRECTORY));
|
| Line 1091... |
Line 1091... |
| 1091 |
bool CBaseFile::_install_createDirectory(CDirIO &Dir, const Utils::String &sTo, C_File *pFile, CyStringList *errorStr)
|
1091 |
bool CBaseFile::_install_createDirectory(CDirIO &Dir, const Utils::String &sTo, C_File *pFile, CyStringList *errorStr)
|
| 1092 |
{
|
1092 |
{
|
| 1093 |
m_sLastError = sTo;
|
1093 |
m_sLastError = sTo;
|
| 1094 |
if ( !sTo.isin ( "::" ) )
|
1094 |
if ( !sTo.isin ( "::" ) )
|
| 1095 |
{
|
1095 |
{
|
| 1096 |
if ( !Dir.Exists(sTo) )
|
1096 |
if ( !Dir.exists(sTo) )
|
| 1097 |
{
|
1097 |
{
|
| 1098 |
CLog::logf(CLog::Log_Install, 2, "Creating directory to install file into, %s", sTo.c_str());
|
1098 |
CLog::logf(CLog::Log_Install, 2, "Creating directory to install file into, %s", sTo.c_str());
|
| 1099 |
if ( !Dir.Create(sTo) )
|
1099 |
if ( !Dir.Create(sTo) )
|
| 1100 |
{
|
1100 |
{
|
| 1101 |
if ( errorStr )
|
1101 |
if ( errorStr )
|
| Line 2724... |
Line 2724... |
| 2724 |
// check if the file exists in the subdirectory too, if it does, add for each game
|
2724 |
// check if the file exists in the subdirectory too, if it does, add for each game
|
| 2725 |
if ( game == GAME_ALL && !sMainGame.empty() && !otherGames.empty() ) {
|
2725 |
if ( game == GAME_ALL && !sMainGame.empty() && !otherGames.empty() ) {
|
| 2726 |
CFileIO F(file);
|
2726 |
CFileIO F(file);
|
| 2727 |
for(Utils::String g = otherGames.firstString(); !g.empty(); g = otherGames.nextString()) {
|
2727 |
for(Utils::String g = otherGames.firstString(); !g.empty(); g = otherGames.nextString()) {
|
| 2728 |
Utils::String checkDir = F.dir() + "/" + g;
|
2728 |
Utils::String checkDir = F.dir() + "/" + g;
|
| 2729 |
if ( CDirIO(checkDir).Exists(F.filename()) ) {
|
2729 |
if ( CDirIO(checkDir).exists(F.filename()) ) {
|
| 2730 |
addGame = mainGame;
|
2730 |
addGame = mainGame;
|
| 2731 |
C_File *newfile = this->AppendFile(CDirIO(checkDir).File(F.filename()), filetype, CBaseFile::GetGameFromString(g), dir);
|
2731 |
C_File *newfile = this->AppendFile(CDirIO(checkDir).File(F.filename()), filetype, CBaseFile::GetGameFromString(g), dir);
|
| 2732 |
if ( newfile ) newfile->SetShared(shared);
|
2732 |
if ( newfile ) newfile->SetShared(shared);
|
| 2733 |
}
|
2733 |
}
|
| 2734 |
}
|
2734 |
}
|
| Line 2748... |
Line 2748... |
| 2748 |
// check if the file exists in the subdirectory too, if it does, add for each game
|
2748 |
// check if the file exists in the subdirectory too, if it does, add for each game
|
| 2749 |
if ( game == GAME_ALL && !sMainGame.empty() && !otherGames.empty() ) {
|
2749 |
if ( game == GAME_ALL && !sMainGame.empty() && !otherGames.empty() ) {
|
| 2750 |
CFileIO F(rest);
|
2750 |
CFileIO F(rest);
|
| 2751 |
for(Utils::String g = otherGames.firstString(); !g.empty(); g = otherGames.nextString()) {
|
2751 |
for(Utils::String g = otherGames.firstString(); !g.empty(); g = otherGames.nextString()) {
|
| 2752 |
Utils::String checkDir = F.dir() + "/" + g;
|
2752 |
Utils::String checkDir = F.dir() + "/" + g;
|
| 2753 |
if ( CDirIO(checkDir).Exists(F.filename()) ) {
|
2753 |
if ( CDirIO(checkDir).exists(F.filename()) ) {
|
| 2754 |
addGame = mainGame;
|
2754 |
addGame = mainGame;
|
| 2755 |
C_File *newfile = this->AppendFile(CDirIO(checkDir).File(F.filename()), filetype, CBaseFile::GetGameFromString(g), dir);
|
2755 |
C_File *newfile = this->AppendFile(CDirIO(checkDir).file(F.filename()), filetype, CBaseFile::GetGameFromString(g), dir);
|
| 2756 |
if ( newfile ) newfile->SetShared(shared);
|
2756 |
if ( newfile ) newfile->SetShared(shared);
|
| 2757 |
}
|
2757 |
}
|
| 2758 |
}
|
2758 |
}
|
| 2759 |
}
|
2759 |
}
|
| 2760 |
|
2760 |
|