Exoplanets.cpp   Exoplanets.cpp 
skipping to change at line 175 skipping to change at line 175
GlowIcon = new QPixmap(":/graphicsGui/glow32x32.png"); GlowIcon = new QPixmap(":/graphicsGui/glow32x32.png");
OnIcon = new QPixmap(":/Exoplanets/btExoplanets-on.png"); OnIcon = new QPixmap(":/Exoplanets/btExoplanets-on.png");
OffIcon = new QPixmap(":/Exoplanets/btExoplanets-off.png"); OffIcon = new QPixmap(":/Exoplanets/btExoplanets-off.png");
setFlagShowExoplanets(getEnableAtStartup()); setFlagShowExoplanets(getEnableAtStartup());
setFlagShowExoplanetsButton(flagShowExoplanetsButton); setFlagShowExoplanetsButton(flagShowExoplanetsButton);
connect(gui->getGuiAction("actionShow_Exoplanets_ConfigDialo g"), SIGNAL(toggled(bool)), exoplanetsConfigDialog, SLOT(setVisible(bool))) ; connect(gui->getGuiAction("actionShow_Exoplanets_ConfigDialo g"), SIGNAL(toggled(bool)), exoplanetsConfigDialog, SLOT(setVisible(bool))) ;
connect(exoplanetsConfigDialog, SIGNAL(visibleChanged(bool)) , gui->getGuiAction("actionShow_Exoplanets_ConfigDialog"), SLOT(setChecked( bool))); connect(exoplanetsConfigDialog, SIGNAL(visibleChanged(bool)) , gui->getGuiAction("actionShow_Exoplanets_ConfigDialog"), SLOT(setChecked( bool)));
if (flagShowExoplanetsButton) connect(gui->getGuiAction("actionShow_Exoplanets"), SIGNAL(t
{ oggled(bool)), this, SLOT(setFlagShowExoplanets(bool)));
connect(gui->getGuiAction("actionShow_Exoplanets"),
SIGNAL(toggled(bool)), this, SLOT(setFlagShowExoplanets(bool)));
}
} }
catch (std::runtime_error &e) catch (std::runtime_error &e)
{ {
qWarning() << "Exoplanets::init error: " << e.what(); qWarning() << "Exoplanets::init error: " << e.what();
return; return;
} }
// A timer for hiding alert messages // A timer for hiding alert messages
messageTimer = new QTimer(this); messageTimer = new QTimer(this);
messageTimer->setSingleShot(true); // recurring check for update messageTimer->setSingleShot(true); // recurring check for update
skipping to change at line 331 skipping to change at line 328
foreach(const ExoplanetP& eps, ep) foreach(const ExoplanetP& eps, ep)
{ {
if (eps->getNameI18n().toUpper() == nameI18n.toUpper()) if (eps->getNameI18n().toUpper() == nameI18n.toUpper())
return qSharedPointerCast<StelObject>(eps); return qSharedPointerCast<StelObject>(eps);
} }
return NULL; return NULL;
} }
QStringList Exoplanets::listMatchingObjectsI18n(const QString& objPrefix, i nt maxNbItem) const QStringList Exoplanets::listMatchingObjectsI18n(const QString& objPrefix, i nt maxNbItem, bool useStartOfWords) const
{ {
QStringList result; QStringList result;
if (!flagShowExoplanets) if (!flagShowExoplanets)
return result; return result;
if (maxNbItem==0) if (maxNbItem==0)
return result; return result;
QString epsn; QString epsn;
bool find;
foreach(const ExoplanetP& eps, ep) foreach(const ExoplanetP& eps, ep)
{ {
epsn = eps->getNameI18n(); epsn = eps->getNameI18n();
if (epsn.contains(objPrefix, Qt::CaseInsensitive)) find = false;
if (useStartOfWords)
{
if (epsn.toUpper().left(objPrefix.length()) == objPr
efix.toUpper())
find = true;
}
else
{
if (epsn.contains(objPrefix, Qt::CaseInsensitive))
find = true;
}
if (find)
{ {
result << epsn; result << epsn;
} }
} }
result.sort(); result.sort();
if (result.size()>maxNbItem) if (result.size()>maxNbItem)
result.erase(result.begin()+maxNbItem, result.end()); result.erase(result.begin()+maxNbItem, result.end());
return result; return result;
} }
QStringList Exoplanets::listMatchingObjects(const QString& objPrefix, int m axNbItem) const QStringList Exoplanets::listMatchingObjects(const QString& objPrefix, int m axNbItem, bool useStartOfWords) const
{ {
QStringList result; QStringList result;
if (!flagShowExoplanets) if (!flagShowExoplanets)
return result; return result;
if (maxNbItem==0) if (maxNbItem==0)
return result; return result;
QString epsn; QString epsn;
bool find;
foreach(const ExoplanetP& eps, ep) foreach(const ExoplanetP& eps, ep)
{ {
epsn = eps->getNameI18n(); epsn = eps->getNameI18n();
if (epsn.contains(objPrefix, Qt::CaseInsensitive)) find = false;
if (useStartOfWords)
{
if (epsn.toUpper().left(objPrefix.length()) == objPr
efix.toUpper())
find = true;
}
else
{
if (epsn.contains(objPrefix, Qt::CaseInsensitive))
find = true;
}
if (find)
{ {
result << epsn; result << epsn;
} }
} }
result.sort(); result.sort();
if (result.size()>maxNbItem) if (result.size()>maxNbItem)
result.erase(result.begin()+maxNbItem, result.end()); result.erase(result.begin()+maxNbItem, result.end());
 End of changes. 7 change blocks. 
9 lines changed or deleted 32 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/