[Kst] kdeextragear-2/kst/kst/datasources/ascii
George Staikos
staikos at kde.org
Thu Apr 14 03:54:12 CEST 2005
CVS commit by staikos:
finish fixed-field-widths
M +5 -2 ascii.cpp 1.55
M +2 -4 notes.txt 1.3
--- kdeextragear-2/kst/kst/datasources/ascii/ascii.cpp #1.54:1.55
@@ -215,5 +215,4 @@ bool AsciiSource::initRowIndex() {
}
_rowIndex[0] = didRead;
- kdDebug() << "rowindex[0] == " << didRead << endl;
}
@@ -478,5 +477,9 @@ QStringList AsciiSource::fieldListFor(co
rc += QStringList::split(QRegExp(QString("[%1]").arg(QRegExp::escape(cfg->_columnDelimiter))), line.stripWhiteSpace(), false);
} else if (cfg->_columnType == AsciiSource::Config::Fixed) {
- abort(); // FIXME
+ int cnt = line.length() / cfg->_columnWidth;
+ for (int i = 0; i < cnt; ++i) {
+ QString sub = line.mid(i * cfg->_columnWidth).left(cfg->_columnWidth);
+ rc += sub.stripWhiteSpace();
+ }
} else {
rc += QStringList::split(QRegExp("[\\s]"), line.stripWhiteSpace(), false);
--- kdeextragear-2/kst/kst/datasources/ascii/notes.txt #1.2:1.3
@@ -23,9 +23,7 @@
no longer does data sources. Should give a performance boost.
-2) Field name extraction with fixed columns is unimplemented.
+2) Time code is unfinished.
-3) Time code is unfinished.
-
-4) Instance of datasource needs to reload if config changes since changes don't
+3) Instance of datasource needs to reload if config changes since changes don't
apply to existing instances, and new instances are not created if old ones
exist - it's shared.
More information about the Kst
mailing list