[Kstars-devel] KDE/kdeedu/kstars/kstars/skycomponents
Jason Harris
kstars at 30doradus.org
Tue Apr 29 02:18:28 CEST 2008
SVN commit 802272 by harris:
Make findByName() case-insensitive.
CCMAIL: kstars-devel at kde.org
M +4 -4 deepskycomponent.cpp
M +3 -2 jupitermoonscomponent.cpp
M +3 -1 listcomponent.cpp
M +3 -2 singlecomponent.cpp
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/deepskycomponent.cpp #802271:802272
@@ -186,9 +186,9 @@
// Add the name(s) to the nameHash for fast lookup -jbb
if ( hasName) {
- nameHash[ name ] = o;
- if ( ! longname.isEmpty() ) nameHash[ longname ] = o;
- if ( ! name2.isEmpty() ) nameHash[ name2 ] = o;
+ nameHash[ name.toLower() ] = o;
+ if ( ! longname.isEmpty() ) nameHash[ longname.toLower() ] = o;
+ if ( ! name2.isEmpty() ) nameHash[ name2.toLower() ] = o;
}
Trixel trixel = m_skyMesh->index( (SkyPoint*) o );
@@ -417,7 +417,7 @@
SkyObject* DeepSkyComponent::findByName( const QString &name ) {
- return nameHash[ name ];
+ return nameHash[ name.toLower() ];
}
//we multiply each catalog's smallest angular distance by the
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/jupitermoonscomponent.cpp #802271:802272
@@ -68,8 +68,9 @@
SkyObject* JupiterMoonsComponent::findByName( const QString &name ) {
for ( uint i=0; i<4; ++i ) {
TrailObject *moon = jmoons->moon(i);
- if ( moon->name() == name || moon->longname() == name
- || moon->name2() == name )
+ if ( QString::compare( moon->name(), name, Qt::CaseInsensitive ) == 0 ||
+ QString::compare( moon->longname(), name, Qt::CaseInsensitive ) == 0 ||
+ QString::compare( moon->name2(), name, Qt::CaseInsensitive ) == 0 )
return moon;
}
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/listcomponent.cpp #802271:802272
@@ -61,7 +61,9 @@
SkyObject* ListComponent::findByName( const QString &name ) {
foreach ( SkyObject *o, objectList() )
- if ( o->name() == name || o->longname() == name || o->name2() == name )
+ if ( QString::compare( o->name(), name, Qt::CaseInsensitive ) == 0 ||
+ QString::compare( o->longname(), name, Qt::CaseInsensitive ) == 0 ||
+ QString::compare( o->name2(), name, Qt::CaseInsensitive ) == 0 )
return o;
//No object found
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/singlecomponent.cpp #802271:802272
@@ -51,8 +51,9 @@
}
SkyObject* SingleComponent::findByName( const QString &name ) {
- if ( skyObject()->name() == name || skyObject()->longname() == name
- || skyObject()->name2() == name )
+ if ( QString::compare( skyObject()->name(), name, Qt::CaseInsensitive ) == 0 ||
+ QString::compare( skyObject()->longname(), name, Qt::CaseInsensitive ) == 0 ||
+ QString::compare( skyObject()->name2(), name, Qt::CaseInsensitive ) == 0 )
return skyObject();
return 0;
More information about the Kstars-devel
mailing list