[Marble-commits] branches/KDE/4.6/kdeedu/marble/src/plasmoid
Cristian Oneț
onet.cristian at gmail.com
Sun Mar 20 22:26:20 CET 2011
SVN commit 1225423 by conet:
REVIEW: 6622
Fix sunlight and timezone display in the worldclock plasmoid.
Backported to the stable branch.
M +12 -1 worldclock.cpp
M +1 -0 worldclock.h
--- branches/KDE/4.6/kdeedu/marble/src/plasmoid/worldclock.cpp #1225422:1225423
@@ -86,6 +86,8 @@
m_map->setShowPlaces ( false );
m_map->setShowCities ( false );
m_map->setShowOtherPlaces( false );
+ // set the date time of the marble model otherwise the sun will not show up correctly
+ m_map->model()->setClockDateTime(QDateTime::currentDateTimeUtc());
if(cg.readEntry("projection", static_cast<int>(Equirectangular)) == Mercator)
m_map->setProjection(Mercator);
@@ -138,6 +140,8 @@
Plasma::DataEngine *m_timeEngine = dataEngine("time");
m_timeEngine->connectSource( "Local", this, 6000, Plasma::AlignToMinute);
+
+ connect(m_map, SIGNAL(repaintNeeded(const QRegion&)), this, SLOT(slotRepaint()));
}
WorldClock::~WorldClock()
@@ -189,6 +193,11 @@
}
}
+void WorldClock::slotRepaint()
+{
+ update();
+}
+
void WorldClock::dataUpdated(const QString &source,
const Plasma::DataEngine::Data &data)
{
@@ -228,7 +237,9 @@
QString WorldClock::getZone()
{
qreal lat, lon;
- bool ok = m_map->viewport()->currentProjection()->geoCoordinates(
+ // get the hover zone only if the hove point exists
+ bool ok = !m_hover.isNull() &&
+ m_map->viewport()->currentProjection()->geoCoordinates(
m_hover.x(), m_hover.y(), m_map->viewport(), lon, lat );
if( !ok ) {
--- branches/KDE/4.6/kdeedu/marble/src/plasmoid/worldclock.h #1225422:1225423
@@ -62,6 +62,7 @@
private slots:
//connected to geometryChanged()
void resizeMap(bool changeAspect = false);
+ void slotRepaint();
private:
void connectToEngine();
More information about the Marble-commits
mailing list