mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
removed compat class for SignalVector
This commit is contained in:
parent
7e49371ba1
commit
89389608e9
7 changed files with 7 additions and 18 deletions
|
@ -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
|
||||||
|
|
|
@ -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));
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
TaggedUsersController::TaggedUsersController()
|
TaggedUsersController::TaggedUsersController()
|
||||||
|
: users(std::less<TaggedUser>{})
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue