mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 14:00:06 +00:00
"this" must be explicit in lambda capture
This commit is contained in:
parent
31db9a4315
commit
a3afd71f03
19 changed files with 132 additions and 129 deletions
|
|
@ -269,14 +269,14 @@ void MainWindow::on_actionOpenNexrad_triggered()
|
|||
dialog,
|
||||
&QFileDialog::finished,
|
||||
this,
|
||||
[=]() { update(); },
|
||||
[this]() { update(); },
|
||||
Qt::QueuedConnection);
|
||||
|
||||
connect(
|
||||
dialog,
|
||||
&QFileDialog::fileSelected,
|
||||
this,
|
||||
[=](const QString& file)
|
||||
[=, this](const QString& file)
|
||||
{
|
||||
logger_->info("Selected: {}", file.toStdString());
|
||||
|
||||
|
|
@ -287,7 +287,7 @@ void MainWindow::on_actionOpenNexrad_triggered()
|
|||
request.get(),
|
||||
&request::NexradFileRequest::RequestComplete,
|
||||
this,
|
||||
[=](std::shared_ptr<request::NexradFileRequest> request)
|
||||
[=, this](std::shared_ptr<request::NexradFileRequest> request)
|
||||
{
|
||||
std::shared_ptr<types::RadarProductRecord> record =
|
||||
request->radar_product_record();
|
||||
|
|
@ -331,13 +331,13 @@ void MainWindow::on_actionOpenTextEvent_triggered()
|
|||
dialog,
|
||||
&QFileDialog::finished,
|
||||
this,
|
||||
[=]() { update(); },
|
||||
[this]() { update(); },
|
||||
Qt::QueuedConnection);
|
||||
|
||||
connect(dialog,
|
||||
&QFileDialog::fileSelected,
|
||||
this,
|
||||
[=](const QString& file)
|
||||
[this](const QString& file)
|
||||
{
|
||||
logger_->info("Selected: {}", file.toStdString());
|
||||
p->textEventManager_->LoadFile(file.toStdString());
|
||||
|
|
@ -483,7 +483,7 @@ void MainWindowImpl::ConfigureMapLayout()
|
|||
|
||||
maps_.resize(mapCount);
|
||||
|
||||
auto MoveSplitter = [=](int /*pos*/, int /*index*/)
|
||||
auto MoveSplitter = [=, this](int /*pos*/, int /*index*/)
|
||||
{
|
||||
QSplitter* s = static_cast<QSplitter*>(sender());
|
||||
|
||||
|
|
@ -575,7 +575,7 @@ void MainWindowImpl::ConnectOtherSignals()
|
|||
connect(qApp,
|
||||
&QApplication::focusChanged,
|
||||
mainWindow_,
|
||||
[=](QWidget* /*old*/, QWidget* now) { HandleFocusChange(now); });
|
||||
[this](QWidget* /*old*/, QWidget* now) { HandleFocusChange(now); });
|
||||
connect(level2ProductsWidget_,
|
||||
&ui::Level2ProductsWidget::RadarProductSelected,
|
||||
mainWindow_,
|
||||
|
|
@ -605,7 +605,7 @@ void MainWindowImpl::ConnectOtherSignals()
|
|||
alertDockWidget_,
|
||||
&ui::AlertDockWidget::MoveMap,
|
||||
this,
|
||||
[=](double latitude, double longitude)
|
||||
[this](double latitude, double longitude)
|
||||
{
|
||||
for (map::MapWidget* map : maps_)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -506,7 +506,7 @@ void RadarProductManager::EnableRefresh(common::RadarProductGroup group,
|
|||
|
||||
// Only enable refresh on available products
|
||||
scwx::util::async(
|
||||
[=]()
|
||||
[=, this]()
|
||||
{
|
||||
providerManager->provider_->RequestAvailableProducts();
|
||||
auto availableProducts =
|
||||
|
|
@ -597,7 +597,7 @@ void RadarProductManagerImpl::RefreshData(
|
|||
}
|
||||
|
||||
scwx::util::async(
|
||||
[=]()
|
||||
[=, this]()
|
||||
{
|
||||
auto [newObjects, totalObjects] =
|
||||
providerManager->provider_->Refresh();
|
||||
|
|
@ -647,7 +647,7 @@ void RadarProductManagerImpl::RefreshData(
|
|||
{
|
||||
providerManager->refreshTimer_.expires_after(interval);
|
||||
providerManager->refreshTimer_.async_wait(
|
||||
[=](const boost::system::error_code& e)
|
||||
[=, this](const boost::system::error_code& e)
|
||||
{
|
||||
if (e == boost::system::errc::success)
|
||||
{
|
||||
|
|
@ -1151,7 +1151,7 @@ void RadarProductManager::UpdateAvailableProducts()
|
|||
logger_->debug("UpdateAvailableProducts()");
|
||||
|
||||
scwx::util::async(
|
||||
[=]()
|
||||
[this]()
|
||||
{
|
||||
auto level3ProviderManager =
|
||||
p->GetLevel3ProviderManager(kDefaultLevel3Product_);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public:
|
|||
warningsProvider_ {kDefaultWarningsProviderUrl}
|
||||
{
|
||||
util::async(
|
||||
[=]()
|
||||
[this]()
|
||||
{
|
||||
main::Application::WaitForInitialization();
|
||||
logger_->debug("Start Refresh");
|
||||
|
|
@ -105,7 +105,7 @@ void TextEventManager::LoadFile(const std::string& filename)
|
|||
logger_->debug("LoadFile: {}", filename);
|
||||
|
||||
util::async(
|
||||
[=]()
|
||||
[=, this]()
|
||||
{
|
||||
awips::TextProductFile file;
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ void TextEventManager::Impl::Refresh()
|
|||
using namespace std::chrono;
|
||||
refreshTimer_.expires_after(15s);
|
||||
refreshTimer_.async_wait(
|
||||
[=](const boost::system::error_code& e)
|
||||
[this](const boost::system::error_code& e)
|
||||
{
|
||||
if (e == boost::asio::error::operation_aborted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ void AlertLayerHandler::UpdateAlerts()
|
|||
using namespace std::chrono;
|
||||
alertUpdateTimer_.expires_after(15s);
|
||||
alertUpdateTimer_.async_wait(
|
||||
[=](const boost::system::error_code& e)
|
||||
[this](const boost::system::error_code& e)
|
||||
{
|
||||
if (e == boost::asio::error::operation_aborted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ void ColorTableLayer::Initialize()
|
|||
connect(context()->radar_product_view().get(),
|
||||
&view::RadarProductView::ColorTableUpdated,
|
||||
this,
|
||||
[=]() { p->colorTableNeedsUpdate_ = true; });
|
||||
[this]() { p->colorTableNeedsUpdate_ = true; });
|
||||
}
|
||||
|
||||
void ColorTableLayer::Render(
|
||||
|
|
|
|||
|
|
@ -797,13 +797,13 @@ void MapWidgetImpl::RadarProductManagerConnect()
|
|||
connect(radarProductManager_.get(),
|
||||
&manager::RadarProductManager::Level3ProductsChanged,
|
||||
this,
|
||||
[&]() { emit widget_->Level3ProductsChanged(); });
|
||||
[this]() { emit widget_->Level3ProductsChanged(); });
|
||||
|
||||
connect(
|
||||
radarProductManager_.get(),
|
||||
&manager::RadarProductManager::NewDataAvailable,
|
||||
this,
|
||||
[&](common::RadarProductGroup group,
|
||||
[this](common::RadarProductGroup group,
|
||||
const std::string& product,
|
||||
std::chrono::system_clock::time_point latestTime)
|
||||
{
|
||||
|
|
@ -817,10 +817,11 @@ void MapWidgetImpl::RadarProductManagerConnect()
|
|||
std::make_shared<request::NexradFileRequest>();
|
||||
|
||||
// File request callback
|
||||
connect(request.get(),
|
||||
connect(
|
||||
request.get(),
|
||||
&request::NexradFileRequest::RequestComplete,
|
||||
this,
|
||||
[&](std::shared_ptr<request::NexradFileRequest> request)
|
||||
[this](std::shared_ptr<request::NexradFileRequest> request)
|
||||
{
|
||||
// Select loaded record
|
||||
auto record = request->radar_product_record();
|
||||
|
|
@ -833,7 +834,7 @@ void MapWidgetImpl::RadarProductManagerConnect()
|
|||
|
||||
// Load file
|
||||
scwx::util::async(
|
||||
[=]()
|
||||
[=, this]()
|
||||
{
|
||||
if (group == common::RadarProductGroup::Level2)
|
||||
{
|
||||
|
|
@ -867,7 +868,7 @@ void MapWidgetImpl::InitializeNewRadarProductView(
|
|||
const std::string& colorPalette)
|
||||
{
|
||||
scwx::util::async(
|
||||
[=]()
|
||||
[=, this]()
|
||||
{
|
||||
auto radarProductView = context_->radar_product_view();
|
||||
|
||||
|
|
@ -903,13 +904,13 @@ void MapWidgetImpl::RadarProductViewConnect()
|
|||
radarProductView.get(),
|
||||
&view::RadarProductView::ColorTableUpdated,
|
||||
this,
|
||||
[&]() { widget_->update(); },
|
||||
[this]() { widget_->update(); },
|
||||
Qt::QueuedConnection);
|
||||
connect(
|
||||
radarProductView.get(),
|
||||
&view::RadarProductView::SweepComputed,
|
||||
this,
|
||||
[=]()
|
||||
[=, this]()
|
||||
{
|
||||
std::shared_ptr<config::RadarSite> radarSite =
|
||||
radarProductManager_->radar_site();
|
||||
|
|
|
|||
|
|
@ -149,11 +149,11 @@ void RadarProductLayer::Initialize()
|
|||
connect(radarProductView.get(),
|
||||
&view::RadarProductView::ColorTableUpdated,
|
||||
this,
|
||||
[=]() { p->colorTableNeedsUpdate_ = true; });
|
||||
[this]() { p->colorTableNeedsUpdate_ = true; });
|
||||
connect(radarProductView.get(),
|
||||
&view::RadarProductView::SweepComputed,
|
||||
this,
|
||||
[=]() { p->sweepNeedsUpdate_ = true; });
|
||||
[this]() { p->sweepNeedsUpdate_ = true; });
|
||||
}
|
||||
|
||||
void RadarProductLayer::UpdateSweep()
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ void AlertProxyModelImpl::UpdateAlerts()
|
|||
using namespace std::chrono;
|
||||
alertUpdateTimer_.expires_after(15s);
|
||||
alertUpdateTimer_.async_wait(
|
||||
[=](const boost::system::error_code& e)
|
||||
[this](const boost::system::error_code& e)
|
||||
{
|
||||
if (e == boost::asio::error::operation_aborted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) :
|
|||
&manager::RadarProductManagerNotifier::Instance(),
|
||||
&manager::RadarProductManagerNotifier::RadarProductManagerCreated,
|
||||
this,
|
||||
[=](const std::string& radarSite)
|
||||
[this](const std::string& radarSite)
|
||||
{
|
||||
logger_->debug("Adding radar site: {}", radarSite);
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) :
|
|||
manager::RadarProductManager::Instance(radarSite).get(),
|
||||
&manager::RadarProductManager::NewDataAvailable,
|
||||
this,
|
||||
[=](common::RadarProductGroup group,
|
||||
[=, this](common::RadarProductGroup group,
|
||||
const std::string& product,
|
||||
std::chrono::system_clock::time_point latestTime)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ void AlertDialogImpl::ConnectSignals()
|
|||
textEventManager_.get(),
|
||||
&manager::TextEventManager::AlertUpdated,
|
||||
this,
|
||||
[=](const types::TextEventKey& key)
|
||||
[this](const types::TextEventKey& key)
|
||||
{
|
||||
if (key == key_)
|
||||
{
|
||||
|
|
@ -85,7 +85,7 @@ void AlertDialogImpl::ConnectSignals()
|
|||
connect(goButton_,
|
||||
&QPushButton::clicked,
|
||||
this,
|
||||
[=]()
|
||||
[this]()
|
||||
{
|
||||
emit self_->MoveMap(centroid_.latitude_, centroid_.longitude_);
|
||||
self_->close();
|
||||
|
|
|
|||
|
|
@ -127,10 +127,11 @@ void AlertDockWidgetImpl::ConnectSignals()
|
|||
alertModel_.get(),
|
||||
&model::AlertModel::HandleAlert,
|
||||
Qt::QueuedConnection);
|
||||
connect(self_->ui->alertView->selectionModel(),
|
||||
connect(
|
||||
self_->ui->alertView->selectionModel(),
|
||||
&QItemSelectionModel::selectionChanged,
|
||||
this,
|
||||
[=](const QItemSelection& selected, const QItemSelection& deselected)
|
||||
[this](const QItemSelection& selected, const QItemSelection& deselected)
|
||||
{
|
||||
if (selected.size() == 0 && deselected.size() == 0)
|
||||
{
|
||||
|
|
@ -149,8 +150,7 @@ void AlertDockWidgetImpl::ConnectSignals()
|
|||
QModelIndex selectedIndex =
|
||||
proxyModel_->mapToSource(selected[0].indexes()[0]);
|
||||
selectedAlertKey_ = alertModel_->key(selectedIndex);
|
||||
selectedAlertCentroid_ =
|
||||
alertModel_->centroid(selectedAlertKey_);
|
||||
selectedAlertCentroid_ = alertModel_->centroid(selectedAlertKey_);
|
||||
itemHasCoordinates =
|
||||
selectedAlertCentroid_ != common::Coordinate {};
|
||||
}
|
||||
|
|
@ -168,7 +168,7 @@ void AlertDockWidgetImpl::ConnectSignals()
|
|||
connect(self_->ui->alertViewButton,
|
||||
&QPushButton::clicked,
|
||||
this,
|
||||
[=]()
|
||||
[this]()
|
||||
{
|
||||
// View alert
|
||||
alertDialog_->SelectAlert(selectedAlertKey_);
|
||||
|
|
@ -177,7 +177,7 @@ void AlertDockWidgetImpl::ConnectSignals()
|
|||
connect(self_->ui->alertGoButton,
|
||||
&QPushButton::clicked,
|
||||
this,
|
||||
[=]()
|
||||
[this]()
|
||||
{
|
||||
emit self_->MoveMap(selectedAlertCentroid_.latitude_,
|
||||
selectedAlertCentroid_.longitude_);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ ImGuiDebugDialog::ImGuiDebugDialog(QWidget* parent) :
|
|||
connect(
|
||||
ui->contextComboBox,
|
||||
&QComboBox::currentIndexChanged,
|
||||
[=](int row)
|
||||
[this](int row)
|
||||
{
|
||||
auto& contextModel = model::ImGuiContextModel::Instance();
|
||||
auto index = contextModel.index(row, 0);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public:
|
|||
QObject::connect(toolButton,
|
||||
&QToolButton::clicked,
|
||||
this,
|
||||
[=]() { SelectProduct(product); });
|
||||
[=, this]() { SelectProduct(product); });
|
||||
}
|
||||
}
|
||||
~Level2ProductsWidgetImpl() = default;
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ void Level2SettingsWidget::UpdateSettings(map::MapWidget* activeMap)
|
|||
connect(toolButton,
|
||||
&QToolButton::clicked,
|
||||
this,
|
||||
[=]() { p->SelectElevation(elevationCut); });
|
||||
[=, this]() { p->SelectElevation(elevationCut); });
|
||||
}
|
||||
|
||||
p->elevationCuts_ = elevationCuts;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public:
|
|||
QObject::connect(toolButton,
|
||||
&QToolButton::clicked,
|
||||
this,
|
||||
[=]() { SelectProductCategory(category); });
|
||||
[=, this]() { SelectProductCategory(category); });
|
||||
|
||||
QMenu* categoryMenu = new QMenu();
|
||||
toolButton->setMenu(categoryMenu);
|
||||
|
|
@ -79,7 +79,7 @@ public:
|
|||
action,
|
||||
&QAction::triggered,
|
||||
this,
|
||||
[=]()
|
||||
[=, this]()
|
||||
{
|
||||
std::shared_lock lock {awipsProductMutex_};
|
||||
std::string awipsProductName {awipsProductMap_.at(action)};
|
||||
|
|
|
|||
|
|
@ -72,11 +72,12 @@ RadarSiteDialog::RadarSiteDialog(QWidget* parent) :
|
|||
connect(ui->radarSiteView,
|
||||
&QTreeView::doubleClicked,
|
||||
this,
|
||||
[=]() { emit accept(); });
|
||||
connect(ui->radarSiteView->selectionModel(),
|
||||
[this]() { emit accept(); });
|
||||
connect(
|
||||
ui->radarSiteView->selectionModel(),
|
||||
&QItemSelectionModel::selectionChanged,
|
||||
this,
|
||||
[=](const QItemSelection& selected, const QItemSelection& deselected)
|
||||
[this](const QItemSelection& selected, const QItemSelection& deselected)
|
||||
{
|
||||
if (selected.size() == 0 && deselected.size() == 0)
|
||||
{
|
||||
|
|
@ -97,18 +98,17 @@ RadarSiteDialog::RadarSiteDialog(QWidget* parent) :
|
|||
QVariant variantData = p->radarSiteModel_->data(selectedIndex);
|
||||
if (variantData.typeId() == QMetaType::QString)
|
||||
{
|
||||
p->selectedRadarSite_ =
|
||||
variantData.toString().toStdString();
|
||||
p->selectedRadarSite_ = variantData.toString().toStdString();
|
||||
}
|
||||
else
|
||||
{
|
||||
logger_->warn("Unexpected selection data type");
|
||||
p->selectedRadarSite_ = "?";
|
||||
p->selectedRadarSite_ = std::string {"?"};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
p->selectedRadarSite_ = "?";
|
||||
p->selectedRadarSite_ = std::string {"?"};
|
||||
}
|
||||
|
||||
logger_->debug("Selected: {}", p->selectedRadarSite_);
|
||||
|
|
|
|||
|
|
@ -514,11 +514,13 @@ void SettingsDialogImpl::SetupPalettesAlertsTab()
|
|||
QObject::connect(activeButton,
|
||||
&QAbstractButton::clicked,
|
||||
self_,
|
||||
[=]() { ShowColorDialog(activeEdit, activeFrame); });
|
||||
[=, this]()
|
||||
{ ShowColorDialog(activeEdit, activeFrame); });
|
||||
QObject::connect(inactiveButton,
|
||||
&QAbstractButton::clicked,
|
||||
self_,
|
||||
[=]() { ShowColorDialog(inactiveEdit, inactiveFrame); });
|
||||
[=, this]()
|
||||
{ ShowColorDialog(inactiveEdit, inactiveFrame); });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ void Level2ProductViewImpl::SetProduct(common::Level2Product product)
|
|||
|
||||
void Level2ProductView::Update()
|
||||
{
|
||||
util::async([=]() { ComputeSweep(); });
|
||||
util::async([this]() { ComputeSweep(); });
|
||||
}
|
||||
|
||||
void Level2ProductView::UpdateColorTable()
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ void Level3ProductView::LoadColorTable(
|
|||
|
||||
void Level3ProductView::Update()
|
||||
{
|
||||
util::async([=]() { ComputeSweep(); });
|
||||
util::async([this]() { ComputeSweep(); });
|
||||
}
|
||||
|
||||
void Level3ProductView::UpdateColorTable()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue