[Kst] kdeextragear-2/kst/kst/datasources/dirfile
George Staikos
staikos at kde.org
Wed Aug 11 20:09:06 CEST 2004
CVS commit by staikos:
the field is not cacheable here. a second instance of the dirfile reader
has completely different fields...
CCMAIL: 86918-done at bugs.kde.org
M +2 -3 dirfile.cpp 1.11
M +10 -13 getdata.c 1.15
--- kdeextragear-2/kst/kst/datasources/dirfile/dirfile.cpp #1.10:1.11
@@ -126,5 +126,5 @@ void DirFileSource::save(QTextStream &ts
}
-#include <kdebug.h>
+//#include <kdebug.h>
extern "C" {
@@ -135,5 +135,4 @@ KstDataSource *create_dirfile(const QStr
QStringList provides_dirfile() {
QStringList rc;
- // create the stringlist
rc += "Directory of Binary Files";
return rc;
@@ -149,5 +148,5 @@ int understands_dirfile(const QString& f
}
- //kdDebug() << "Don't understand. FrameCount=" << frameCount << " err=" << err << endl;
+ //kdDebug() << "Don't understand. filename = [" << filename << "] FrameCount=" << frameCount << " err=" << err << endl;
return 0;
}
--- kdeextragear-2/kst/kst/datasources/dirfile/getdata.c #1.14:1.15
@@ -1364,7 +1364,6 @@ int GetNFrames(const char *filename_in,
struct stat statbuf;
int nf;
+ char field_buf[80];
const char *field;
- static char default_field[80];
- static int default_set = 0;
int i;
@@ -1390,16 +1389,13 @@ int GetNFrames(const char *filename_in,
if (in_field == NULL) {
- if (!default_set) {
/* check for first valid raw field */
for (i=0; i<F->n_raw; i++) {
sprintf(raw_data_filename,"%s/%s", filename, F->rawEntries[i].field);
if (stat(raw_data_filename, &statbuf) >=0) {
- strncpy(default_field, F->rawEntries[i].field, 79);
+ strncpy(field_buf, F->rawEntries[i].field, 79);
i = F->n_raw;
}
}
- default_set = 1;
- }
- field = default_field;
+ field = field_buf;
} else {
field = in_field;
@@ -1451,2 +1447,3 @@ int GetSamplesPerFrame(const char *filen
return (GetSPF(field_name, F, error_code));
}
+/* vim: ts=2 sw=2 et */
More information about the Kst
mailing list