mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Made base::lambda a copyable value type.
Now base::lambda can be copied and can wrap any immutable lambda. For mutable lambdas there is base::lambda_once (which you're supposed to call only once to pass data through lambda captures, for example by using std::unique_ptr). Generally base::lambda is passed by value and base::lambda_once is passed by rvalue reference.
This commit is contained in:
@@ -54,7 +54,7 @@ Layer::Layer()
|
||||
connect(_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
|
||||
}
|
||||
|
||||
void Layer::setCloseClickHandler(base::lambda<void()> &&callback) {
|
||||
void Layer::setCloseClickHandler(base::lambda<void()> callback) {
|
||||
_fixedBarClose->setClickedCallback(std::move(callback));
|
||||
}
|
||||
|
||||
|
@@ -51,7 +51,7 @@ class Layer : public LayerWidget {
|
||||
public:
|
||||
Layer();
|
||||
|
||||
void setCloseClickHandler(base::lambda<void()> &&callback);
|
||||
void setCloseClickHandler(base::lambda<void()> callback);
|
||||
void resizeToWidth(int newWidth, int newContentLeft);
|
||||
|
||||
protected:
|
||||
|
@@ -43,7 +43,7 @@ namespace Settings {
|
||||
namespace {
|
||||
|
||||
QString SecretText;
|
||||
QMap<QString, base::lambda_copy<void()>> Codes;
|
||||
QMap<QString, base::lambda<void()>> Codes;
|
||||
|
||||
void fillCodes() {
|
||||
Codes.insert(qsl("debugmode"), []() {
|
||||
|
Reference in New Issue
Block a user