[Marble-commits] KDE/kdeedu/marble/src/lib

Jens-Michael Hoffmann jensmh at gmx.de
Fri May 7 17:04:40 CEST 2010


SVN commit 1124014 by jmhoffmann:

ExtDateTime: Improve const-correctness.

 M  +3 -3      ExtDateTime.cpp  
 M  +7 -7      ExtDateTime.h  


--- trunk/KDE/kdeedu/marble/src/lib/ExtDateTime.cpp #1124013:1124014
@@ -41,7 +41,7 @@
 }
 
 
-int ExtDateTime::year0()
+int ExtDateTime::year0() const
 {
     int year = m_datetime.date().year();
     if ( year < 0 )
@@ -50,7 +50,7 @@
 }
 
 
-long ExtDateTime::toJDN()
+long ExtDateTime::toJDN() const
 {
     const int EPOCH_G = 32045; // 29 February 4801BCE in gregorian calendar
     const int EPOCH_J = 32083; // 29 February 4801BCE in julian calendar
@@ -78,7 +78,7 @@
 }
 
 
-qreal ExtDateTime::dayFraction()
+qreal ExtDateTime::dayFraction() const
 {
     qreal f;
     f = m_datetime.time().second();
--- trunk/KDE/kdeedu/marble/src/lib/ExtDateTime.h #1124013:1124014
@@ -35,13 +35,13 @@
     /**
      * @brief Convert 1BCE to year 0, etc.
      **/
-    int year0();
+    int year0() const;
 
     /**
      * @brief Convert to julian day number. Adapted from http://en.wikipedia.org/wiki/Julian_day#Calculation
      **/
-    long toJDN();
-    qreal dayFraction();
+    long toJDN() const;
+    qreal dayFraction() const;
 
     /**
      * @brief Sets the internal date and time with the current one
@@ -51,7 +51,7 @@
     /**
      * @brief Returns the internal date and time
      **/
-    QDateTime datetime();
+    QDateTime datetime() const;
 
     /**
      * @brief Sets the internal date and time a custom one
@@ -62,7 +62,7 @@
     /**
      * @brief Returns the speed of the timer
      **/
-    int getSpeed();
+    int getSpeed() const;
     
     /**
      * @brief Sets the speed of the timer
@@ -90,12 +90,12 @@
     m_datetime = QDateTime::currentDateTime().toUTC();
 }
 
-inline QDateTime ExtDateTime::datetime()
+inline QDateTime ExtDateTime::datetime() const
 {
     return m_datetime;
 }
 
-inline int ExtDateTime::getSpeed()
+inline int ExtDateTime::getSpeed() const
 {
     return m_speed;
 }


More information about the Marble-commits mailing list