removed compat class for SignalVector

This commit is contained in:
fourtf 2020-02-23 19:49:45 +01:00
parent 7e49371ba1
commit 89389608e9
7 changed files with 7 additions and 18 deletions

View file

@ -171,15 +171,4 @@ private:
std::function<bool(const T &, const T &)> itemCompare_; std::function<bool(const T &, const T &)> itemCompare_;
}; };
// compatability
template <typename T, typename Compare>
class SortedSignalVector : public SignalVector<T>
{
public:
SortedSignalVector()
: SignalVector<T>(Compare{})
{
}
};
} // namespace chatterino } // namespace chatterino

View file

@ -7,6 +7,7 @@
namespace chatterino { namespace chatterino {
AccountController::AccountController() AccountController::AccountController()
: accounts_(SharedPtrElementLess<Account>{})
{ {
this->twitch.accounts.itemInserted.connect([this](const auto &args) { this->twitch.accounts.itemInserted.connect([this](const auto &args) {
this->accounts_.insert(std::dynamic_pointer_cast<Account>(args.item)); this->accounts_.insert(std::dynamic_pointer_cast<Account>(args.item));

View file

@ -27,8 +27,7 @@ public:
TwitchAccountManager twitch; TwitchAccountManager twitch;
private: private:
SortedSignalVector<std::shared_ptr<Account>, SharedPtrElementLess<Account>> SignalVector<std::shared_ptr<Account>> accounts_;
accounts_;
}; };
} // namespace chatterino } // namespace chatterino

View file

@ -5,6 +5,7 @@
namespace chatterino { namespace chatterino {
TaggedUsersController::TaggedUsersController() TaggedUsersController::TaggedUsersController()
: users(std::less<TaggedUser>{})
{ {
} }

View file

@ -14,7 +14,7 @@ class TaggedUsersController final : public Singleton
public: public:
TaggedUsersController(); TaggedUsersController();
SortedSignalVector<TaggedUser, std::less<TaggedUser>> users; SignalVector<TaggedUser> users;
TaggedUsersModel *createModel(QObject *parent = nullptr); TaggedUsersModel *createModel(QObject *parent = nullptr);
}; };

View file

@ -7,7 +7,8 @@
namespace chatterino { namespace chatterino {
TwitchAccountManager::TwitchAccountManager() TwitchAccountManager::TwitchAccountManager()
: anonymousUser_(new TwitchAccount(ANONYMOUS_USERNAME, "", "", "")) : accounts(SharedPtrElementLess<TwitchAccount>{})
, anonymousUser_(new TwitchAccount(ANONYMOUS_USERNAME, "", "", ""))
{ {
this->currentUserChanged.connect([this] { this->currentUserChanged.connect([this] {
auto currentUser = this->getCurrent(); auto currentUser = this->getCurrent();

View file

@ -51,9 +51,7 @@ public:
pajlada::Signals::NoArgSignal currentUserChanged; pajlada::Signals::NoArgSignal currentUserChanged;
pajlada::Signals::NoArgSignal userListUpdated; pajlada::Signals::NoArgSignal userListUpdated;
SortedSignalVector<std::shared_ptr<TwitchAccount>, SignalVector<std::shared_ptr<TwitchAccount>> accounts;
SharedPtrElementLess<TwitchAccount>>
accounts;
private: private:
enum class AddUserResponse { enum class AddUserResponse {