Changeset View
Changeset View
Standalone View
Standalone View
ksirk/GameLogic/goal.cpp
Show First 20 Lines • Show All 221 Lines • ▼ Show 20 Line(s) | 218 | case Goal::Countries: | |||
---|---|---|---|---|---|
222 | { | 222 | { | ||
223 | qCDebug(KSIRK_LOG) << " arg2 = '" << m_nbArmiesByCountry << "'" << endl; | 223 | qCDebug(KSIRK_LOG) << " arg2 = '" << m_nbArmiesByCountry << "'" << endl; | ||
224 | res=res.subs(m_nbArmiesByCountry); | 224 | res=res.subs(m_nbArmiesByCountry); | ||
225 | } | 225 | } | ||
226 | break; | 226 | break; | ||
227 | case Goal::Continents: | 227 | case Goal::Continents: | ||
228 | foreach (const QString& continent, m_continents) | 228 | foreach (const QString& continent, m_continents) | ||
229 | { | 229 | { | ||
230 | if (continent != QString()) | 230 | if (!continent.isEmpty()) | ||
231 | { | 231 | { | ||
232 | qCDebug(KSIRK_LOG) << " arg = '" << continent << "'" << endl; | 232 | qCDebug(KSIRK_LOG) << " arg = '" << continent << "'" << endl; | ||
233 | res=res.subs(i18n(continent.toUtf8().data())); | 233 | res=res.subs(i18n(continent.toUtf8().data())); | ||
234 | } | 234 | } | ||
235 | } | 235 | } | ||
236 | break; | 236 | break; | ||
237 | default:; | 237 | default:; | ||
238 | } | 238 | } | ||
▲ Show 20 Lines • Show All 219 Lines • ▼ Show 20 Line(s) | 452 | { | |||
458 | } | 458 | } | ||
459 | xmlStream << "\" type=\"" << m_type << "\" description=\"" << m_description; | 459 | xmlStream << "\" type=\"" << m_type << "\" description=\"" << m_description; | ||
460 | xmlStream << "\" nbCountries=\"" << m_nbCountries << "\" nbArmiesByCountry=\"" << m_nbArmiesByCountry << "\">" << endl; | 460 | xmlStream << "\" nbCountries=\"" << m_nbCountries << "\" nbArmiesByCountry=\"" << m_nbArmiesByCountry << "\">" << endl; | ||
461 | xmlStream << "<continents>" << endl; | 461 | xmlStream << "<continents>" << endl; | ||
462 | QList<QString>::ConstIterator itc, itc_end; | 462 | QList<QString>::ConstIterator itc, itc_end; | ||
463 | itc = continents().constBegin(); itc_end = continents().constEnd(); | 463 | itc = continents().constBegin(); itc_end = continents().constEnd(); | ||
464 | for (; itc != itc_end; itc++) | 464 | for (; itc != itc_end; itc++) | ||
465 | { | 465 | { | ||
466 | QString name = (*itc==QString())?"":(*itc); | 466 | QString name = ((*itc).isEmpty())?"":(*itc); | ||
467 | xmlStream << "<continent name=\"" << name << "\"/>" << endl; | 467 | xmlStream << "<continent name=\"" << name << "\"/>" << endl; | ||
468 | } | 468 | } | ||
469 | xmlStream << "</continents>" << endl; | 469 | xmlStream << "</continents>" << endl; | ||
470 | xmlStream << "<players>" << endl; | 470 | xmlStream << "<players>" << endl; | ||
471 | QList<QString>::ConstIterator itp, itp_end; | 471 | QList<QString>::ConstIterator itp, itp_end; | ||
472 | itp = m_players.constBegin(); itp_end = m_players.constEnd(); | 472 | itp = m_players.constBegin(); itp_end = m_players.constEnd(); | ||
473 | for (; itp != itp_end; itp++) | 473 | for (; itp != itp_end; itp++) | ||
474 | { | 474 | { | ||
Show All 9 Lines |