QTfrontend/team.cpp
changeset 12670 967990d958bc
parent 11046 47a8c19ecb60
child 13080 23a498a2b5b8
equal deleted inserted replaced
12669:bc34fc75670e 12670:967990d958bc
   206 {
   206 {
   207     QFile f(QString("physfs://Teams/%1.hwt").arg(DataManager::safeFileName(m_name)));
   207     QFile f(QString("physfs://Teams/%1.hwt").arg(DataManager::safeFileName(m_name)));
   208     return f.exists();
   208     return f.exists();
   209 }
   209 }
   210 
   210 
       
   211 // Returns true if the team name has been changed but a file with the same team name already exists.
       
   212 // So if this team would be saved, another team file would be overwritten, which is generally not
       
   213 // desired.
       
   214 bool HWTeam::wouldOverwriteOtherFile()
       
   215 {
       
   216     return (m_name != OldTeamName) && fileExists();
       
   217 }
       
   218 
   211 bool HWTeam::deleteFile()
   219 bool HWTeam::deleteFile()
   212 {
   220 {
   213     if(m_isNetTeam)
   221     if(m_isNetTeam)
   214         return false;
   222         return false;
   215     QFile cfgfile(QString("physfs://Teams/%1.hwt").arg(DataManager::safeFileName(m_name)));
   223     QFile cfgfile(QString("physfs://Teams/%1.hwt").arg(DataManager::safeFileName(m_name)));