[Kst] branches/work/kst/portto4/kst/src
George Staikos
staikos at kde.org
Thu May 31 22:00:27 CEST 2007
SVN commit 670230 by staikos:
updated to build with trunk.
extdate is dead
M +0 -1 CMakeLists.txt
M +5 -3 datasources/CMakeLists.txt
D extdate (directory)
M +2 -1 libkst/CMakeLists.txt
M +3 -3 libkst/kstdatasource.cpp
M +2 -2 libkst/kstdatasource.h
M +9 -9 libkst/kstdateparser.cpp
M +3 -11 libkst/kstdateparser.h
--- branches/work/kst/portto4/kst/src/CMakeLists.txt #670229:670230
@@ -1,5 +1,4 @@
-#add_subdirectory( extdate )
add_subdirectory( libkst )
add_subdirectory( libkstmath )
add_subdirectory( datasources )
--- branches/work/kst/portto4/kst/src/datasources/CMakeLists.txt #670229:670230
@@ -4,15 +4,17 @@
add_subdirectory( dirfile )
add_subdirectory( frame )
add_subdirectory( indirect )
+
+#add_subdirectory( cdf )
+#add_subdirectory( netcdf )
+#add_subdirectory( libfitstools )
+#add_subdirectory( healpix )
#add_subdirectory( scuba2 )
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(PIOLIB_SUBDIR)")
-message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(CDF_SUBDIR)")
-message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(NETCDF_SUBDIR)")
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(LFIIO_SUBDIR)")
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(WMAP_SUBDIR)")
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(FITSIMAGE_SUBDIR)")
-message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(HEALPIX_SUBDIR)")
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(NAD_SUBDIR)")
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
--- branches/work/kst/portto4/kst/src/libkst/CMakeLists.txt #670229:670230
@@ -23,7 +23,8 @@
rwlock.cpp
kstmath.cpp
kstdateparser.cpp
- ksttimezones.cpp
+# Needs porting, but is unused anyway
+# ksttimezones.cpp
kstscalar.cpp
# $(PROCPS_COPY)
# FIXME: switch to a variable
--- branches/work/kst/portto4/kst/src/libkst/kstdatasource.cpp #670229:670230
@@ -673,7 +673,7 @@
}
-int KstDataSource::sampleForTime(const KST::ExtDateTime& time, bool *ok) {
+int KstDataSource::sampleForTime(const QDateTime& time, bool *ok) {
Q_UNUSED(time)
if (ok) {
*ok = false;
@@ -693,12 +693,12 @@
-KST::ExtDateTime KstDataSource::timeForSample(int sample, bool *ok) {
+QDateTime KstDataSource::timeForSample(int sample, bool *ok) {
Q_UNUSED(sample)
if (ok) {
*ok = false;
}
- return KST::ExtDateTime::currentDateTime();
+ return QDateTime::currentDateTime();
}
--- branches/work/kst/portto4/kst/src/libkst/kstdatasource.h #670229:670230
@@ -201,11 +201,11 @@
/** Does it support time conversion of sample numbers, in general? */
virtual bool supportsTimeConversions() const;
- virtual int sampleForTime(const KST::ExtDateTime& time, bool *ok = 0L);
+ virtual int sampleForTime(const QDateTime& time, bool *ok = 0L);
virtual int sampleForTime(double milliseconds, bool *ok = 0L);
- virtual KST::ExtDateTime timeForSample(int sample, bool *ok = 0L);
+ virtual QDateTime timeForSample(int sample, bool *ok = 0L);
// in (ms)
virtual double relativeTimeForSample(int sample, bool *ok = 0L);
--- branches/work/kst/portto4/kst/src/libkst/kstdateparser.cpp #670229:670230
@@ -24,8 +24,8 @@
namespace KST {
-ExtDateTime millisecondsToExtDateTime(double ms) {
- ExtDateTime edt;
+QDateTime millisecondsToQDateTime(double ms) {
+ QDateTime edt;
edt.setTime_t(0);
if (ms > 0.0) {
double milli = fmod(ms, 1000.0);
@@ -43,7 +43,7 @@
}
-double extDateTimeToMilliseconds(const ExtDateTime& edt) {
+double extDateTimeToMilliseconds(const QDateTime& edt) {
double rc = 0.0;
if (edt.isNull()) {
return rc;
@@ -60,10 +60,10 @@
}
-ExtDateTime parsePlanckDate(const QString& dateString) {
+QDateTime parsePlanckDate(const QString& dateString) {
QStringList secondSplit = dateString.split('.');
if (secondSplit.isEmpty() || secondSplit.count() > 2) {
- return ExtDateTime();
+ return QDateTime();
}
int seconds = 0;
@@ -72,14 +72,14 @@
}
QStringList mainSplit = secondSplit[0].split(':');
- ExtDateTime edt = ExtDateTime::currentDateTime();
- int offset = ExtDateTime::currentDateTime().toUTC().toTime_t() - edt.toTime_t();
- ExtDate d = edt.date();
+ QDateTime edt = QDateTime::currentDateTime();
+ int offset = QDateTime::currentDateTime().toUTC().toTime_t() - edt.toTime_t();
+ QDate d = edt.date();
QTime t = edt.time();
int i = 0;
switch (mainSplit.count()) {
default:
- return ExtDateTime();
+ return QDateTime();
case 5:
{
int years = mainSplit[i++].toInt();
--- branches/work/kst/portto4/kst/src/libkst/kstdateparser.h #670229:670230
@@ -18,7 +18,6 @@
#ifndef KSTDATEPARSER_H
#define KSTDATEPARSER_H
-// #include <kstextdatetime.h>
#include <QTime>
#include <QDate>
#include <QDateTime>
@@ -26,20 +25,13 @@
/* This is a public header */
namespace KST {
-
- /*FIXME Need to know if QDateTime in Qt4 will serve our needs or do we need to port
- over the extdate lib*/
- typedef QTime ExtTime;
- typedef QDate ExtDate;
- typedef QDateTime ExtDateTime;
-
/*
All times represented as doubles are the number of milliseconds since Jan 01
1970 00:00:00. Negative times are before then.
*/
- KST_EXPORT extern ExtDateTime parsePlanckDate(const QString& dateString);
- KST_EXPORT extern double extDateTimeToMilliseconds(const ExtDateTime& edt);
- KST_EXPORT extern ExtDateTime millisecondsToExtDateTime(double ms);
+ KST_EXPORT extern QDateTime parsePlanckDate(const QString& dateString);
+ KST_EXPORT extern double extDateTimeToMilliseconds(const QDateTime& edt);
+ KST_EXPORT extern QDateTime millisecondsToQDateTime(double ms);
}
#endif
More information about the Kst
mailing list