MeteorShower.cpp   MeteorShower.cpp 
skipping to change at line 45 skipping to change at line 45
, m_status(INVALID) , m_status(INVALID)
, m_speed(0) , m_speed(0)
, m_rAlphaPeak(0) , m_rAlphaPeak(0)
, m_rDeltaPeak(0) , m_rDeltaPeak(0)
, m_driftAlpha(0) , m_driftAlpha(0)
, m_driftDelta(0) , m_driftDelta(0)
, m_pidx(0) , m_pidx(0)
, m_radiantAlpha(0) , m_radiantAlpha(0)
, m_radiantDelta(0) , m_radiantDelta(0)
{ {
// return initialized if the mandatory fields are not present
if(!map.contains("showerID") || !map.contains("activity") if(!map.contains("showerID") || !map.contains("activity")
|| !map.contains("radiantAlpha") || !map.contains("radiantDe lta")) || !map.contains("radiantAlpha") || !map.contains("radiantDe lta"))
{ {
qWarning() << "MeteorShower: INVALID meteor shower!" << map. value("showerID").toString(); qWarning() << "MeteorShower: INVALID meteor shower!" << map. value("showerID").toString();
qWarning() << "MeteorShower: Please, check your 'showers.jso n' catalog!"; qWarning() << "MeteorShower: Please, check your 'showers.jso n' catalog!";
return; return;
} }
m_showerID = map.value("showerID").toString(); m_showerID = map.value("showerID").toString();
m_designation = map.value("designation").toString(); m_designation = map.value("designation").toString();
skipping to change at line 192 skipping to change at line 191
qWarning() << "MeteorShower: Please, check your 'sho wers.json' catalog!"; qWarning() << "MeteorShower: Please, check your 'sho wers.json' catalog!";
m_colors.clear(); m_colors.clear();
} }
} }
if (m_colors.isEmpty()) { if (m_colors.isEmpty()) {
m_colors.push_back(Meteor::ColorPair("white", 100)); m_colors.push_back(Meteor::ColorPair("white", 100));
} }
m_status = UNDEFINED; m_status = UNDEFINED;
qsrand(QDateTime::currentMSecsSinceEpoch());
} }
MeteorShower::~MeteorShower() MeteorShower::~MeteorShower()
{ {
qDeleteAll(m_activeMeteors); qDeleteAll(m_activeMeteors);
m_activeMeteors.clear(); m_activeMeteors.clear();
} }
bool MeteorShower::enabled() const bool MeteorShower::enabled() const
{ {
skipping to change at line 308 skipping to change at line 305
{ {
float prob = (float) qrand() / (float) RAND_MAX; float prob = (float) qrand() / (float) RAND_MAX;
if (prob < rate) if (prob < rate)
{ {
MeteorObj *m = new MeteorObj(core, m_speed, m_radian tAlpha, m_radiantDelta, MeteorObj *m = new MeteorObj(core, m_speed, m_radian tAlpha, m_radiantDelta,
m_pidx, m_colors, m_mgr ->getBolideTexture()); m_pidx, m_colors, m_mgr ->getBolideTexture());
if (m->isAlive()) if (m->isAlive())
{ {
m_activeMeteors.append(m); m_activeMeteors.append(m);
} }
else
{
delete m;
}
} }
} }
} }
void MeteorShower::draw(StelCore* core) void MeteorShower::draw(StelCore* core)
{ {
if (!enabled()) if (!enabled())
{ {
return; return;
} }
skipping to change at line 531 skipping to change at line 532
} }
else if (m_status == ACTIVE_CONFIRMED) else if (m_status == ACTIVE_CONFIRMED)
{ {
mstdata = q_("confirmed data"); mstdata = q_("confirmed data");
} }
else if (m_status == INACTIVE) else if (m_status == INACTIVE)
{ {
mstdata = q_("inactive"); mstdata = q_("inactive");
} }
if(flags&Name) if (flags&Name)
{ {
oss << "<h2>" << getNameI18n(); oss << "<h2>" << getNameI18n();
if (!m_showerID.toInt()) if (!m_showerID.toInt())
{ {
oss << " (" << m_showerID <<")</h2>"; oss << " (" << m_showerID <<")</h2>";
} }
else else
{ {
oss << "</h2>"; oss << "</h2>";
} }
} }
if(flags&Extra) if (flags&Extra)
{ {
oss << q_("Type: <b>%1</b> (%2)").arg(q_("meteor shower"), m stdata) << "<br />"; oss << q_("Type: <b>%1</b> (%2)").arg(q_("meteor shower"), m stdata) << "<br />";
} }
// Ra/Dec etc. // Ra/Dec etc.
oss << getPositionInfoString(core, flags); oss << getPositionInfoString(core, flags);
if(flags&Extra) if (flags&Extra)
{ {
QString sDriftRA = StelUtils::radToHmsStr(m_driftAlpha); QString sDriftRA = StelUtils::radToHmsStr(m_driftAlpha);
QString sDriftDE = StelUtils::radToDmsStr(m_driftDelta); QString sDriftDE = StelUtils::radToDmsStr(m_driftDelta);
if (withDecimalDegree) if (withDecimalDegree)
{ {
sDriftRA = StelUtils::radToDecDegStr(m_driftAlpha,4, false,true); sDriftRA = StelUtils::radToDecDegStr(m_driftAlpha,4, false,true);
sDriftDE = StelUtils::radToDecDegStr(m_driftDelta,4, false,true); sDriftDE = StelUtils::radToDecDegStr(m_driftDelta,4, false,true);
} }
oss << QString("%1: %2/%3") oss << QString("%1: %2/%3")
.arg(q_("Radiant drift (per day)")) .arg(q_("Radiant drift (per day)"))
.arg(sDriftRA) .arg(sDriftRA)
.arg(sDriftDE); .arg(sDriftDE);
oss << "<br />"; oss << "<br />";
if (m_speed > 0) if (m_speed > 0)
{ {
oss << q_("Geocentric meteoric velocity: %1 km/s").a rg(m_speed) << "<br />"; oss << q_("Geocentric meteoric velocity: %1 km/s").a rg(m_speed) << "<br />";
} }
if(m_pidx > 0) if (m_pidx > 0)
{ {
oss << q_("The population index: %1").arg(m_pidx) << "<br />"; oss << q_("The population index: %1").arg(m_pidx) << "<br />";
} }
if(!m_parentObj.isEmpty()) if (!m_parentObj.isEmpty())
{ {
oss << q_("Parent body: %1").arg(q_(m_parentObj)) << "<br />"; oss << q_("Parent body: %1").arg(q_(m_parentObj)) << "<br />";
} }
// activity info // activity info
if (m_status != INACTIVE) if (m_status != INACTIVE)
{ {
if(m_activity.start.month() == m_activity.finish.mon th()) if(m_activity.start.month() == m_activity.finish.mon th())
{ {
oss << QString("%1: %2 - %3 %4") oss << QString("%1: %2 - %3 %4")
.arg(q_("Active")) .arg(q_("Activity"))
.arg(m_activity.start.day()) .arg(m_activity.start.day())
.arg(m_activity.finish.day()) .arg(m_activity.finish.day())
.arg(m_activity.start.toString("MMMM" )); .arg(m_activity.start.toString("MMMM" ));
} }
else else
{ {
oss << QString("%1: %2 - %3") oss << QString("%1: %2 - %3")
.arg(q_("Activity")) .arg(q_("Activity"))
.arg(m_activity.start.toString("d MMM M")) .arg(m_activity.start.toString("d MMM M"))
.arg(m_activity.finish.toString("d MM MM")); .arg(m_activity.finish.toString("d MM MM"));
skipping to change at line 618 skipping to change at line 619
if(m_activity.zhr > 0) if(m_activity.zhr > 0)
{ {
oss << QString("ZHR<sub>max</sub>: %1").arg( m_activity.zhr) << "<br />"; oss << QString("ZHR<sub>max</sub>: %1").arg( m_activity.zhr) << "<br />";
} }
else else
{ {
oss << QString("ZHR<sub>max</sub>: %1").arg( q_("variable")); oss << QString("ZHR<sub>max</sub>: %1").arg( q_("variable"));
if(m_activity.variable.size() == 2) if(m_activity.variable.size() == 2)
{ {
oss << QString("; %1-%2").arg(m_acti oss << QString("; %1-%2")
vity.variable.at(0)) .arg(m_activity.variable.at(0
))
.arg(m_activity.variable.at(1 )); .arg(m_activity.variable.at(1 ));
} }
oss << "<br />"; oss << "<br />";
} }
} }
} }
postProcessInfoString(str, flags); postProcessInfoString(str, flags);
return str; return str;
 End of changes. 10 change blocks. 
11 lines changed or deleted 13 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/