Skip to content

Commit

Permalink
Make lambdas capturing only this explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1t3cht committed Jan 28, 2025
1 parent dd48a1a commit 5aea50d
Show file tree
Hide file tree
Showing 23 changed files with 84 additions and 84 deletions.
6 changes: 3 additions & 3 deletions src/audio_timing_dialogue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ AudioTimingControllerDialogue::AudioTimingControllerDialogue(agi::Context *c)
, active_line_connection(c->selectionController->AddActiveLineListener(&AudioTimingControllerDialogue::Revert, this))
, selection_connection(c->selectionController->AddSelectionListener(&AudioTimingControllerDialogue::OnSelectedSetChanged, this))
{
keyframes_provider.AddMarkerMovedListener([=, this]{ AnnounceMarkerMoved(); });
video_position_provider.AddMarkerMovedListener([=, this]{ AnnounceMarkerMoved(); });
seconds_provider.AddMarkerMovedListener([=, this]{ AnnounceMarkerMoved(); });
keyframes_provider.AddMarkerMovedListener([this]{ AnnounceMarkerMoved(); });
video_position_provider.AddMarkerMovedListener([this]{ AnnounceMarkerMoved(); });
seconds_provider.AddMarkerMovedListener([this]{ AnnounceMarkerMoved(); });

Revert();
}
Expand Down
6 changes: 3 additions & 3 deletions src/audio_timing_karaoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ AudioTimingControllerKaraoke::AudioTimingControllerKaraoke(agi::Context *c, agi:
, video_position_provider(c)
{
connections.push_back(kara->AddSyllablesChangedListener(&AudioTimingControllerKaraoke::Revert, this));
connections.push_back(OPT_SUB("Audio/Auto/Commit", [=, this](agi::OptionValue const& opt) { auto_commit = opt.GetBool(); }));
connections.push_back(OPT_SUB("Audio/Auto/Commit", [this](agi::OptionValue const& opt) { auto_commit = opt.GetBool(); }));

keyframes_provider.AddMarkerMovedListener([=, this]{ AnnounceMarkerMoved(); });
video_position_provider.AddMarkerMovedListener([=, this]{ AnnounceMarkerMoved(); });
keyframes_provider.AddMarkerMovedListener([this]{ AnnounceMarkerMoved(); });
video_position_provider.AddMarkerMovedListener([this]{ AnnounceMarkerMoved(); });

Revert();
}
Expand Down
2 changes: 1 addition & 1 deletion src/colour_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ColourButton::ColourButton(wxWindow *parent, wxSize const& size, bool alpha, agi
{
UpdateBitmap();
Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) {
GetColorFromUser(GetParent(), colour, alpha, [=, this](agi::Color new_color) {
GetColorFromUser(GetParent(), colour, alpha, [this](agi::Color new_color) {
colour = new_color;
UpdateBitmap();

Expand Down
2 changes: 1 addition & 1 deletion src/dialog_automation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void DialogAutomation::OnInfo(wxCommandEvent &)
ei->script->GetFilename().wstring(),
ei->script->GetLoadedState() ? _("Correctly loaded") : _("Failed to load")));

boost::transform(ei->script->GetMacros(), append_info, [=, this](const cmd::Command *f) {
boost::transform(ei->script->GetMacros(), append_info, [this](const cmd::Command *f) {
return fmt_tl(" Macro: %s (%s)", f->StrDisplay(context), f->name());
});
boost::transform(ei->script->GetFilters(), append_info, [](const Automation4::ExportFilter* f) {
Expand Down
2 changes: 1 addition & 1 deletion src/dialog_autosave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ DialogAutosave::DialogAutosave(wxWindow *parent)

wxSizer *versions_box = new wxStaticBoxSizer(wxVERTICAL, &d, _("Versions"));
version_list = new wxListBox(&d, -1);
version_list->Bind(wxEVT_LISTBOX_DCLICK, [=, this](wxCommandEvent&) { d.EndModal(wxID_OK); });
version_list->Bind(wxEVT_LISTBOX_DCLICK, [this](wxCommandEvent&) { d.EndModal(wxID_OK); });
versions_box->Add(version_list, wxSizerFlags(1).Expand().Border());

wxSizer *boxes_sizer = new wxBoxSizer(wxHORIZONTAL);
Expand Down
10 changes: 5 additions & 5 deletions src/dialog_colorpicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class ColorPickerRecent final : public wxStaticBitmap {
SetCursor(*wxCROSS_CURSOR);

Bind(wxEVT_LEFT_DOWN, &ColorPickerRecent::OnClick, this);
Bind(wxEVT_SIZE, [=, this](wxSizeEvent&) { UpdateBitmap(); });
Bind(wxEVT_SIZE, [this](wxSizeEvent&) { UpdateBitmap(); });
}

/// Load the colors to show
Expand Down Expand Up @@ -873,7 +873,7 @@ void DialogColorPicker::UpdateSpectrumDisplay() {
}
preview_box->SetBitmap(tempBmp);

alpha_slider_img = make_slider_img([=, this](unsigned char *slid) {
alpha_slider_img = make_slider_img([this](unsigned char *slid) {
static_assert(slider_width % alpha_box_size == 0, "Slider width must be a multiple of alpha box width");

for (int y = 0; y < 256; ++y) {
Expand Down Expand Up @@ -915,7 +915,7 @@ static wxBitmap *make_spectrum(wxBitmap *bitmap, Func func) {
}

wxBitmap *DialogColorPicker::MakeGBSpectrum() {
return make_spectrum(&rgb_spectrum[0], [=, this](unsigned char *spec) {
return make_spectrum(&rgb_spectrum[0], [this](unsigned char *spec) {
for (int g = 0; g < 256; g++) {
for (int b = 0; b < 256; b++) {
*spec++ = cur_color.r;
Expand All @@ -927,7 +927,7 @@ wxBitmap *DialogColorPicker::MakeGBSpectrum() {
}

wxBitmap *DialogColorPicker::MakeRBSpectrum() {
return make_spectrum(&rgb_spectrum[1], [=, this](unsigned char *spec) {
return make_spectrum(&rgb_spectrum[1], [this](unsigned char *spec) {
for (int r = 0; r < 256; r++) {
for (int b = 0; b < 256; b++) {
*spec++ = r;
Expand All @@ -939,7 +939,7 @@ wxBitmap *DialogColorPicker::MakeRBSpectrum() {
}

wxBitmap *DialogColorPicker::MakeRGSpectrum() {
return make_spectrum(&rgb_spectrum[2], [=, this](unsigned char *spec) {
return make_spectrum(&rgb_spectrum[2], [this](unsigned char *spec) {
for (int r = 0; r < 256; r++) {
for (int g = 0; g < 256; g++) {
*spec++ = r;
Expand Down
2 changes: 1 addition & 1 deletion src/dialog_dummy_video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ DialogDummyVideo::DialogDummyVideo(wxWindow *parent)
d.CenterOnParent();

d.Bind(wxEVT_COMBOBOX, &DialogDummyVideo::OnResolutionShortcut, this);
color_btn->Bind(EVT_COLOR, [=, this](ValueEvent<agi::Color>& e) { color = e.Get(); });
color_btn->Bind(EVT_COLOR, [this](ValueEvent<agi::Color>& e) { color = e.Get(); });
auto on_update = [&, btn_sizer](wxCommandEvent&) {
d.TransferDataFromWindow();
btn_sizer->GetAffirmativeButton()->Enable(UpdateLengthDisplay());
Expand Down
10 changes: 5 additions & 5 deletions src/dialog_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ DialogExport::DialogExport(agi::Context *c)

std::vector<std::string> filters = exporter.GetAllFilterNames();
filter_list = new wxCheckListBox(&d, -1, wxDefaultPosition, wxSize(200, 100), to_wx(filters));
filter_list->Bind(wxEVT_CHECKLISTBOX, [=, this](wxCommandEvent&) { RefreshOptions(); });
filter_list->Bind(wxEVT_CHECKLISTBOX, [this](wxCommandEvent&) { RefreshOptions(); });
filter_list->Bind(wxEVT_LISTBOX, &DialogExport::OnChange, this);

// Get selected filters
Expand All @@ -123,10 +123,10 @@ DialogExport::DialogExport(agi::Context *c)
wxButton *btn_all = new wxButton(&d, -1, _("Select &All"), wxDefaultPosition, wxSize(80, -1));
wxButton *btn_none = new wxButton(&d, -1, _("Select &None"), wxDefaultPosition, wxSize(80, -1));

btn_up->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection() - 1, 0); });
btn_down->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection(), 1); });
btn_all->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { SetAll(true); });
btn_none->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { SetAll(false); });
btn_up->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection() - 1, 0); });
btn_down->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection(), 1); });
btn_all->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { SetAll(true); });
btn_none->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { SetAll(false); });

wxSizer *top_buttons = new wxBoxSizer(wxHORIZONTAL);
top_buttons->Add(btn_up, wxSizerFlags(1).Expand());
Expand Down
4 changes: 2 additions & 2 deletions src/dialog_progress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class DialogProgressSink final : public agi::ProgressSink {
}

void SetIndeterminate() override {
Main().Async([=, this]{ dialog->pulse_timer.Start(1000); });
Main().Async([this]{ dialog->pulse_timer.Start(1000); });
}
};

Expand Down Expand Up @@ -136,7 +136,7 @@ DialogProgress::DialogProgress(wxWindow *parent, wxString const& title_text, wxS
CenterOnParent();

Bind(wxEVT_SHOW, &DialogProgress::OnShow, this);
Bind(wxEVT_TIMER, [=, this](wxTimerEvent&) { gauge->Pulse(); });
Bind(wxEVT_TIMER, [this](wxTimerEvent&) { gauge->Pulse(); });
}

void DialogProgress::Run(std::function<void(agi::ProgressSink*)> task) {
Expand Down
4 changes: 2 additions & 2 deletions src/dialog_resample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ DialogResample::DialogResample(agi::Context *c, ResampleSettings &settings)
// Bind events
using std::bind;
d.Bind(wxEVT_BUTTON, bind(&HelpButton::OpenPage, "Resample resolution"), wxID_HELP);
d.Bind(wxEVT_SPINCTRL, [=, this](wxCommandEvent&) { UpdateButtons(); });
d.Bind(wxEVT_RADIOBOX, [=, this](wxCommandEvent&) { UpdateButtons(); });
d.Bind(wxEVT_SPINCTRL, [this](wxCommandEvent&) { UpdateButtons(); });
d.Bind(wxEVT_RADIOBOX, [this](wxCommandEvent&) { UpdateButtons(); });
from_video->Bind(wxEVT_BUTTON, &DialogResample::SetDestFromVideo, this);
from_script->Bind(wxEVT_BUTTON, &DialogResample::SetSourceFromScript, this);
symmetrical->Bind(wxEVT_CHECKBOX, &DialogResample::OnSymmetrical, this);
Expand Down
12 changes: 6 additions & 6 deletions src/dialog_spellchecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ DialogSpellChecker::DialogSpellChecker(agi::Context *context)
current_word_sizer->Add(new wxStaticText(this, -1, _("Replace with:")), 0, wxALIGN_CENTER_VERTICAL);
current_word_sizer->Add(replace_word = new wxTextCtrl(this, -1, ""), wxSizerFlags(1).Expand());

replace_word->Bind(wxEVT_TEXT, [=, this](wxCommandEvent&) {
replace_word->Bind(wxEVT_TEXT, [this](wxCommandEvent&) {
remove_button->Enable(spellchecker->CanRemoveWord(from_wx(replace_word->GetValue())));
});

Expand Down Expand Up @@ -188,29 +188,29 @@ DialogSpellChecker::DialogSpellChecker(agi::Context *context)
button->Bind(wxEVT_BUTTON, &DialogSpellChecker::OnReplace, this);

actions_sizer->Add(button = new wxButton(this, -1, _("Replace &all")), button_flags);
button->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) {
button->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
auto_replace[from_wx(orig_word->GetValue())] = from_wx(replace_word->GetValue());
Replace();
FindNext();
});

actions_sizer->Add(button = new wxButton(this, -1, _("&Ignore")), button_flags);
button->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { FindNext(); });
button->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { FindNext(); });

actions_sizer->Add(button = new wxButton(this, -1, _("Ignore a&ll")), button_flags);
button->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) {
button->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
auto_ignore.insert(from_wx(orig_word->GetValue()));
FindNext();
});

actions_sizer->Add(add_button = new wxButton(this, -1, _("Add to &dictionary")), button_flags);
add_button->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) {
add_button->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
spellchecker->AddWord(from_wx(orig_word->GetValue()));
FindNext();
});

actions_sizer->Add(remove_button = new wxButton(this, -1, _("Remove fro&m dictionary")), button_flags);
remove_button->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) {
remove_button->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
spellchecker->RemoveWord(from_wx(replace_word->GetValue()));
SetWord(from_wx(orig_word->GetValue()));
});
Expand Down
68 changes: 34 additions & 34 deletions src/dialog_style_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,43 +336,43 @@ DialogStyleManager::DialogStyleManager(agi::Context *context)
StorageList->Bind(wxEVT_KEY_DOWN, &DialogStyleManager::OnKeyDown, this);
CurrentList->Bind(wxEVT_KEY_DOWN, &DialogStyleManager::OnKeyDown, this);

StorageMoveUp->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { MoveStyles(true, 0); });
StorageMoveTop->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { MoveStyles(true, 1); });
StorageMoveDown->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { MoveStyles(true, 2); });
StorageMoveBottom->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { MoveStyles(true, 3); });
StorageSort->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { MoveStyles(true, 4); });
StorageMoveUp->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { MoveStyles(true, 0); });
StorageMoveTop->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { MoveStyles(true, 1); });
StorageMoveDown->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { MoveStyles(true, 2); });
StorageMoveBottom->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { MoveStyles(true, 3); });
StorageSort->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { MoveStyles(true, 4); });

CurrentMoveUp->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { MoveStyles(false, 0); });
CurrentMoveTop->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { MoveStyles(false, 1); });
CurrentMoveDown->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { MoveStyles(false, 2); });
CurrentMoveBottom->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { MoveStyles(false, 3); });
CurrentSort->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { MoveStyles(false, 4); });
CurrentMoveUp->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { MoveStyles(false, 0); });
CurrentMoveTop->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { MoveStyles(false, 1); });
CurrentMoveDown->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { MoveStyles(false, 2); });
CurrentMoveBottom->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { MoveStyles(false, 3); });
CurrentSort->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { MoveStyles(false, 4); });

CatalogNew->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnCatalogNew(); });
CatalogDelete->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnCatalogDelete(); });
CatalogNew->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnCatalogNew(); });
CatalogDelete->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnCatalogDelete(); });

StorageNew->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnStorageNew(); });
StorageEdit->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnStorageEdit(); });
StorageCopy->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnStorageCopy(); });
StorageDelete->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnStorageDelete(); });
StorageNew->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnStorageNew(); });
StorageEdit->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnStorageEdit(); });
StorageCopy->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnStorageCopy(); });
StorageDelete->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnStorageDelete(); });

CurrentNew->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnCurrentNew(); });
CurrentEdit->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnCurrentEdit(); });
CurrentCopy->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnCurrentCopy(); });
CurrentDelete->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnCurrentDelete(); });
CurrentNew->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnCurrentNew(); });
CurrentEdit->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnCurrentEdit(); });
CurrentCopy->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnCurrentCopy(); });
CurrentDelete->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnCurrentDelete(); });

CurrentImport->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnCurrentImport(); });
CurrentImport->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnCurrentImport(); });

MoveToLocal->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnCopyToCurrent(); });
MoveToStorage->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { OnCopyToStorage(); });
MoveToLocal->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnCopyToCurrent(); });
MoveToStorage->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { OnCopyToStorage(); });

CatalogList->Bind(wxEVT_COMBOBOX, [=, this](wxCommandEvent&) { OnChangeCatalog(); });
CatalogList->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent&) { OnChangeCatalog(); });

StorageList->Bind(wxEVT_LISTBOX, [=, this](wxCommandEvent&) { UpdateButtons(); });
StorageList->Bind(wxEVT_LISTBOX_DCLICK, [=, this](wxCommandEvent&) { OnStorageEdit(); });
StorageList->Bind(wxEVT_LISTBOX, [this](wxCommandEvent&) { UpdateButtons(); });
StorageList->Bind(wxEVT_LISTBOX_DCLICK, [this](wxCommandEvent&) { OnStorageEdit(); });

CurrentList->Bind(wxEVT_LISTBOX, [=, this](wxCommandEvent&) { UpdateButtons(); });
CurrentList->Bind(wxEVT_LISTBOX_DCLICK, [=, this](wxCommandEvent&) { OnCurrentEdit(); });
CurrentList->Bind(wxEVT_LISTBOX, [this](wxCommandEvent&) { UpdateButtons(); });
CurrentList->Bind(wxEVT_LISTBOX_DCLICK, [this](wxCommandEvent&) { OnCurrentEdit(); });
}

void DialogStyleManager::LoadCurrentStyles(int commit_type) {
Expand Down Expand Up @@ -569,16 +569,16 @@ void DialogStyleManager::CopyToClipboard(wxListBox *list, T const& v) {

void DialogStyleManager::PasteToCurrent() {
add_styles(
[=, this](std::string const& str) { return c->ass->GetStyle(str); },
[=, this](AssStyle *s) { c->ass->Styles.push_back(*s); });
[this](std::string const& str) { return c->ass->GetStyle(str); },
[this](AssStyle *s) { c->ass->Styles.push_back(*s); });

c->ass->Commit(_("style paste"), AssFile::COMMIT_STYLES);
}

void DialogStyleManager::PasteToStorage() {
add_styles(
[=, this](std::string const& str) { return Store.GetStyle(str); },
[=, this](AssStyle *s) { Store.push_back(std::unique_ptr<AssStyle>(s)); });
[this](std::string const& str) { return Store.GetStyle(str); },
[this](AssStyle *s) { Store.push_back(std::unique_ptr<AssStyle>(s)); });

UpdateStorage();
StorageList->SetStringSelection(to_wx(Store.back()->name));
Expand Down Expand Up @@ -609,7 +609,7 @@ void DialogStyleManager::OnStorageCopy() {
if (sel == -1) return;

ShowStorageEditor(Store[sel], unique_name(
[=, this](std::string const& str) { return Store.GetStyle(str); }, Store[sel]->name));
[this](std::string const& str) { return Store.GetStyle(str); }, Store[sel]->name));
}

void DialogStyleManager::OnStorageDelete() {
Expand Down Expand Up @@ -647,7 +647,7 @@ void DialogStyleManager::OnCurrentCopy() {
if (sel == -1) return;

ShowCurrentEditor(styleMap[sel], unique_name(
[=, this](std::string const& str) { return c->ass->GetStyle(str); },
[this](std::string const& str) { return c->ass->GetStyle(str); },
styleMap[sel]->name));
}

Expand Down
2 changes: 1 addition & 1 deletion src/export_framerate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ wxWindow *AssTransformFramerateFilter::GetConfigDialogWindow(wxWindow *parent, a
auto FromVideo = new wxButton(base,-1,_("From &video"));
if (Input.IsLoaded()) {
initialInput = fmt_wx("%2.3f", Input.FPS());
FromVideo->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) {
FromVideo->Bind(wxEVT_BUTTON, [c, this](wxCommandEvent&) {
InputFramerate->SetValue(fmt_wx("%g", c->project->Timecodes().FPS()));
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/hotkey_data_view_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ bool HotkeyDataViewModel::IsContainer(wxDataViewItem const& item) const {
bool HotkeyDataViewModel::SetValue(wxVariant const& variant, wxDataViewItem const& item, unsigned int col) {
if (!has_pending_changes) {
has_pending_changes = true;
parent->AddPendingChange([=, this] { Apply(); });
parent->AddPendingChange([this] { Apply(); });
}
return get(item)->SetValue(variant, col);
}
Expand All @@ -312,7 +312,7 @@ void HotkeyDataViewModel::Delete(wxDataViewItem const& item) {

if (!has_pending_changes) {
has_pending_changes = true;
parent->AddPendingChange([=, this] { Apply(); });
parent->AddPendingChange([this] { Apply(); });
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,11 @@ Interface_Hotkeys::Interface_Hotkeys(wxTreebook *book, Preferences *parent)
auto delete_button = new wxButton(this, -1, _("&Delete"));

new_button->Bind(wxEVT_BUTTON, &Interface_Hotkeys::OnNewButton, this);
edit_button->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { edit_item(dvc, dvc->GetSelection()); });
delete_button->Bind(wxEVT_BUTTON, [=, this](wxCommandEvent&) { model->Delete(dvc->GetSelection()); });
edit_button->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { edit_item(dvc, dvc->GetSelection()); });
delete_button->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { model->Delete(dvc->GetSelection()); });

quick_search->Bind(wxEVT_TEXT, &Interface_Hotkeys::OnUpdateFilter, this);
quick_search->Bind(wxEVT_SEARCHCTRL_CANCEL_BTN, [=, this](wxCommandEvent&) { quick_search->SetValue(""); });
quick_search->Bind(wxEVT_SEARCHCTRL_CANCEL_BTN, [this](wxCommandEvent&) { quick_search->SetValue(""); });

dvc = new wxDataViewCtrl(this, -1);
dvc->AssociateModel(model.get());
Expand Down
6 changes: 3 additions & 3 deletions src/subs_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ SubsController::SubsController(agi::Context *context)
, autosave_queue(agi::dispatch::Create())
{
autosave_timer_changed(&autosave_timer);
OPT_SUB("App/Auto/Save", [=, this] { autosave_timer_changed(&autosave_timer); });
OPT_SUB("App/Auto/Save Every Seconds", [=, this] { autosave_timer_changed(&autosave_timer); });
autosave_timer.Bind(wxEVT_TIMER, [=, this](wxTimerEvent&) { AutoSave(); });
OPT_SUB("App/Auto/Save", [this] { autosave_timer_changed(&autosave_timer); });
OPT_SUB("App/Auto/Save Every Seconds", [this] { autosave_timer_changed(&autosave_timer); });
autosave_timer.Bind(wxEVT_TIMER, [this](wxTimerEvent&) { AutoSave(); });
}

SubsController::~SubsController() {
Expand Down
Loading

0 comments on commit 5aea50d

Please sign in to comment.