Skip to content

Commit

Permalink
refactor: Remove the NullablePtr class (#5091)
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada authored Jan 15, 2024
1 parent 47a14c9 commit 7f93566
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 78 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
- Dev: Fixed deadlock and use-after-free in tests. (#4981)
- Dev: Moved all `.clang-format` files to the root directory. (#5037)
- Dev: Load less message history upon reconnects. (#5001, #5018)
- Dev: Load less message history upon reconnects. (#5001)
- Dev: Removed the `NullablePtr` class. (#5091)
- Dev: BREAKING: Replace custom `import()` with normal Lua `require()`. (#5014)
- Dev: Fixed most compiler warnings. (#5028)
- Dev: Added the ability to show `ChannelView`s without a `Split`. (#4747)
Expand Down
73 changes: 0 additions & 73 deletions src/common/NullablePtr.hpp

This file was deleted.

3 changes: 1 addition & 2 deletions src/widgets/splits/Split.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ void Split::insertTextToInput(const QString &text)
void Split::showChangeChannelPopup(const char *dialogTitle, bool empty,
std::function<void(bool)> callback)
{
if (this->selectChannelDialog_.hasElement())
if (!this->selectChannelDialog_.isNull())
{
this->selectChannelDialog_->raise();

Expand All @@ -935,7 +935,6 @@ void Split::showChangeChannelPopup(const char *dialogTitle, bool empty,
}

callback(dialog->hasSeletedChannel());
this->selectChannelDialog_ = nullptr;
});
this->selectChannelDialog_ = dialog;
}
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/splits/Split.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

#include "common/Aliases.hpp"
#include "common/Channel.hpp"
#include "common/NullablePtr.hpp"
#include "widgets/BaseWidget.hpp"
#include "widgets/splits/SplitCommon.hpp"

#include <boost/signals2.hpp>
#include <pajlada/signals/signalholder.hpp>
#include <QFont>
#include <QPointer>
#include <QShortcut>
#include <QVBoxLayout>
#include <QWidget>
Expand Down Expand Up @@ -155,7 +155,7 @@ class Split : public BaseWidget
SplitInput *const input_;
SplitOverlay *const overlay_;

NullablePtr<SelectChannelDialog> selectChannelDialog_;
QPointer<SelectChannelDialog> selectChannelDialog_;

pajlada::Signals::Connection channelIDChangedConnection_;
pajlada::Signals::Connection usermodeChangedConnection_;
Expand Down

0 comments on commit 7f93566

Please sign in to comment.