Adapt to QtConcurrent changes in Qt6

Accessing the QFuture result is no longer implicit, and run() changed
the argument order.
wilder-5.25
Volker Krause 4 years ago
parent f4d444bbf0
commit aa62130a15
  1. 2
      dataengines/activities/activityjob.cpp
  2. 4
      klipper/clipboardjob.cpp
  3. 4
      klipper/klipper.cpp

@ -33,7 +33,7 @@ void ActivityJob::start()
if (name.isEmpty()) {
name = i18n("unnamed");
}
const QString activityId = m_activityController->addActivity(name);
const QString activityId = m_activityController->addActivity(name).result();
setResult(activityId);
return;
}

@ -119,7 +119,11 @@ void ClipboardJob::start()
watcher->deleteLater();
delete code;
});
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
auto future = QtConcurrent::run(code, &Prison::AbstractBarcode::toImage, QSizeF(pixelWidth, pixelHeight));
#else
auto future = QtConcurrent::run(&Prison::AbstractBarcode::toImage, code, QSizeF(pixelWidth, pixelHeight));
#endif
watcher->setFuture(future);
return;
} else {

@ -349,7 +349,11 @@ void Klipper::loadSettings()
m_saveFileTimer->setSingleShot(true);
m_saveFileTimer->setInterval(5000);
connect(m_saveFileTimer, &QTimer::timeout, this, [this] {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QtConcurrent::run(this, &Klipper::saveHistory, false);
#else
QtConcurrent::run(&Klipper::saveHistory, this, false);
#endif
});
connect(m_history, &History::changed, m_saveFileTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
} else {

Loading…
Cancel
Save