diff --git a/tests/manual/tasking/dataexchange/recipe.cpp b/tests/manual/tasking/dataexchange/recipe.cpp index f89b31e27cc..c1a2a450d7a 100644 --- a/tests/manual/tasking/dataexchange/recipe.cpp +++ b/tests/manual/tasking/dataexchange/recipe.cpp @@ -34,6 +34,7 @@ static int sizeForIndex(int index) { return (index + 1) * s_sizeInterval; } Group recipe(const Storage &externalStorage) { Storage internalStorage; + Repeat repeater(s_imageCount); const auto onDownloadSetup = [externalStorage](NetworkQuery &query) { query.setNetworkAccessManager(externalStorage->inputNam); @@ -60,27 +61,24 @@ Group recipe(const Storage &externalStorage) externalStorage->outputError = "Image Data Error."; }; - QList parallelTasks; - parallelTasks.reserve(s_imageCount + 1); // +1 for parallelLimit - parallelTasks.append(parallelLimit(QThread::idealThreadCount() - 1)); - - for (int i = 0; i < s_imageCount; ++i) { - const int s = sizeForIndex(i); - const auto onScaleSetup = [internalStorage, s](ConcurrentCall &data) { - data.setConcurrentCallData(&scaleImage, internalStorage->imageSource, QSize(s, s)); - }; - const auto onScaleDone = [externalStorage, s](const ConcurrentCall &data) { - externalStorage->outputImages.insert(s, data.result()); - }; - parallelTasks.append(ConcurrentCallTask(onScaleSetup, onScaleDone)); - } + const auto onScaleSetup = [internalStorage, repeater](ConcurrentCall &data) { + const int s = sizeForIndex(repeater.iteration()); + data.setConcurrentCallData(&scaleImage, internalStorage->imageSource, QSize(s, s)); + }; + const auto onScaleDone = [externalStorage, repeater](const ConcurrentCall &data) { + externalStorage->outputImages.insert(repeater.iteration(), data.result()); + }; const QList recipe { externalStorage, internalStorage, NetworkQueryTask(onDownloadSetup, onDownloadDone), ConcurrentCallTask(onReadSetup, onReadDone), - Group { parallelTasks } + Group { + repeater, + parallelLimit(QThread::idealThreadCount() - 1), + ConcurrentCallTask(onScaleSetup, onScaleDone) + } }; return recipe; } diff --git a/tests/manual/tasking/dataexchange/viewer.cpp b/tests/manual/tasking/dataexchange/viewer.cpp index 62a4bdd3e88..84eb93d43e0 100644 --- a/tests/manual/tasking/dataexchange/viewer.cpp +++ b/tests/manual/tasking/dataexchange/viewer.cpp @@ -16,9 +16,7 @@ Viewer::Viewer(QWidget *parent) setWindowTitle(tr("Data Exchange")); QLabel *urlLabel = new QLabel(tr("Url:")); - m_lineEdit = new QLineEdit("https://media.licdn.com/dms/image/D4D22AQFj3ksh5rmnrg/" - "feedshare-shrink_800/0/1697023188446?e=1701302400&v=beta" - "&t=6dy5dmhzgONaLu139A6XmFSGqDohiezq1fH-q2mmu3w"); + m_lineEdit = new QLineEdit("https://qt-wiki-uploads.s3.amazonaws.com/images/f/fd/TaskTree.jpg"); QPushButton *startButton = new QPushButton(tr("Start")); QPushButton *stopButton = new QPushButton(tr("Stop")); QPushButton *resetButton = new QPushButton(tr("Reset"));