[Kstars-devel] KDE/kdeedu/kstars/kstars/dialogs

Akarsh Simha akarshsimha at gmail.com
Thu Oct 1 22:00:18 CEST 2009


SVN commit 1030187 by asimha:

Make the image / info links in the Details Dialog work in translated
versions.

The details dialog would earlier look for the link using a translated
string, which wouldn't work. This is fixed in the same manner as in
KSPopupMenu. This closes bug 184266.

Ah, and this is the first KDE commit of the Hackfest we're holding in
IITM, Chennai now. I hope this will be the first of many. Many thanks
to the excited and enthusiastic group of participants who helped me
fix this bug!

BUG: 184266
CCMAIL: kstars-devel at kde.org



 M  +13 -2     detaildialog.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/dialogs/detaildialog.cpp #1030186:1030187
@@ -459,10 +459,21 @@
     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 ) );
+        for( int j = 0; j < selectedObject->InfoTitle().count(); ++j ) {
+            if( i18nc( "Image/info menu item (should be translated)", selectedObject->InfoTitle().at(j).toLocal8Bit() ) == m_CurrentLink->text() ) {
+                URL = QString( selectedObject->InfoList().at( j ) );
+                break;
+            }
+        }
     }
     else if ( m_CurrentLink->listWidget() == Links->ImageTitleList ) {
+        for( int j = 0; j < selectedObject->ImageTitle().count(); ++j ) {
+            if( i18nc( "Image/info menu item (should be translated)", selectedObject->ImageTitle().at(j).toLocal8Bit() ) == m_CurrentLink->text() ) {
+                URL = QString( selectedObject->ImageList().at( j ) );
+                break;
+            }
+        }
+
         int i = selectedObject->ImageTitle().indexOf( m_CurrentLink->text() );
         if (i >= 0) URL = QString( selectedObject->ImageList().at( i ) );
     }


More information about the Kstars-devel mailing list