[Kst] Trunk (Re: extragear/graphics/kst/src/datasources/scuba2)
Andrew Walker
arwalker at sumusltd.com
Tue May 1 21:31:44 CEST 2007
I would like this stuff in 1.4.0
As its independent of the main code and only being used
by scuba-type people I think we are safe.
Andrew
-----Original Message-----
From: George Staikos [mailto:staikos at kde.org]
Sent: May 1, 2007 11:17 AM
To: kst at kde.org
Subject: [Kst] Trunk (Re: extragear/graphics/kst/src/datasources/scuba2)
No changes in trunk please. It's still frozen.
On 1-May-07, at 2:11 PM, Andrew Walker wrote:
> SVN commit 660148 by arwalker:
>
> use decimal rather than hex for interpretation of runfiles. use
> more flexible runfile naming convention
>
> M +36 -16 scuba.cpp
> M +1 -0 scuba.h
>
>
> --- trunk/extragear/graphics/kst/src/datasources/scuba2/scuba.cpp
> #660147:660148
> @@ -250,6 +250,28 @@
> return read;
> }
>
> +
> +QString ScubaSource::runFile( const QString& filename ) {
> + QString runfile;
> +
> + runfile = QString("%1.%2").arg(filename).arg("run");
> + if (!QFile::exists(runfile)) {
> + int index;
> +
> + runfile.truncate(0);
> + index = filename.findRev(QChar('.'));
> + if (index != -1) {
> + runfile = QString("%1.%2").arg(filename.left(index)).arg
> ("run");
> + if (!QFile::exists(runfile)) {
> + runfile.truncate(0);
> + }
> + }
> + }
> +
> + return runfile;
> +}
> +
> +
> void ScubaSource::setDataType(QFile& file) {
> int length = 200;
> int read;
> @@ -283,13 +305,13 @@
> _byteLength = 0;
> _numFrames = 0;
>
> - QString runFilename = QString("%1.%2").arg(_filename).arg("run");
> + QString runFilename = runFile(_filename);
> QFile file(_filename);
>
> //
> // check for the presence of a .run file
> //
> - if (QFile::exists(runFilename)) {
> + if (!runFilename.isEmpty()) {
> QFile frun(runFilename);
> KstString *metaString;
> QStringList entries;
> @@ -330,7 +352,7 @@
> index = s.find(QChar('>'));
> s.remove(0, index+1);
> s.stripWhiteSpace();
> - _datamode = s.toInt(&ok, 16);
> + _datamode = s.toInt(&ok, 10);
> // FIXME datamode set at rc level
> _datamode = 4;
>
> @@ -341,7 +363,7 @@
> index = s.find(QChar('>'));
> s.remove(0, index+1);
> s.stripWhiteSpace();
> - _rowLen = s.toInt(&ok, 16);
> + _rowLen = s.toInt(&ok, 10);
> if (!ok) {
> _rowLen = -1;
> }
> @@ -350,7 +372,7 @@
> index = s.find(QChar('>'));
> s.remove(0, index+1);
> s.stripWhiteSpace();
> - _numRows = s.toInt(&ok, 16);
> + _numRows = s.toInt(&ok, 10);
> if (!ok) {
> _numRows = -1;
> }
> @@ -526,7 +548,6 @@
>
> while (read != -1) {
> checksum = 0;
> -
> for (i=0; i<_numRows+1; i++) {
> read = readFullLine(file, s);
>
> @@ -546,7 +567,6 @@
> read = readFullLine(file, s);
> if (read != -1) {
> value = s.toInt(&ok, 10);
> -
> if (value == checksum) {
> if (_numFrames >= _numFrameIndexAlloc) {
> _numFrameIndexAlloc +=
> FRAMEINDEXBUFFERINCREMENT;
> @@ -1112,8 +1132,8 @@
> //
> // check for the presence of a .run file
> //
> - runFilename = QString("%1.%2").arg(filename).arg("run");
> - if (QFile::exists(runFilename)) {
> + runFilename = runFile(filename);
> + if (!runFilename.isEmpty()) {
> QFile frun(runFilename);
>
> if (frun.open(IO_ReadOnly)) {
> @@ -1293,8 +1313,8 @@
> QFile file(_filename);
> QString runFilename;
>
> - runFilename = QString("%1.%2").arg(_filename).arg("run");
> - if (QFile::exists(runFilename)) {
> + runFilename = runFile(_filename);
> + if (!runFilename.isEmpty()) {
> QFile frun(runFilename);
>
> if (frun.open(IO_ReadOnly)) {
> @@ -1320,7 +1340,7 @@
> index = s.find(QChar('>'));
> s.remove(0, index+1);
> s.stripWhiteSpace();
> - datamode = s.toInt(&ok, 16);
> + datamode = s.toInt(&ok, 10);
> // FIXME datamode set at rc level
> datamode = 4;
>
> @@ -1331,7 +1351,7 @@
> index = s.find(QChar('>'));
> s.remove(0, index+1);
> s.stripWhiteSpace();
> - row_len = s.toInt(&ok, 16);
> + row_len = s.toInt(&ok, 10);
> if (!ok) {
> row_len = -1;
> }
> @@ -1340,7 +1360,7 @@
> index = s.find(QChar('>'));
> s.remove(0, index+1);
> s.stripWhiteSpace();
> - num_rows = s.toInt(&ok, 16);
> + num_rows = s.toInt(&ok, 10);
> if (!ok) {
> num_rows = -1;
> }
> @@ -1588,8 +1608,8 @@
> //
> // check for the presence of a .run file
> //
> - runFilename = QString("%1.%2").arg(filename).arg("run");
> - if (QFile::exists(runFilename)) {
> + runFilename = ScubaSource::runFile(filename);
> + if (!runFilename.isEmpty()) {
> QFile frun(runFilename);
> QString s;
>
> --- trunk/extragear/graphics/kst/src/datasources/scuba2/scuba.h
> #660147:660148
> @@ -30,6 +30,7 @@
> ScubaSource(KConfig *cfg, const QString& filename, const
> QString& type, const QDomElement& e = QDomElement());
> ~ScubaSource();
>
> + static QString runFile( const QString& filename );
> static int readFullLine(QFile &file, QString &str);
>
> KstObject::UpdateType update(int = -1);
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
--
George Staikos
KDE Developer http://www.kde.org/
Staikos Computing Services Inc. http://www.staikos.net/
_______________________________________________
Kst mailing list
Kst at kde.org
https://mail.kde.org/mailman/listinfo/kst
More information about the Kst
mailing list