Skip to content

Commit

Permalink
Fix C++ 20 lambda warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Feb 4, 2025
1 parent 40c9174 commit 2b05f96
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions YUViewLib/src/playlistitem/playlistItemStatisticsFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ playlistItemStatisticsFile::playlistItemStatisticsFile(const QString &itemNameOr
this->openStatisticsFile();
this->statisticsUIHandler.setStatisticsData(&this->statisticsData);

connect(&this->statisticsUIHandler,
&stats::StatisticUIHandler::updateItem,
[this](bool redraw) { emit SignalItemChanged(redraw, RECACHE_NONE); });
connect(&this->statisticsUIHandler, &stats::StatisticUIHandler::updateItem, [this](bool redraw) {
emit SignalItemChanged(redraw, RECACHE_NONE);
});
}

playlistItemStatisticsFile::~playlistItemStatisticsFile()
Expand Down Expand Up @@ -299,8 +299,9 @@ void playlistItemStatisticsFile::openStatisticsFile()
this->timer.start(1000, this);
this->breakBackgroundAtomic.store(false);
this->backgroundParserFuture = QtConcurrent::run(
[=](stats::StatisticsFileBase *file)
{ file->readFrameAndTypePositionsFromFile(std::ref(this->breakBackgroundAtomic)); },
[=, this](stats::StatisticsFileBase *file) {
file->readFrameAndTypePositionsFromFile(std::ref(this->breakBackgroundAtomic));
},
this->file.get());

DEBUG_STAT(
Expand Down
4 changes: 2 additions & 2 deletions YUViewLib/src/statistics/StatisticUIHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ QLayout *StatisticUIHandler::createStatisticsHandlerControls(bool recreateContro
QPushButton *pushButton = new QPushButton(
functionsGui::convertIcon(":img_edit.png"), QString(), ui.scrollAreaWidgetContents);
ui.gridLayout->addWidget(pushButton, int(row + 2), 2);
connect(pushButton, &QPushButton::released, this, [=] { onStyleButtonClicked(row); });
connect(pushButton, &QPushButton::released, this, [=, this] { onStyleButtonClicked(row); });
itemStyleButtons[0].push_back(pushButton);
}

Expand Down Expand Up @@ -185,7 +185,7 @@ QWidget *StatisticUIHandler::getSecondaryStatisticsHandlerControls(bool recreate
QPushButton *pushButton = new QPushButton(
functionsGui::convertIcon(":img_edit.png"), QString(), ui2.scrollAreaWidgetContents);
ui2.gridLayout->addWidget(pushButton, int(row + 2), 2);
connect(pushButton, &QPushButton::released, this, [=] { onStyleButtonClicked(row); });
connect(pushButton, &QPushButton::released, this, [=, this] { onStyleButtonClicked(row); });
itemStyleButtons[1].push_back(pushButton);
}

Expand Down
6 changes: 3 additions & 3 deletions YUViewLib/src/video/VideoCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class VideoCache::loadingThread : public QThread
{
// We must wait until the worker is done.
DEBUG_CACHING("loadingThread::quitWhenDone waiting for worker to finish...");
connect(worker(), &loadingWorker::loadingFinished, this, [=] {
connect(worker(), &loadingWorker::loadingFinished, this, [=, this] {
DEBUG_CACHING("loadingThread::quitWhenDone worker done -> quit");
quit();
});
Expand Down Expand Up @@ -264,8 +264,8 @@ VideoCache::VideoCache(PlaylistTreeWidget *playlistTreeWidget,
&PlaybackController::signalPlaybackStarting,
this,
&VideoCache::updateCacheQueue);
connect(&statusUpdateTimer, &QTimer::timeout, this, [=] { emit updateCacheStatus(); });
connect(&testProgrssUpdateTimer, &QTimer::timeout, this, [=] { updateTestProgress(); });
connect(&statusUpdateTimer, &QTimer::timeout, this, [=, this] { emit updateCacheStatus(); });
connect(&testProgrssUpdateTimer, &QTimer::timeout, this, [=, this] { updateTestProgress(); });
}

VideoCache::~VideoCache()
Expand Down

0 comments on commit 2b05f96

Please sign in to comment.