2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 00:55:12 +00:00

Replace gsl::not_null<T*> with just not_null<T*>.

This commit is contained in:
John Preston
2017-08-17 11:31:24 +03:00
parent cc4023d26a
commit b3da99c302
148 changed files with 966 additions and 963 deletions

View File

@@ -243,13 +243,13 @@ void BoxController::refreshAbout() {
setDescriptionText(delegate()->peerListFullRowsCount() ? QString() : lang(lng_call_box_about));
}
void BoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
void BoxController::rowClicked(not_null<PeerListRow*> row) {
auto itemsRow = static_cast<Row*>(row.get());
auto itemId = itemsRow->maxItemId();
Ui::showPeerHistoryAsync(row->peer()->id, itemId);
}
void BoxController::rowActionClicked(gsl::not_null<PeerListRow*> row) {
void BoxController::rowActionClicked(not_null<PeerListRow*> row) {
auto user = row->peer()->asUser();
t_assert(user != nullptr);

View File

@@ -27,8 +27,8 @@ namespace Calls {
class BoxController : public PeerListController, private base::Subscriber, private MTP::Sender {
public:
void prepare() override;
void rowClicked(gsl::not_null<PeerListRow*> row) override;
void rowActionClicked(gsl::not_null<PeerListRow*> row) override;
void rowClicked(not_null<PeerListRow*> row) override;
void rowActionClicked(not_null<PeerListRow*> row) override;
void loadMoreRows() override;
private:

View File

@@ -77,7 +77,7 @@ uint64 ComputeFingerprint(const std::array<gsl::byte, kFingerprintDataSize> &aut
} // namespace
Call::Call(gsl::not_null<Delegate*> delegate, gsl::not_null<UserData*> user, Type type)
Call::Call(not_null<Delegate*> delegate, not_null<UserData*> user, Type type)
: _delegate(delegate)
, _user(user)
, _type(type) {

View File

@@ -48,9 +48,9 @@ public:
class Delegate {
public:
virtual DhConfig getDhConfig() const = 0;
virtual void callFinished(gsl::not_null<Call*> call) = 0;
virtual void callFailed(gsl::not_null<Call*> call) = 0;
virtual void callRedial(gsl::not_null<Call*> call) = 0;
virtual void callFinished(not_null<Call*> call) = 0;
virtual void callFailed(not_null<Call*> call) = 0;
virtual void callRedial(not_null<Call*> call) = 0;
enum class Sound {
Connecting,
@@ -69,12 +69,12 @@ public:
Incoming,
Outgoing,
};
Call(gsl::not_null<Delegate*> delegate, gsl::not_null<UserData*> user, Type type);
Call(not_null<Delegate*> delegate, not_null<UserData*> user, Type type);
Type type() const {
return _type;
}
gsl::not_null<UserData*> user() const {
not_null<UserData*> user() const {
return _user;
}
bool isIncomingWaiting() const;
@@ -157,8 +157,8 @@ private:
void setFailedQueued(int error);
void destroyController();
gsl::not_null<Delegate*> _delegate;
gsl::not_null<UserData*> _user;
not_null<Delegate*> _delegate;
not_null<UserData*> _user;
Type _type = Type::Outgoing;
State _state = State::Starting;
FinishType _finishAfterRequestingCall = FinishType::None;

View File

@@ -126,7 +126,7 @@ uint64 ComputeEmojiIndex(base::const_byte_span bytes) {
} // namespace
std::vector<EmojiPtr> ComputeEmojiFingerprint(gsl::not_null<Call*> call) {
std::vector<EmojiPtr> ComputeEmojiFingerprint(not_null<Call*> call) {
auto result = std::vector<EmojiPtr>();
constexpr auto EmojiCount = (base::array_size(Offsets) - 1);
for (auto index = 0; index != EmojiCount; ++index) {

View File

@@ -24,6 +24,6 @@ namespace Calls {
class Call;
std::vector<EmojiPtr> ComputeEmojiFingerprint(gsl::not_null<Call*> call);
std::vector<EmojiPtr> ComputeEmojiFingerprint(not_null<Call*> call);
} // namespace Calls

View File

@@ -40,7 +40,7 @@ constexpr auto kServerConfigUpdateTimeoutMs = 24 * 3600 * TimeMs(1000);
Instance::Instance() = default;
void Instance::startOutgoingCall(gsl::not_null<UserData*> user) {
void Instance::startOutgoingCall(not_null<UserData*> user) {
if (alreadyInCall()) { // Already in a call.
_currentCallPanel->showAndActivate();
return;
@@ -54,15 +54,15 @@ void Instance::startOutgoingCall(gsl::not_null<UserData*> user) {
createCall(user, Call::Type::Outgoing);
}
void Instance::callFinished(gsl::not_null<Call*> call) {
void Instance::callFinished(not_null<Call*> call) {
destroyCall(call);
}
void Instance::callFailed(gsl::not_null<Call*> call) {
void Instance::callFailed(not_null<Call*> call) {
destroyCall(call);
}
void Instance::callRedial(gsl::not_null<Call*> call) {
void Instance::callRedial(not_null<Call*> call) {
if (_currentCall.get() == call) {
refreshDhConfig();
}
@@ -96,7 +96,7 @@ void Instance::playSound(Sound sound) {
}
}
void Instance::destroyCall(gsl::not_null<Call*> call) {
void Instance::destroyCall(not_null<Call*> call) {
if (_currentCall.get() == call) {
destroyCurrentPanel();
_currentCall.reset();
@@ -117,7 +117,7 @@ void Instance::destroyCurrentPanel() {
_pendingPanels.back()->hideAndDestroy(); // Always queues the destruction.
}
void Instance::createCall(gsl::not_null<UserData*> user, Call::Type type) {
void Instance::createCall(not_null<UserData*> user, Call::Type type) {
auto call = std::make_unique<Call>(getCallDelegate(), user, type);;
if (_currentCall) {
_currentCallPanel->replaceCall(call.get());
@@ -246,7 +246,7 @@ void Instance::handleUpdate(const MTPDupdatePhoneCall& update) {
handleCallUpdate(update.vphone_call);
}
void Instance::showInfoPanel(gsl::not_null<Call*> call) {
void Instance::showInfoPanel(not_null<Call*> call) {
if (_currentCall.get() == call) {
_currentCallPanel->showAndActivate();
}

View File

@@ -37,9 +37,9 @@ class Instance : private MTP::Sender, private Call::Delegate, private base::Subs
public:
Instance();
void startOutgoingCall(gsl::not_null<UserData*> user);
void startOutgoingCall(not_null<UserData*> user);
void handleUpdate(const MTPDupdatePhoneCall &update);
void showInfoPanel(gsl::not_null<Call*> call);
void showInfoPanel(not_null<Call*> call);
base::Observable<Call*> &currentCallChanged() {
return _currentCallChanged;
@@ -54,19 +54,19 @@ public:
~Instance();
private:
gsl::not_null<Call::Delegate*> getCallDelegate() {
not_null<Call::Delegate*> getCallDelegate() {
return static_cast<Call::Delegate*>(this);
}
DhConfig getDhConfig() const override {
return _dhConfig;
}
void callFinished(gsl::not_null<Call*> call) override;
void callFailed(gsl::not_null<Call*> call) override;
void callRedial(gsl::not_null<Call*> call) override;
void callFinished(not_null<Call*> call) override;
void callFailed(not_null<Call*> call) override;
void callRedial(not_null<Call*> call) override;
using Sound = Call::Delegate::Sound;
void playSound(Sound sound) override;
void createCall(gsl::not_null<UserData*> user, Call::Type type);
void destroyCall(gsl::not_null<Call*> call);
void createCall(not_null<UserData*> user, Call::Type type);
void destroyCall(not_null<Call*> call);
void destroyCurrentPanel();
void refreshDhConfig();

View File

@@ -61,10 +61,10 @@ protected:
QPoint prepareRippleStartPosition() const override;
private:
QPoint iconPosition(gsl::not_null<const style::CallButton*> st) const;
QPoint iconPosition(not_null<const style::CallButton*> st) const;
void mixIconMasks();
gsl::not_null<const style::CallButton*> _stFrom;
not_null<const style::CallButton*> _stFrom;
const style::CallButton *_stTo = nullptr;
float64 _progress = 0.;
@@ -192,7 +192,7 @@ void Panel::Button::paintEvent(QPaintEvent *e) {
}
}
QPoint Panel::Button::iconPosition(gsl::not_null<const style::CallButton*> st) const {
QPoint Panel::Button::iconPosition(not_null<const style::CallButton*> st) const {
auto result = st->button.iconPosition;
if (result.x() < 0) {
result.setX((width() - st->button.icon.width()) / 2);
@@ -240,7 +240,7 @@ QImage Panel::Button::prepareRippleMask() const {
return Ui::RippleAnimation::ellipseMask(QSize(_stFrom->button.rippleAreaSize, _stFrom->button.rippleAreaSize));
}
Panel::Panel(gsl::not_null<Call*> call)
Panel::Panel(not_null<Call*> call)
: _call(call)
, _user(call->user())
, _answerHangupRedial(this, st::callAnswer, &st::callHangup)
@@ -264,7 +264,7 @@ void Panel::showAndActivate() {
setFocus();
}
void Panel::replaceCall(gsl::not_null<Call*> call) {
void Panel::replaceCall(not_null<Call*> call) {
_call = call;
_user = call->user();
reinitControls();

View File

@@ -36,10 +36,10 @@ namespace Calls {
class Panel : public TWidget, private base::Subscriber, private Ui::AbstractTooltipShower {
public:
Panel(gsl::not_null<Call*> call);
Panel(not_null<Call*> call);
void showAndActivate();
void replaceCall(gsl::not_null<Call*> call);
void replaceCall(not_null<Call*> call);
void hideAndDestroy();
protected:
@@ -89,7 +89,7 @@ private:
void destroyDelayed();
Call *_call = nullptr;
gsl::not_null<UserData*> _user;
not_null<UserData*> _user;
bool _useTransparency = true;
style::margins _padding;