[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars/skycomponents
From:       Akarsh Simha <akarshsimha () gmail ! com>
Date:       2008-05-29 5:08:47
Message-ID: 1212037727.566255.26689.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 814014 by asimha:

Fixing a problem with the Find Dialog that prevented the user from
selecting genetive names in the list box. Overriding
ListComponent::findByName() by StarComponent::findByName() and
matching the genetive name as well solved the problem.

CCMAIL: kstars-devel@kde.org



 M  +14 -0     starcomponent.cpp  
 M  +13 -0     starcomponent.h  


--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/starcomponent.cpp #814013:814014
@@ -486,6 +486,20 @@
     return m_genName.value( name );
 }
 
+// Overrides ListComponent::findByName() to include genetive name also in the search
+SkyObject* StarComponent::findByName( const QString &name ) {
+    foreach ( SkyObject *o, objectList() )
+    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 || 
+	 QString::compare( ((StarObject *)o)->gname(false), name, Qt::CaseInsensitive ) == 0)
+        return o;
+
+    //No object found
+    return 0;
+}
+
+
 // This uses the main star index for looking up nearby stars but then
 // filters out objects with the generic name "star".  We could easily
 // build an index for just the named stars which would make this go
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/starcomponent.h #814013:814014
@@ -90,6 +90,19 @@
 
     SkyObject* findStarByGenetiveName( const QString name );
 
+    /**
+     *@short Find stars by name (including genetive name)
+     *
+     * Overrides ListComponent::findByName() to include genetive names of stars
+     * as well.
+     *
+     *@param name  Name to search for. Could be trivial name or genetive name
+     *@return  Pointer to the star with the given name as a SkyObject, NULL if
+     *         no match was found
+     */
+
+    SkyObject* findByName( const QString &name );
+
     /* @short usually does nothing.  If we are drawing faint stars and if
     	* Options:::magLimitDrawStar() is greater than m_faaintMagnitude then
     	* the first time we are called we just pop up a splash screen. Then
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic