[Kst] kdeextragear-2/kst/kst/datasources/planck
George Staikos
staikos at kde.org
Tue Apr 26 05:41:50 CEST 2005
CVS commit by staikos:
make time work the first time through
M +11 -1 planckobj.cpp 1.31
--- kdeextragear-2/kst/kst/datasources/planck/planckobj.cpp #1.30:1.31
@@ -333,4 +333,8 @@ double Object::timeForSample(int sample)
int Object::sampleForTimeRelative(int search, bool *ok) {
+ if (_tt == Undetermined) {
+ _tt = typeOfTime();
+ }
+
Planck::ObjectGroup *g = findGroup(_group);
if (!g) {
@@ -341,5 +345,11 @@ int Object::sampleForTimeRelative(int se
}
double left = fetchTimePoint(*g->firstIndex);
- return sampleForTime(int(left) + search, ok);
+ if (left != left) {
+ if (ok) {
+ *ok = false;
+ }
+ return -1;
+ }
+ return sampleForTime(int(floor(left + 0.5)) + search, ok);
}
More information about the Kst
mailing list