If you don't assign the callback, it won't be called

This commit is contained in:
Tamás Bálint Misius 2019-12-17 10:49:35 +01:00
parent 7629c98f22
commit a43463b137
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
4 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@
#include "lua/CommandInterface.h"
ConsoleController::ConsoleController(std::function<void ()> onDone, CommandInterface * commandInterface):
ConsoleController::ConsoleController(std::function<void ()> onDone_, CommandInterface * commandInterface):
HasDone(false)
{
consoleModel = new ConsoleModel();
@ -15,7 +15,7 @@ ConsoleController::ConsoleController(std::function<void ()> onDone, CommandInter
consoleView->AttachController(this);
consoleModel->AddObserver(consoleView);
this->onDone = onDone;
onDone = onDone_;
this->commandInterface = commandInterface;
}

View File

@ -34,7 +34,7 @@ SearchController::SearchController(std::function<void ()> onDone_):
searchModel->UpdateSaveList(1, "");
onDone = onDone;
onDone = onDone_;
}
SaveInfo * SearchController::GetLoadedSave()

View File

@ -438,7 +438,7 @@ void SearchView::NotifyTagListChanged(SearchModel * sender)
ui::Point(tagWidth, tagHeight),
tag.first.FromUtf8()
);
tagButton->SetActionCallback({ [this, &tag] {
tagButton->SetActionCallback({ [this, tag] {
Search(tag.first.FromUtf8());
} });
tagButton->Appearance.BorderInactive = ui::Colour(0, 0, 0);

View File

@ -83,7 +83,7 @@ void TagsView::NotifyTagsChanged(TagsModel * sender)
tempButton->Appearance.Margin.Top += 2;
tempButton->Appearance.HorizontalAlign = ui::Appearance::AlignCentre;
tempButton->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
tempButton->SetActionCallback({ [this, &tag] { c->RemoveTag(tag); } });
tempButton->SetActionCallback({ [this, tag] { c->RemoveTag(tag); } });
tags.push_back(tempButton);
AddComponent(tempButton);
}