[gnote] Add constructor with Glib::TimeVal parameter to DateTime



commit ae9d48685bf6f551814715f055547f5bf8332497
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date:   Fri Apr 29 23:34:50 2011 +0300

    Add constructor with Glib::TimeVal parameter to DateTime
    
    Replace GTimeVal by Glib::TimeVal.
    Make corresponding constructor public.

 src/sharp/datetime.cpp |    5 +++--
 src/sharp/datetime.hpp |    8 ++++----
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/sharp/datetime.cpp b/src/sharp/datetime.cpp
index 909791e..0d7aed4 100644
--- a/src/sharp/datetime.cpp
+++ b/src/sharp/datetime.cpp
@@ -1,6 +1,7 @@
 /*
  * gnote
  *
+ * Copyright (C) 2011 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -49,7 +50,7 @@ namespace sharp {
     m_date.tv_usec = _usec;
   }
 
-  DateTime::DateTime(const GTimeVal & v)
+  DateTime::DateTime(const Glib::TimeVal & v)
     : m_date(v)
   {
   }
@@ -125,7 +126,7 @@ namespace sharp {
     if(!is_valid()) {
       return retval;
     }
-    char *  iso8601 = g_time_val_to_iso8601(const_cast<GTimeVal*>(&m_date));
+    char *  iso8601 = g_time_val_to_iso8601(const_cast<Glib::TimeVal*>(&m_date));
     if(iso8601) {
       retval = iso8601;
       if(m_date.tv_usec == 0) {
diff --git a/src/sharp/datetime.hpp b/src/sharp/datetime.hpp
index 3a9e375..6f62ec0 100644
--- a/src/sharp/datetime.hpp
+++ b/src/sharp/datetime.hpp
@@ -1,6 +1,7 @@
 /*
  * gnote
  *
+ * Copyright (C) 2011 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -32,7 +33,7 @@
 
 #include <string>
 
-#include <glib.h>
+#include <glibmm/timeval.h>
 
 namespace sharp {
 
@@ -42,6 +43,7 @@ class DateTime
 public:
   DateTime();
   explicit DateTime(time_t t, glong _usec = 0);
+  explicit DateTime(const Glib::TimeVal & v);
   
   DateTime & add_days(int days);
   DateTime & add_hours(int hours);
@@ -83,9 +85,7 @@ public:
 private:
   // return the string formatted according to strftime
   std::string _to_string(const char * format, struct tm *) const;
-  // implementation detail. really make public if needed.
-  explicit DateTime(const GTimeVal & v);
-  GTimeVal m_date;
+  Glib::TimeVal m_date;
 };
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]