Branch 'datetimeutils' - calendaring/CMakeLists.txt calendaring/datetimeutils.cpp calendaring/datetimeutils.h tests/calendaringtest.cpp tests/calendaringtest.h

Christian Mollekopf mollekopf at kolabsys.com
Mon Jul 23 10:34:17 CEST 2012


 calendaring/CMakeLists.txt    |    3 ++-
 calendaring/datetimeutils.cpp |   33 +++++++++++++++++++++++++++++++++
 calendaring/datetimeutils.h   |   38 ++++++++++++++++++++++++++++++++++++++
 tests/calendaringtest.cpp     |    3 +++
 tests/calendaringtest.h       |    2 ++
 5 files changed, 78 insertions(+), 1 deletion(-)

New commits:
commit e5136d03a45e823def408e84a3939b54b2cfa155
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Mon Jul 23 04:30:07 2012 -0400

    local timezone test function

diff --git a/calendaring/CMakeLists.txt b/calendaring/CMakeLists.txt
index 395050c..0cdbf08 100644
--- a/calendaring/CMakeLists.txt
+++ b/calendaring/CMakeLists.txt
@@ -1,6 +1,7 @@
 set (CALENDARING_SRCS
     ${CMAKE_CURRENT_SOURCE_DIR}/calendaring.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/event.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/datetimeutils.cpp
     PARENT_SCOPE)
 
 if(PYTHON_BINDINGS)
@@ -11,4 +12,4 @@ endif(PYTHON_BINDINGS)
 if(PHP_BINDINGS)
     message("building php bindings")
     add_subdirectory(php)
-endif(PHP_BINDINGS)
\ No newline at end of file
+endif(PHP_BINDINGS)
diff --git a/calendaring/datetimeutils.cpp b/calendaring/datetimeutils.cpp
new file mode 100644
index 0000000..73f730d
--- /dev/null
+++ b/calendaring/datetimeutils.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012  Christian Mollekopf <mollekopf at kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "datetimeutils.h"
+
+#include <Qt/qdebug.h>
+#include <ksystemtimezone.h>
+#include "conversion/commonconversion.h"
+
+namespace Kolab {
+    namespace DateTimeUtils {
+    KOLAB_EXPORT std::string getLocalTimezone()
+    {
+        const QString tz = KSystemTimeZones::local().name();
+        return tz.toStdString();
+    }
+
+    } //Namespace
+} //Namespace
diff --git a/calendaring/datetimeutils.h b/calendaring/datetimeutils.h
new file mode 100644
index 0000000..969f8bc
--- /dev/null
+++ b/calendaring/datetimeutils.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2012  Christian Mollekopf <mollekopf at kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef KOLABDATETIMEUTILS_H
+#define KOLABDATETIMEUTILS_H
+
+#ifndef SWIG
+#include "kolab_export.h"
+#else
+/* No export/import SWIG interface files */
+#define KOLAB_EXPORT
+#endif
+
+#include <string>
+
+namespace Kolab {
+    namespace DateTimeUtils {
+
+    KOLAB_EXPORT std::string getLocalTimezone();
+
+    }; //Namespace
+}; //Namespace
+
+#endif
diff --git a/tests/calendaringtest.cpp b/tests/calendaringtest.cpp
index 28aa0c6..6dc9413 100644
--- a/tests/calendaringtest.cpp
+++ b/tests/calendaringtest.cpp
@@ -394,7 +394,10 @@ void CalendaringTest::testRecurrence()
         
 }
 
+void CalendaringTest::testDateTimeUtils()
+{
 
+}
 
 QTEST_MAIN( CalendaringTest )
 
diff --git a/tests/calendaringtest.h b/tests/calendaringtest.h
index 0751d48..14dd891 100644
--- a/tests/calendaringtest.h
+++ b/tests/calendaringtest.h
@@ -44,6 +44,8 @@ private slots:
     void testIMip();
 
     void testRecurrence();
+
+    void testDateTimeUtils();
 };
 
 #endif // CALENDARINGTEST_H





More information about the commits mailing list