Commit e2a5bc7ee4bb4aba41c3559b0dd9ab35fb9ea3ea
1 parent
ee6f9bbc
s/p/progress/ also remove the key after it is read in ProgressCounter
Showing
2 changed files
with
8 additions
and
7 deletions
openbr/plugins/gallery.cpp
| @@ -128,7 +128,7 @@ class galGallery : public Gallery | @@ -128,7 +128,7 @@ class galGallery : public Gallery | ||
| 128 | Template m; | 128 | Template m; |
| 129 | stream >> m; | 129 | stream >> m; |
| 130 | templates.append(m); | 130 | templates.append(m); |
| 131 | - templates.last().file.set("p", totalSize()); | 131 | + templates.last().file.set("progress", totalSize()); |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | *done = stream.atEnd(); | 134 | *done = stream.atEnd(); |
| @@ -365,7 +365,7 @@ class memGallery : public Gallery | @@ -365,7 +365,7 @@ class memGallery : public Gallery | ||
| 365 | 365 | ||
| 366 | TemplateList templates = MemoryGalleries::galleries[file].mid(block*readBlockSize, readBlockSize); | 366 | TemplateList templates = MemoryGalleries::galleries[file].mid(block*readBlockSize, readBlockSize); |
| 367 | for (qint64 i = 0; i < templates.size();i++) { | 367 | for (qint64 i = 0; i < templates.size();i++) { |
| 368 | - templates[i].file.set("p", i + block * readBlockSize); | 368 | + templates[i].file.set("progress", i + block * readBlockSize); |
| 369 | } | 369 | } |
| 370 | 370 | ||
| 371 | *done = (templates.size() < readBlockSize); | 371 | *done = (templates.size() < readBlockSize); |
| @@ -556,7 +556,7 @@ class csvGallery : public FileGallery | @@ -556,7 +556,7 @@ class csvGallery : public FileGallery | ||
| 556 | else fi.set(headers[j], words[j]); | 556 | else fi.set(headers[j], words[j]); |
| 557 | } | 557 | } |
| 558 | templates.append(fi); | 558 | templates.append(fi); |
| 559 | - templates.last().file.set("p", f.pos()); | 559 | + templates.last().file.set("progress", f.pos()); |
| 560 | } | 560 | } |
| 561 | *done = f.atEnd(); | 561 | *done = f.atEnd(); |
| 562 | 562 | ||
| @@ -635,7 +635,7 @@ class txtGallery : public FileGallery | @@ -635,7 +635,7 @@ class txtGallery : public FileGallery | ||
| 635 | int splitIndex = line.lastIndexOf(' '); | 635 | int splitIndex = line.lastIndexOf(' '); |
| 636 | if (splitIndex == -1) templates.append(File(line)); | 636 | if (splitIndex == -1) templates.append(File(line)); |
| 637 | else templates.append(File(line.mid(0, splitIndex), line.mid(splitIndex+1))); | 637 | else templates.append(File(line.mid(0, splitIndex), line.mid(splitIndex+1))); |
| 638 | - templates.last().file.set("p", this->position()); | 638 | + templates.last().file.set("progress", this->position()); |
| 639 | } | 639 | } |
| 640 | 640 | ||
| 641 | if (f.atEnd()) { | 641 | if (f.atEnd()) { |
| @@ -682,7 +682,7 @@ class flatGallery : public FileGallery | @@ -682,7 +682,7 @@ class flatGallery : public FileGallery | ||
| 682 | 682 | ||
| 683 | if (!line.isEmpty()) { | 683 | if (!line.isEmpty()) { |
| 684 | templates.append(File(QString::fromLocal8Bit(line).trimmed())); | 684 | templates.append(File(QString::fromLocal8Bit(line).trimmed())); |
| 685 | - templates.last().file.set("p", this->position()); | 685 | + templates.last().file.set("progress", this->position()); |
| 686 | } | 686 | } |
| 687 | 687 | ||
| 688 | if (f.atEnd()) { | 688 | if (f.atEnd()) { |
| @@ -782,7 +782,7 @@ class xmlGallery : public FileGallery | @@ -782,7 +782,7 @@ class xmlGallery : public FileGallery | ||
| 782 | } | 782 | } |
| 783 | } | 783 | } |
| 784 | templates.last().file.setRects(rects); | 784 | templates.last().file.setRects(rects); |
| 785 | - templates.last().file.set("p", f.pos()); | 785 | + templates.last().file.set("progress", f.pos()); |
| 786 | 786 | ||
| 787 | count++; | 787 | count++; |
| 788 | if (count >= this->readBlockSize) { | 788 | if (count >= this->readBlockSize) { |
openbr/plugins/misc.cpp
| @@ -518,7 +518,8 @@ class ProgressCounterTransform : public TimeVaryingTransform | @@ -518,7 +518,8 @@ class ProgressCounterTransform : public TimeVaryingTransform | ||
| 518 | qint64 elapsed = timer.elapsed(); | 518 | qint64 elapsed = timer.elapsed(); |
| 519 | 519 | ||
| 520 | if (!dst.empty()) { | 520 | if (!dst.empty()) { |
| 521 | - Globals->currentProgress = dst.last().file.get<qint64>("p",0); | 521 | + Globals->currentProgress = dst.last().file.get<qint64>("progress",0); |
| 522 | + dst.last().file.remove("progress"); | ||
| 522 | Globals->currentStep++; | 523 | Globals->currentStep++; |
| 523 | } | 524 | } |
| 524 | 525 |