[Marble-commits] KDE/kdeedu/marble/src/plasmoid
Cristian Oneț
onet.cristian at gmail.com
Mon Sep 13 08:06:44 CEST 2010
SVN commit 1174653 by conet:
BUG: 240979
Fix for KWorldClock that displays the UTC time instead of the local time after loading the session until the mouse hovers over it.
M +10 -13 worldclock.cpp
--- trunk/KDE/kdeedu/marble/src/plasmoid/worldclock.cpp #1174652:1174653
@@ -76,11 +76,6 @@
KConfigGroup cg = config();
m_map = new MarbleMap();
- if(cg.readEntry("projection", static_cast<int>(Equirectangular)) == Mercator)
- m_map->setProjection(Mercator);
- else
- m_map->setProjection(Equirectangular);
-
//Set how we want the map to look
m_map->centerOn( cg.readEntry("rotation", -20), 0 );
m_map->setMapThemeId( "earth/bluemarble/bluemarble.dgml" );
@@ -92,6 +87,11 @@
m_map->setShowCities ( false );
m_map->setShowOtherPlaces( false );
+ if(cg.readEntry("projection", static_cast<int>(Equirectangular)) == Mercator)
+ m_map->setProjection(Mercator);
+ else
+ m_map->setProjection(Equirectangular);
+
foreach( RenderPlugin* item, m_map->model()->renderPlugins() )
item->setVisible( false );
@@ -107,7 +107,7 @@
m_map->setNeedsUpdate();
m_customTz = cg.readEntry("customtz", false );
- m_locationkey = QString(KSystemTimeZones::local().name());
+ m_locationkey = KSystemTimeZones::local().name();
if(m_customTz) {
QStringList tzlist = cg.readEntry("tzlist", QStringList());
m_locations = QMap<QString, KTimeZone>();
@@ -234,10 +234,8 @@
bool ok = m_map->viewport()->currentProjection()->geoCoordinates(
m_hover.x(), m_hover.y(), m_map->viewport(), lon, lat );
- QString timezone;
if( !ok ) {
- timezone = KSystemTimeZones::local().name();
- return i18n( timezone.toUtf8().data() );
+ return KSystemTimeZones::local().name();
}
QList<QString> zones = m_locations.keys();
@@ -252,8 +250,7 @@
closest = zones.at( i );
}
}
- timezone = m_locations.value( closest ).name();
- return i18n( timezone.toUtf8().data() );
+ return m_locations.value( closest ).name();
}
void WorldClock::setTz( QString newtz )
@@ -287,7 +284,7 @@
else
timestr = KGlobal::locale()->formatTime( m_time.time() );
- QString locstr = m_locationkey;
+ QString locstr = i18n( m_locationkey.toUtf8().data() );
locstr.remove( 0, locstr.lastIndexOf( '/' ) + 1 ).replace( '_', ' ' );
QRect timeRect( m_points.value( "topleft" ), m_points.value( "middleright" ) );
QRect locationRect( m_points.value( "middleleft" ), m_points.value( "bottomright" ) );
@@ -386,7 +383,7 @@
p->setPen( QColor( 0xFF, 0xFF, 0xFF ) );
- QString locstr = m_locationkey;
+ QString locstr = i18n( m_locationkey.toUtf8().data() );
locstr.remove( 0, locstr.lastIndexOf( '/' ) + 1 ).replace( '_', ' ' );
QString timestr;
More information about the Marble-commits
mailing list