160 QString name = QString::fromUtf8(m_team->name); |
160 QString name = QString::fromUtf8(m_team->name); |
161 |
161 |
162 if(m_team) |
162 if(m_team) |
163 flib_team_destroy(m_team); |
163 flib_team_destroy(m_team); |
164 |
164 |
165 m_team = flib_team_from_ini(QString("/config/Teams/%1.hwt").arg(name).toUtf8().data()); |
165 m_team = flib_team_from_ini(QString("/Teams/%1.hwt").arg(name).toUtf8().data()); |
166 |
166 |
167 return m_team != NULL; |
167 return m_team != NULL; |
168 } |
168 } |
169 |
169 |
170 bool HWTeam::fileExists() |
170 bool HWTeam::fileExists() |
171 { |
171 { |
172 QFile f(QString("physfs://config/Teams/%1.hwt").arg(name())); |
172 QFile f(QString("physfs://Teams/%1.hwt").arg(name())); |
173 return f.exists(); |
173 return f.exists(); |
174 } |
174 } |
175 |
175 |
176 bool HWTeam::deleteFile() |
176 bool HWTeam::deleteFile() |
177 { |
177 { |
178 if(m_team->remoteDriven) |
178 if(m_team->remoteDriven) |
179 return false; |
179 return false; |
180 |
180 |
181 QFile cfgfile(QString("physfs://config/Teams/%1.hwt").arg(name())); |
181 QFile cfgfile(QString("physfs://Teams/%1.hwt").arg(name())); |
182 cfgfile.remove(); |
182 cfgfile.remove(); |
183 return true; |
183 return true; |
184 } |
184 } |
185 |
185 |
186 bool HWTeam::saveToFile() |
186 bool HWTeam::saveToFile() |
187 { |
187 { |
188 if (m_oldTeamName != name()) |
188 if (m_oldTeamName != name()) |
189 { |
189 { |
190 QFile cfgfile(QString("physfs://config/Teams/%1.hwt").arg(m_oldTeamName)); |
190 QFile cfgfile(QString("physfs://Teams/%1.hwt").arg(m_oldTeamName)); |
191 cfgfile.remove(); |
191 cfgfile.remove(); |
192 m_oldTeamName = name(); |
192 m_oldTeamName = name(); |
193 } |
193 } |
194 |
194 |
195 return flib_team_to_ini(QString("physfs://config/Teams/%1.hwt").arg(name()).toUtf8(), m_team) == 0; |
195 return flib_team_to_ini(QString("physfs://Teams/%1.hwt").arg(name()).toUtf8(), m_team) == 0; |
196 } |
196 } |
197 |
197 |
198 |
198 |
199 bool HWTeam::isNetTeam() const |
199 bool HWTeam::isNetTeam() const |
200 { |
200 { |