mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Use base::weak_qptr / base::make_weak.
This commit is contained in:
@@ -307,7 +307,7 @@ object_ptr<BoxContent> EditSkipTranslationLanguages() {
|
||||
auto title = tr::lng_translate_settings_choose();
|
||||
const auto selected = std::make_shared<std::vector<LanguageId>>(
|
||||
Core::App().settings().skipTranslationLanguages());
|
||||
const auto weak = std::make_shared<QPointer<BoxContent>>();
|
||||
const auto weak = std::make_shared<base::weak_qptr<BoxContent>>();
|
||||
const auto check = [=](LanguageId id) {
|
||||
const auto already = ranges::contains(*selected, id);
|
||||
if (already) {
|
||||
@@ -316,7 +316,7 @@ object_ptr<BoxContent> EditSkipTranslationLanguages() {
|
||||
selected->push_back(id);
|
||||
}
|
||||
if (already && selected->empty()) {
|
||||
if (const auto strong = weak->data()) {
|
||||
if (const auto strong = weak->get()) {
|
||||
strong->showToast(
|
||||
tr::lng_translate_settings_one(tr::now),
|
||||
kSkipAtLeastOneDuration);
|
||||
|
||||
Reference in New Issue
Block a user