From cb5c59c86c33d9cd8128be6169f5d0e09f75c40a Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 5 Nov 2017 13:56:43 +0400 Subject: [PATCH] Fix build and crash in Xcode. --- .../common_groups/info_common_groups_inner_widget.cpp | 2 +- Telegram/SourceFiles/info/info_section_widget.cpp | 9 ++------- Telegram/SourceFiles/info/info_section_widget.h | 2 -- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp b/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp index 4ae8e1338..11b3e2c21 100644 --- a/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp +++ b/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp @@ -204,7 +204,7 @@ void InnerWidget::saveState(not_null memento) { } void InnerWidget::restoreState(not_null memento) { - _listController->restoreState(std::move(memento->listState())); + _listController->restoreState(memento->listState()); } int InnerWidget::desiredHeight() const { diff --git a/Telegram/SourceFiles/info/info_section_widget.cpp b/Telegram/SourceFiles/info/info_section_widget.cpp index 309762962..7a8d7d7b9 100644 --- a/Telegram/SourceFiles/info/info_section_widget.cpp +++ b/Telegram/SourceFiles/info/info_section_widget.cpp @@ -56,11 +56,6 @@ void SectionWidget::init() { }, _content->lifetime()); } -not_null SectionWidget::controller() const { - Expects(_content != nullptr); - return _content->controller(); -} - PeerData *SectionWidget::peerForDialogs() const { return _content->peerForDialogs(); } @@ -94,13 +89,13 @@ std::unique_ptr SectionWidget::createMemento() { object_ptr SectionWidget::moveContentToLayer( QRect bodyGeometry) { - if (controller()->wrap() != Wrap::Narrow + if (_content->controller()->wrap() != Wrap::Narrow || width() < LayerWidget::MinimalSupportedWidth()) { return nullptr; } return MoveMemento( std::move(_content)).createLayer( - controller()->window(), + controller(), bodyGeometry); } diff --git a/Telegram/SourceFiles/info/info_section_widget.h b/Telegram/SourceFiles/info/info_section_widget.h index 499fcf853..7ee9f899d 100644 --- a/Telegram/SourceFiles/info/info_section_widget.h +++ b/Telegram/SourceFiles/info/info_section_widget.h @@ -73,8 +73,6 @@ protected: private: void init(); - not_null controller() const; - object_ptr _content; };