SVN commit 813015 by asimha: 1. A few documentation fixes 2. Changing names of major Indian cities after they were renamed in Cities.dat 3. Fixing crash on clicking the remove, edit or view buttons in the Links tab of the Details dialog when no link is selected. The crash was because we were accessing a NULL pointer. 4. Fixing bug with Angular distance tool that was causing the start and end points to be taken incorrectly sometimes. CCMAIL: kstars-devel@kde.org M +3 -3 data/Cities.dat M +11 -0 detaildialog.cpp M +6 -1 ksnumbers.h M +3 -3 skycomponents/README.indexing M +1 -1 skycomponents/linelistindex.h M +5 -5 skymap.cpp M +2 -2 skymap.h --- trunk/KDE/kdeedu/kstars/kstars/data/Cities.dat #813014:813015 @@ -350,7 +350,7 @@ Bolgatanga : : Ghana : 10 : 47 : 8 : N : 0 : 51 : 5 : W : 0.0 : -- Bologna : : Italy : 44 : 32 : 16 : N : 11 : 17 : 23 : E : 1.0 : EU Bolzano : : Italy : 46 : 29 : 49 : N : 11 : 21 : 16 : E : 1.0 : EU -Bombay : : India : 18 : 58 : 0 : N : 72 : 49 : 59 : E : 5.5 : -- +Mumbai : : India : 18 : 58 : 0 : N : 72 : 49 : 59 : E : 5.5 : -- Bonavista : Newfoundland : Canada : 48 : 39 : 00 : N : 53 : 07 : 00 : W : -3.5 : US Bonn : : Germany : 50 : 43 : 11 : N : 7 : 4 : 48 : E : 1.0 : EU Bonnyville : Alberta : Canada : 54 : 16 : 00 : N : 110 : 44 : 00 : W : -7.0 : US @@ -464,7 +464,7 @@ Cairo : : Egypt : 30 : 0 : 0 : N : 31 : 16 : 59 : E : 2.0 : EG Calais/Dunkirk : Pas-de-Calais : France : 50 : 57 : 36 : N : 1 : 57 : 0 : E : 1.0 : EU Calar Alto : : Spain : 37 : 13 : 8 : N : 2 : 32 : 15 : W : 1.0 : EU -Calcutta : : India : 22 : 31 : 59 : N : 88 : 22 : 0 : E : 5.5 : -- +Kolkata : : India : 22 : 31 : 59 : N : 88 : 22 : 0 : E : 5.5 : -- Caldwell : Idaho : USA : 43 : 39 : 53 : N : 116 : 41 : 13 : W : -7.0 : US Caledonia : Nova Scotia : Canada : 44 : 22 : 00 : N : 65 : 02 : 00 : W : -4.0 : US Calgary : Alberta : Canada : 51 : 2 : 59 : N : 114 : 4 : 58 : W : -7.0 : US @@ -1749,7 +1749,7 @@ Madison : Alabama : USA : 34 : 41 : 30 : N : 86 : 45 : 41 : W : -6.0 : US Madison : South Dakota : USA : 44 : 0 : 24 : N : 97 : 6 : 47 : W : -6.0 : US Madison : Wisconsin : USA : 43 : 4 : 22 : N : 89 : 22 : 54 : W : -6.0 : US -Madras : : India : 13 : 0 : 0 : N : 80 : 10 : 58 : E : 5.5 : -- +Chennai : : India : 13 : 0 : 0 : N : 80 : 10 : 58 : E : 5.5 : -- Madrid : : Spain : 40 : 24 : 31 : N : 03 : 41 : 11 : W : 1.0 : EU Magadan : Far East : Russia : 59 : 34 : 0 : N : 150 : 48 : 0 : E : 11.0 : RU Magdalena : New Mexico : USA : 34 : 10 : 1 : N : 107 : 45 : 0 : W : -7.0 : US --- trunk/KDE/kdeedu/kstars/kstars/detaildialog.cpp #813014:813015 @@ -441,6 +441,9 @@ if (m_CurrentLink == NULL) return; + if ( m_CurrentLink == NULL ) + return; + if ( m_CurrentLink->listWidget() == Links->InfoTitleList ) { int i = selectedObject->InfoTitle.indexOf( m_CurrentLink->text() ); if (i >= 0) URL = QString( selectedObject->InfoList.at( i ) ); @@ -494,6 +497,10 @@ editDialog.setButtons( KDialog::Ok | KDialog::Cancel ); QFrame editFrame( &editDialog ); + if ( m_CurrentLink == NULL ) { // We haven't selected anything + return; + } + if ( m_CurrentLink->listWidget() == Links->InfoTitleList ) { row = selectedObject->InfoTitle.indexOf( m_CurrentLink->text() ); @@ -589,6 +596,10 @@ if (m_CurrentLink == NULL) return; + if ( m_CurrentLink == NULL ) { // We haven't selected anything + return; + } + if ( m_CurrentLink->listWidget() == Links->InfoTitleList ) { row = selectedObject->InfoTitle.indexOf( m_CurrentLink->text() ); --- trunk/KDE/kdeedu/kstars/kstars/ksnumbers.h #813014:813015 @@ -42,8 +42,13 @@ class KSNumbers { public: - /**Constructor. */ + + /** + * Constructor. + *@param jd Julian Day for which the new instance is initialized + */ KSNumbers( long double jd ); + /**Destructor (empty). */ ~KSNumbers(); --- trunk/KDE/kdeedu/kstars/kstars/skycomponents/README.indexing #813014:813015 @@ -87,7 +87,7 @@ instead of: - HTMesh->index( p->ra()-Degrees(), p->dec()->Degrees() ); + HTMesh->index( p->ra()->Degrees(), p->dec()->Degrees() ); SkyMesh also has some real code in it that is used to find all of the trixels that cover a polygon with an arbitrary number of vertices and @@ -275,7 +275,7 @@ Data Container Classes ---------------------- - + ListList + + LineList - SkipList + PolyList @@ -346,7 +346,7 @@ don't have to do if you use preDraw(). The other two virtual callback methods are overridden by the -"abstract" SkipListIndex subclass. The method getIndexHash() and is +"abstract" SkipListIndex subclass. The method getIndexHash() is used to modify the line indexing routine. getIndexHash() is overridden by SkipListIndex so line segments that should be skipped from drawing are also skipped from the indexing. --- trunk/KDE/kdeedu/kstars/kstars/skycomponents/linelistindex.h #813014:813015 @@ -58,7 +58,7 @@ SkyMesh* skyMesh() { return m_skyMesh; } /* @short Returns the Hash of QLists of LineLists that - * is used for doing the indexing line segments. + * is used for doing the indexing of line segments. */ LineListHash* lineIndex() { return m_lineIndex; } --- trunk/KDE/kdeedu/kstars/kstars/skymap.cpp #813014:813015 @@ -430,12 +430,12 @@ //If the cursor is near a SkyObject, reset the AngularRuler's //start point to the position of the SkyObject double maxrad = 1000.0/Options::zoomFactor(); - if ( SkyObject *so = data->skyComposite()->objectNearest( mousePoint(), maxrad ) ) { + if ( SkyObject *so = data->skyComposite()->objectNearest( clickedPoint(), maxrad ) ) { AngularRuler.append( so ); AngularRuler.append( so ); } else { - AngularRuler.append( mousePoint() ); - AngularRuler.append( mousePoint() ); + AngularRuler.append( clickedPoint() ); + AngularRuler.append( clickedPoint() ); } AngularRuler.update( data ); @@ -449,11 +449,11 @@ //If the cursor is near a SkyObject, reset the AngularRuler's //end point to the position of the SkyObject double maxrad = 1000.0/Options::zoomFactor(); - if ( SkyObject *so = data->skyComposite()->objectNearest( mousePoint(), maxrad ) ) { + if ( SkyObject *so = data->skyComposite()->objectNearest( clickedPoint(), maxrad ) ) { AngularRuler.setPoint( 1, so ); sbMessage = so->translatedLongName() + " "; } else - AngularRuler.setPoint( 1, mousePoint() ); + AngularRuler.setPoint( 1, clickedPoint() ); AngularRuler.update( data ); --- trunk/KDE/kdeedu/kstars/kstars/skymap.h #813014:813015 @@ -251,7 +251,7 @@ *a pointer to ClickedPoint. *@return a pointer to ClickedPoint, the sky coordinates where the user clicked. */ -SkyPoint* clickedPoint() { return &ClickedPoint; } + SkyPoint* clickedPoint() { return &ClickedPoint; } /**@short Set the ClickedPoint to the skypoint given as an argument. *@param f pointer to the new ClickedPoint. @@ -449,7 +449,7 @@ void onscreenLine( QPointF &p1, QPointF &p2 ); bool onscreenLine2( QPointF &p1, QPointF &p2 ); - /**Determine RA, Dec coordinates of the pixel at (dx, dy), which are the + /**@short Determine RA, Dec coordinates of the pixel at (dx, dy), which are the *screen pixel coordinate offsets from the center of the Sky pixmap. *@param the screen pixel position to convert *@param LST pointer to the local sidereal time, as a dms object.