mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Replace gsl::not_null<T*> with just not_null<T*>.
This commit is contained in:
@@ -37,10 +37,10 @@ namespace InlineBots {
|
||||
namespace Layout {
|
||||
namespace internal {
|
||||
|
||||
FileBase::FileBase(gsl::not_null<Context*> context, Result *result) : ItemBase(context, result) {
|
||||
FileBase::FileBase(not_null<Context*> context, Result *result) : ItemBase(context, result) {
|
||||
}
|
||||
|
||||
FileBase::FileBase(gsl::not_null<Context*> context, DocumentData *document) : ItemBase(context, document) {
|
||||
FileBase::FileBase(not_null<Context*> context, DocumentData *document) : ItemBase(context, document) {
|
||||
}
|
||||
|
||||
DocumentData *FileBase::getShownDocument() const {
|
||||
@@ -94,10 +94,10 @@ ImagePtr FileBase::content_thumb() const {
|
||||
return getResultThumb();
|
||||
}
|
||||
|
||||
Gif::Gif(gsl::not_null<Context*> context, Result *result) : FileBase(context, result) {
|
||||
Gif::Gif(not_null<Context*> context, Result *result) : FileBase(context, result) {
|
||||
}
|
||||
|
||||
Gif::Gif(gsl::not_null<Context*> context, DocumentData *document, bool hasDeleteButton) : FileBase(context, document) {
|
||||
Gif::Gif(not_null<Context*> context, DocumentData *document, bool hasDeleteButton) : FileBase(context, document) {
|
||||
if (hasDeleteButton) {
|
||||
_delete = MakeShared<DeleteSavedGifClickHandler>(document);
|
||||
}
|
||||
@@ -358,7 +358,7 @@ void Gif::clipCallback(Media::Clip::Notification notification) {
|
||||
}
|
||||
}
|
||||
|
||||
Sticker::Sticker(gsl::not_null<Context*> context, Result *result) : FileBase(context, result) {
|
||||
Sticker::Sticker(not_null<Context*> context, Result *result) : FileBase(context, result) {
|
||||
}
|
||||
|
||||
void Sticker::initDimensions() {
|
||||
@@ -458,7 +458,7 @@ void Sticker::prepareThumb() const {
|
||||
}
|
||||
}
|
||||
|
||||
Photo::Photo(gsl::not_null<Context*> context, Result *result) : ItemBase(context, result) {
|
||||
Photo::Photo(not_null<Context*> context, Result *result) : ItemBase(context, result) {
|
||||
}
|
||||
|
||||
void Photo::initDimensions() {
|
||||
@@ -554,7 +554,7 @@ void Photo::prepareThumb(int32 width, int32 height, const QSize &frame) const {
|
||||
}
|
||||
}
|
||||
|
||||
Video::Video(gsl::not_null<Context*> context, Result *result) : FileBase(context, result)
|
||||
Video::Video(not_null<Context*> context, Result *result) : FileBase(context, result)
|
||||
, _link(getResultContentUrlHandler())
|
||||
, _title(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip)
|
||||
, _description(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip) {
|
||||
@@ -671,7 +671,7 @@ void CancelFileClickHandler::onClickImpl() const {
|
||||
_result->cancelFile();
|
||||
}
|
||||
|
||||
File::File(gsl::not_null<Context*> context, Result *result) : FileBase(context, result)
|
||||
File::File(not_null<Context*> context, Result *result) : FileBase(context, result)
|
||||
, _title(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::msgFileSize - st::inlineThumbSkip)
|
||||
, _description(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::msgFileSize - st::inlineThumbSkip)
|
||||
, _open(MakeShared<OpenFileClickHandler>(result))
|
||||
@@ -881,7 +881,7 @@ void File::setStatusSize(int32 newSize, int32 fullSize, int32 duration, qint64 r
|
||||
}
|
||||
}
|
||||
|
||||
Contact::Contact(gsl::not_null<Context*> context, Result *result) : ItemBase(context, result)
|
||||
Contact::Contact(not_null<Context*> context, Result *result) : ItemBase(context, result)
|
||||
, _title(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip)
|
||||
, _description(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip) {
|
||||
}
|
||||
@@ -970,7 +970,7 @@ void Contact::prepareThumb(int width, int height) const {
|
||||
}
|
||||
}
|
||||
|
||||
Article::Article(gsl::not_null<Context*> context, Result *result, bool withThumb) : ItemBase(context, result)
|
||||
Article::Article(not_null<Context*> context, Result *result, bool withThumb) : ItemBase(context, result)
|
||||
, _url(getResultUrlHandler())
|
||||
, _link(getResultContentUrlHandler())
|
||||
, _withThumb(withThumb)
|
||||
@@ -1117,7 +1117,7 @@ void Article::prepareThumb(int width, int height) const {
|
||||
}
|
||||
}
|
||||
|
||||
Game::Game(gsl::not_null<Context*> context, Result *result) : ItemBase(context, result)
|
||||
Game::Game(not_null<Context*> context, Result *result) : ItemBase(context, result)
|
||||
, _title(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip)
|
||||
, _description(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip) {
|
||||
countFrameSize();
|
||||
|
@@ -30,9 +30,9 @@ namespace internal {
|
||||
|
||||
class FileBase : public ItemBase {
|
||||
public:
|
||||
FileBase(gsl::not_null<Context*> context, Result *result);
|
||||
FileBase(not_null<Context*> context, Result *result);
|
||||
// for saved gif layouts
|
||||
FileBase(gsl::not_null<Context*> context, DocumentData *doc);
|
||||
FileBase(not_null<Context*> context, DocumentData *doc);
|
||||
|
||||
protected:
|
||||
DocumentData *getShownDocument() const;
|
||||
@@ -58,8 +58,8 @@ private:
|
||||
|
||||
class Gif : public FileBase {
|
||||
public:
|
||||
Gif(gsl::not_null<Context*> context, Result *result);
|
||||
Gif(gsl::not_null<Context*> context, DocumentData *doc, bool hasDeleteButton);
|
||||
Gif(not_null<Context*> context, Result *result);
|
||||
Gif(not_null<Context*> context, DocumentData *doc, bool hasDeleteButton);
|
||||
|
||||
void setPosition(int32 position) override;
|
||||
void initDimensions() override;
|
||||
@@ -117,9 +117,9 @@ private:
|
||||
|
||||
class Photo : public ItemBase {
|
||||
public:
|
||||
Photo(gsl::not_null<Context*> context, Result *result);
|
||||
Photo(not_null<Context*> context, Result *result);
|
||||
// Not used anywhere currently.
|
||||
//Photo(gsl::not_null<Context*> context, PhotoData *photo);
|
||||
//Photo(not_null<Context*> context, PhotoData *photo);
|
||||
|
||||
void initDimensions() override;
|
||||
|
||||
@@ -146,9 +146,9 @@ private:
|
||||
|
||||
class Sticker : public FileBase {
|
||||
public:
|
||||
Sticker(gsl::not_null<Context*> context, Result *result);
|
||||
Sticker(not_null<Context*> context, Result *result);
|
||||
// Not used anywhere currently.
|
||||
//Sticker(gsl::not_null<Context*> context, DocumentData *document);
|
||||
//Sticker(not_null<Context*> context, DocumentData *document);
|
||||
|
||||
void initDimensions() override;
|
||||
|
||||
@@ -180,7 +180,7 @@ private:
|
||||
|
||||
class Video : public FileBase {
|
||||
public:
|
||||
Video(gsl::not_null<Context*> context, Result *result);
|
||||
Video(not_null<Context*> context, Result *result);
|
||||
|
||||
void initDimensions() override;
|
||||
|
||||
@@ -227,7 +227,7 @@ private:
|
||||
|
||||
class File : public FileBase {
|
||||
public:
|
||||
File(gsl::not_null<Context*> context, Result *result);
|
||||
File(not_null<Context*> context, Result *result);
|
||||
|
||||
void initDimensions() override;
|
||||
|
||||
@@ -289,7 +289,7 @@ private:
|
||||
|
||||
class Contact : public ItemBase {
|
||||
public:
|
||||
Contact(gsl::not_null<Context*> context, Result *result);
|
||||
Contact(not_null<Context*> context, Result *result);
|
||||
|
||||
void initDimensions() override;
|
||||
int resizeGetHeight(int width) override;
|
||||
@@ -307,7 +307,7 @@ private:
|
||||
|
||||
class Article : public ItemBase {
|
||||
public:
|
||||
Article(gsl::not_null<Context*> context, Result *result, bool withThumb);
|
||||
Article(not_null<Context*> context, Result *result, bool withThumb);
|
||||
|
||||
void initDimensions() override;
|
||||
int resizeGetHeight(int width) override;
|
||||
@@ -330,7 +330,7 @@ private:
|
||||
|
||||
class Game : public ItemBase {
|
||||
public:
|
||||
Game(gsl::not_null<Context*> context, Result *result);
|
||||
Game(not_null<Context*> context, Result *result);
|
||||
|
||||
void setPosition(int32 position) override;
|
||||
void initDimensions() override;
|
||||
|
@@ -105,7 +105,7 @@ void ItemBase::layoutChanged() {
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<ItemBase> ItemBase::createLayout(gsl::not_null<Context*> context, Result *result, bool forceThumb) {
|
||||
std::unique_ptr<ItemBase> ItemBase::createLayout(not_null<Context*> context, Result *result, bool forceThumb) {
|
||||
using Type = Result::Type;
|
||||
|
||||
switch (result->_type) {
|
||||
@@ -124,7 +124,7 @@ std::unique_ptr<ItemBase> ItemBase::createLayout(gsl::not_null<Context*> context
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<ItemBase> ItemBase::createLayoutGif(gsl::not_null<Context*> context, DocumentData *document) {
|
||||
std::unique_ptr<ItemBase> ItemBase::createLayoutGif(not_null<Context*> context, DocumentData *document) {
|
||||
return std::make_unique<internal::Gif>(context, document, true);
|
||||
}
|
||||
|
||||
|
@@ -56,12 +56,12 @@ public:
|
||||
|
||||
class ItemBase : public LayoutItemBase {
|
||||
public:
|
||||
ItemBase(gsl::not_null<Context*> context, Result *result) : _result(result), _context(context) {
|
||||
ItemBase(not_null<Context*> context, Result *result) : _result(result), _context(context) {
|
||||
}
|
||||
ItemBase(gsl::not_null<Context*> context, DocumentData *doc) : _doc(doc), _context(context) {
|
||||
ItemBase(not_null<Context*> context, DocumentData *doc) : _doc(doc), _context(context) {
|
||||
}
|
||||
// Not used anywhere currently.
|
||||
//ItemBase(gsl::not_null<Context*> context, PhotoData *photo) : _photo(photo), _context(context) {
|
||||
//ItemBase(not_null<Context*> context, PhotoData *photo) : _photo(photo), _context(context) {
|
||||
//}
|
||||
|
||||
virtual void paint(Painter &p, const QRect &clip, const PaintContext *context) const = 0;
|
||||
@@ -98,8 +98,8 @@ public:
|
||||
update();
|
||||
}
|
||||
|
||||
static std::unique_ptr<ItemBase> createLayout(gsl::not_null<Context*> context, Result *result, bool forceThumb);
|
||||
static std::unique_ptr<ItemBase> createLayoutGif(gsl::not_null<Context*> context, DocumentData *document);
|
||||
static std::unique_ptr<ItemBase> createLayout(not_null<Context*> context, Result *result, bool forceThumb);
|
||||
static std::unique_ptr<ItemBase> createLayoutGif(not_null<Context*> context, DocumentData *document);
|
||||
|
||||
protected:
|
||||
DocumentData *getResultDocument() const;
|
||||
@@ -112,7 +112,7 @@ protected:
|
||||
ClickHandlerPtr getResultContentUrlHandler() const;
|
||||
QString getResultThumbLetter() const;
|
||||
|
||||
gsl::not_null<Context*> context() const {
|
||||
not_null<Context*> context() const {
|
||||
return _context;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ protected:
|
||||
int _position = 0; // < 0 means removed from layout
|
||||
|
||||
private:
|
||||
gsl::not_null<Context*> _context;
|
||||
not_null<Context*> _context;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -48,7 +48,7 @@ constexpr auto kInlineBotRequestDelay = 400;
|
||||
|
||||
} // namespace
|
||||
|
||||
Inner::Inner(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
|
||||
Inner::Inner(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
|
||||
, _controller(controller) {
|
||||
resize(st::emojiPanWidth - st::emojiScroll.width - st::buttonRadius, st::emojiPanMinHeight);
|
||||
|
||||
@@ -711,7 +711,7 @@ void Inner::onSwitchPm() {
|
||||
|
||||
} // namespace internal
|
||||
|
||||
Widget::Widget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
|
||||
Widget::Widget(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
|
||||
, _controller(controller)
|
||||
, _contentMaxHeight(st::emojiPanMaxHeight)
|
||||
, _contentHeight(_contentMaxHeight)
|
||||
|
@@ -63,7 +63,7 @@ class Inner : public TWidget, public Context, private base::Subscriber {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Inner(QWidget *parent, gsl::not_null<Window::Controller*> controller);
|
||||
Inner(QWidget *parent, not_null<Window::Controller*> controller);
|
||||
|
||||
void hideFinish(bool completely);
|
||||
|
||||
@@ -118,7 +118,7 @@ private:
|
||||
|
||||
void refreshSwitchPmButton(const CacheEntry *entry);
|
||||
|
||||
gsl::not_null<Window::Controller*> _controller;
|
||||
not_null<Window::Controller*> _controller;
|
||||
|
||||
int _visibleTop = 0;
|
||||
int _visibleBottom = 0;
|
||||
@@ -170,7 +170,7 @@ class Widget : public TWidget, private MTP::Sender {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Widget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
|
||||
Widget(QWidget *parent, not_null<Window::Controller*> controller);
|
||||
|
||||
void moveBottom(int bottom);
|
||||
|
||||
@@ -240,7 +240,7 @@ private:
|
||||
bool refreshInlineRows(int *added = nullptr);
|
||||
void inlineResultsDone(const MTPmessages_BotResults &result);
|
||||
|
||||
gsl::not_null<Window::Controller*> _controller;
|
||||
not_null<Window::Controller*> _controller;
|
||||
|
||||
int _contentMaxHeight = 0;
|
||||
int _contentHeight = 0;
|
||||
|
Reference in New Issue
Block a user