Commit d1b60bce authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port QtConcurrent::run to new api in qt6

parent 147abbfb
......@@ -50,7 +50,11 @@ ProxyTest::ProxyTest(QWidget *parent)
infoWidget->setText(i18n("Starting process"));
infoWidget->animatedShow();
resultList->setCursor(Qt::BusyCursor);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QtConcurrent::run(this, &ProxyTest::startTest);
#else
QtConcurrent::run(&ProxyTest::startTest, this);
#endif
});
}
......
......@@ -59,7 +59,11 @@ AudioEnvelope::~AudioEnvelope()
void AudioEnvelope::startComputeEnvelope()
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_audioSummary = QtConcurrent::run(this, &AudioEnvelope::loadAndNormalizeEnvelope);
#else
m_audioSummary = QtConcurrent::run(&AudioEnvelope::loadAndNormalizeEnvelope, this);
#endif
m_watcher.setFuture(m_audioSummary);
}
......
......@@ -303,5 +303,9 @@ void MltConnection::refreshLumas()
MainWindow::m_lumaFiles.insert(QStringLiteral("16_9"), hdLumas);
MainWindow::m_lumaFiles.insert(QStringLiteral("PAL"), sdLumas);
allImagefiles.removeDuplicates();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QtConcurrent::run(pCore.get(), &Core::buildLumaThumbs, allImagefiles);
#else
QtConcurrent::run(&Core::buildLumaThumbs, pCore.get(), allImagefiles);
#endif
}
......@@ -32,7 +32,11 @@ void ScopeWidget::onNewFrame(const SharedFrame &frame)
void ScopeWidget::requestRefresh()
{
if (m_future.isFinished()) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_future = QtConcurrent::run(this, &ScopeWidget::refreshInThread);
#else
m_future = QtConcurrent::run(&ScopeWidget::refreshInThread, this);
#endif
} else {
m_refreshPending = true;
}
......
......@@ -250,7 +250,11 @@ ArchiveWidget::ArchiveWidget(QUrl url, QWidget *parent)
connect(buttonBox->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &ArchiveWidget::slotStartExtracting);
buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
adjustSize();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_archiveThread = QtConcurrent::run(this, &ArchiveWidget::openArchiveForExtraction);
#else
m_archiveThread = QtConcurrent::run(&ArchiveWidget::openArchiveForExtraction, this);
#endif
}
ArchiveWidget::~ArchiveWidget()
......@@ -809,7 +813,11 @@ bool ArchiveWidget::processProjectFile()
KMessageBox::questionYesNo(nullptr, i18n("File %1 already exists.\nDo you want to overwrite it?", m_archiveName)) == KMessageBox::No) {
return false;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_archiveThread = QtConcurrent::run(this, &ArchiveWidget::createArchive);
#else
m_archiveThread = QtConcurrent::run(&ArchiveWidget::createArchive, this);
#endif
return true;
}
......@@ -1138,7 +1146,11 @@ void ArchiveWidget::slotStartExtracting()
slotDisplayMessage(QStringLiteral("system-run"), i18n("Extracting…"));
buttonBox->button(QDialogButtonBox::Apply)->setText(i18n("Abort"));
buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_archiveThread = QtConcurrent::run(this, &ArchiveWidget::doExtracting);
#else
m_archiveThread = QtConcurrent::run(&ArchiveWidget::doExtracting, this);
#endif
m_progressTimer->start();
}
......
......@@ -141,7 +141,11 @@ void AbstractScopeWidget::prodHUDThread()
m_newHUDFrames.fetchAndStoreRelaxed(0);
m_newHUDUpdates.fetchAndStoreRelaxed(0);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_threadHUD = QtConcurrent::run(this, &AbstractScopeWidget::renderHUD, m_accelFactorHUD);
#else
m_threadHUD = QtConcurrent::run(&AbstractScopeWidget::renderHUD, this, m_accelFactorHUD);
#endif
#ifdef DEBUG_ASW
qCDebug(KDENLIVE_LOG) << "HUD thread started in " << m_widgetName;
#endif
......@@ -177,7 +181,11 @@ void AbstractScopeWidget::prodScopeThread()
// See https://doc.qt.io/qt-5/qtconcurrentrun.html about
// running member functions in a thread
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_threadScope = QtConcurrent::run(this, &AbstractScopeWidget::renderScope, m_accelFactorScope);
#else
m_threadScope = QtConcurrent::run(&AbstractScopeWidget::renderScope, this, m_accelFactorScope);
#endif
m_requestForcedUpdate = false;
#ifdef DEBUG_ASW
......@@ -203,7 +211,11 @@ void AbstractScopeWidget::prodBackgroundThread()
m_newBackgroundFrames.fetchAndStoreRelaxed(0);
m_newBackgroundUpdates.fetchAndStoreRelaxed(0);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_threadBackground = QtConcurrent::run(this, &AbstractScopeWidget::renderBackground, m_accelFactorBackground);
#else
m_threadBackground = QtConcurrent::run(&AbstractScopeWidget::renderBackground, this, m_accelFactorBackground);
#endif
#ifdef DEBUG_ASW
qCDebug(KDENLIVE_LOG) << "Background thread started in " << m_widgetName;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment