[Kst] branches/work/kst/portto4/kst/src
Peter Kümmel
syntheticpp at gmx.net
Thu Nov 22 22:30:47 UTC 2012
SVN commit 1325897 by kuemmel:
don't overwrite axis dialog settings
M +2 -2 datasources/ascii/asciisource.cpp
M +1 -1 datasources/ascii/asciisource.h
M +2 -2 libkst/datasource.cpp
M +1 -1 libkst/datasource.h
M +2 -6 libkstapp/datawizard.cpp
--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp #1325896:1325897
@@ -651,9 +651,9 @@
}
//-------------------------------------------------------------------------------------------
-QString AsciiSource::timeFormatString() const
+bool AsciiSource::isTime() const
{
- return _config._indexTimeFormat;
+ return !_config._indexTimeFormat.value().isEmpty();
}
//-------------------------------------------------------------------------------------------
--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.h #1325896:1325897
@@ -53,7 +53,7 @@
int sampleForTime(const QDateTime& time, bool *ok);
- QString timeFormatString() const;
+ bool isTime() const;
virtual void reset();
--- branches/work/kst/portto4/kst/src/libkst/datasource.cpp #1325896:1325897
@@ -353,8 +353,8 @@
}
-QString DataSource::timeFormatString() const {
- return QString();
+bool DataSource::isTime() const {
+ return false;
}
double DataSource::relativeTimeForSample(int sample, bool *ok) {
--- branches/work/kst/portto4/kst/src/libkst/datasource.h #1325896:1325897
@@ -134,7 +134,7 @@
virtual QDateTime timeForSample(int sample, bool *ok = 0L);
- virtual QString timeFormatString() const;
+ virtual bool isTime() const;
// in (ms)
virtual double relativeTimeForSample(int sample, bool *ok = 0L);
--- branches/work/kst/portto4/kst/src/libkstapp/datawizard.cpp #1325896:1325897
@@ -866,7 +866,7 @@
}
}
- QString timeFormatString = ds->timeFormatString();
+ bool xAxisIsTime = ds->isTime();
ds->unlock();
if (memoryRequested > memoryAvailable) {
@@ -1220,12 +1220,8 @@
}
}
foreach (PlotItem* plot, plotList) {
- if (!timeFormatString.isEmpty()) {
+ if (xAxisIsTime) {
plot->xAxis()->setAxisInterpret(true);
- plot->xAxis()->setAxisDisplay(AXIS_DISPLAY_QTDATETIME_FORMAT);
- plot->xAxis()->setAxisDisplayFormatString(timeFormatString);
- // start axis with first time in data
- plot->xAxis()->setAxisForceOffsetMin(true);
}
plot->update();
plot->view()->appendToLayout(layout_type, plot, num_columns);
More information about the Kst
mailing list