[Kstars-devel] branches/KDE/4.2/kdeedu/kstars/kstars
Akarsh Simha
akarshsimha at gmail.com
Sat Jan 10 20:01:32 CET 2009
SVN commit 908998 by asimha:
Backporting fix from revision 908482
Original commit log reads:
Fix issues with translated info link titles / image link titles.
CCMAIL: kstars-devel at kde.org
M +18 -2 skymap.cpp
--- branches/KDE/4.2/kdeedu/kstars/kstars/skymap.cpp #908997:908998
@@ -463,8 +463,16 @@
void SkyMap::slotImage() {
QString message = ((KAction*)sender())->text();
message = message.remove( '&' ); //Get rid of accelerator markers
- int index = clickedObject()->ImageTitle().indexOf(message);
+ // Need to do this because we are comparing translated strings
+ int index = -1;
+ for( int i = 0; i < clickedObject()->ImageTitle().size(); ++i ) {
+ if( i18nc( "Image/info menu item (should be translated)", clickedObject()->ImageTitle().at( i ).toLocal8Bit().data() ) == message ) {
+ index = i;
+ break;
+ }
+ }
+
QString sURL;
if ( index >= 0 && index < clickedObject()->ImageList().size() ) {
sURL = clickedObject()->ImageList()[ index ];
@@ -485,8 +493,16 @@
void SkyMap::slotInfo() {
QString message = ((KAction*)sender())->text();
message = message.remove( '&' ); //Get rid of accelerator markers
- int index = clickedObject()->InfoTitle().indexOf(message);
+ // Need to do this because we are comparing translated strings
+ int index = -1;
+ for( int i = 0; i < clickedObject()->InfoTitle().size(); ++i ) {
+ if( i18nc( "Image/info menu item (should be translated)", clickedObject()->InfoTitle().at( i ).toLocal8Bit().data() ) == message ) {
+ index = i;
+ break;
+ }
+ }
+
QString sURL;
if ( index >= 0 && index < clickedObject()->InfoList().size() ) {
sURL = clickedObject()->InfoList()[ index ];
More information about the Kstars-devel
mailing list