diff --git a/src/common/SignalVector.hpp b/src/common/SignalVector.hpp index 7181067fb..074614d88 100644 --- a/src/common/SignalVector.hpp +++ b/src/common/SignalVector.hpp @@ -98,7 +98,7 @@ public: /// signals. int append(const T &item, void *caller = nullptr) { - return this->insertItem(item, -1, caller); + return this->insert(item, -1, caller); } void removeAt(int index, void *caller = nullptr) @@ -122,26 +122,6 @@ public: return this->items_; } - // compatability - [[deprecated("use insert")]] int insertItem(const T &item, - int proposedIndex = -1, - void *caller = nullptr) - { - return this->insert(item, proposedIndex, caller); - } - - [[deprecated("use append")]] int appendItem(const T &item, - void *caller = nullptr) - { - return this->append(item, caller); - } - - [[deprecated("use removeAt")]] void removeItem(int index, - void *caller = nullptr) - { - this->removeAt(index, caller); - } - [[deprecated]] std::vector cloneVector() { return *this->readOnly(); diff --git a/src/common/SignalVectorModel.hpp b/src/common/SignalVectorModel.hpp index a13bd97f0..76bc14b22 100644 --- a/src/common/SignalVectorModel.hpp +++ b/src/common/SignalVectorModel.hpp @@ -153,12 +153,12 @@ public: else { int vecRow = this->getVectorIndexFromModelIndex(row); - this->vector_->removeItem(vecRow, this); + this->vector_->removeAt(vecRow, this); assert(this->rows_[row].original); TVectorItem item = this->getItemFromRow( this->rows_[row].items, this->rows_[row].original.get()); - this->vector_->insertItem(item, vecRow, this); + this->vector_->insert(item, vecRow, this); } return true; @@ -225,7 +225,7 @@ public: void deleteRow(int row) { int signalVectorRow = this->getVectorIndexFromModelIndex(row); - this->vector_->removeItem(signalVectorRow); + this->vector_->removeAt(signalVectorRow); } bool removeRows(int row, int count, const QModelIndex &parent) override @@ -240,7 +240,7 @@ public: assert(row >= 0 && row < this->rows_.size()); int signalVectorRow = this->getVectorIndexFromModelIndex(row); - this->vector_->removeItem(signalVectorRow); + this->vector_->removeAt(signalVectorRow); return true; } @@ -287,8 +287,8 @@ public: if (from != to) { auto item = this->vector_->raw()[from]; - this->vector_->removeItem(from); - this->vector_->insertItem(item, to); + this->vector_->removeAt(from); + this->vector_->insert(item, to); } // We return false since we remove items ourselves. diff --git a/src/controllers/accounts/AccountController.cpp b/src/controllers/accounts/AccountController.cpp index 6d272cf0c..d44e00d5b 100644 --- a/src/controllers/accounts/AccountController.cpp +++ b/src/controllers/accounts/AccountController.cpp @@ -9,8 +9,7 @@ namespace chatterino { AccountController::AccountController() { this->twitch.accounts.itemInserted.connect([this](const auto &args) { - this->accounts_.insertItem( - std::dynamic_pointer_cast(args.item)); + this->accounts_.insert(std::dynamic_pointer_cast(args.item)); }); this->twitch.accounts.itemRemoved.connect([this](const auto &args) { @@ -20,7 +19,7 @@ AccountController::AccountController() auto it = std::find(accs.begin(), accs.end(), args.item); assert(it != accs.end()); - this->accounts_.removeItem(it - accs.begin(), this); + this->accounts_.removeAt(it - accs.begin(), this); } }); diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index 418612be7..92d89e5c2 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -222,7 +222,7 @@ void CommandController::initialize(Settings &, Paths &paths) // of commands) for (const auto &command : this->commandsSetting_->getValue()) { - this->items_.appendItem(command); + this->items_.append(command); } } diff --git a/src/controllers/ignores/IgnoreController.cpp b/src/controllers/ignores/IgnoreController.cpp index 28b511a36..0080af65c 100644 --- a/src/controllers/ignores/IgnoreController.cpp +++ b/src/controllers/ignores/IgnoreController.cpp @@ -14,7 +14,7 @@ void IgnoreController::initialize(Settings &, Paths &) for (const IgnorePhrase &phrase : this->ignoresSetting_.getValue()) { - this->phrases.appendItem(phrase); + this->phrases.append(phrase); } this->phrases.delayedItemsChanged.connect([this] { // diff --git a/src/controllers/moderationactions/ModerationActions.cpp b/src/controllers/moderationactions/ModerationActions.cpp index d13a71eab..5d2ed9dc1 100644 --- a/src/controllers/moderationactions/ModerationActions.cpp +++ b/src/controllers/moderationactions/ModerationActions.cpp @@ -23,7 +23,7 @@ void ModerationActions::initialize(Settings &settings, Paths &paths) for (auto &val : this->setting_->getValue()) { - this->items.insertItem(val); + this->items.insert(val); } this->items.delayedItemsChanged.connect([this] { // diff --git a/src/controllers/notifications/NotificationController.cpp b/src/controllers/notifications/NotificationController.cpp index 59fed3b1f..72d7b0124 100644 --- a/src/controllers/notifications/NotificationController.cpp +++ b/src/controllers/notifications/NotificationController.cpp @@ -26,12 +26,11 @@ void NotificationController::initialize(Settings &settings, Paths &paths) this->initialized_ = true; for (const QString &channelName : this->twitchSetting_.getValue()) { - this->channelMap[Platform::Twitch].appendItem(channelName); + this->channelMap[Platform::Twitch].append(channelName); } this->channelMap[Platform::Twitch].delayedItemsChanged.connect([this] { // - this->twitchSetting_.setValue( - this->channelMap[Platform::Twitch].raw()); + this->twitchSetting_.setValue(this->channelMap[Platform::Twitch].raw()); }); /* for (const QString &channelName : this->mixerSetting_.getValue()) { @@ -81,18 +80,18 @@ bool NotificationController::isChannelNotified(const QString &channelName, void NotificationController::addChannelNotification(const QString &channelName, Platform p) { - channelMap[p].appendItem(channelName); + channelMap[p].append(channelName); } void NotificationController::removeChannelNotification( const QString &channelName, Platform p) { - for (std::vector::size_type i = 0; - i != channelMap[p].raw().size(); i++) + for (std::vector::size_type i = 0; i != channelMap[p].raw().size(); + i++) { if (channelMap[p].raw()[i].toLower() == channelName.toLower()) { - channelMap[p].removeItem(i); + channelMap[p].removeAt(i); i--; } } diff --git a/src/controllers/pings/PingController.cpp b/src/controllers/pings/PingController.cpp index 36f4b08ad..db245acc2 100644 --- a/src/controllers/pings/PingController.cpp +++ b/src/controllers/pings/PingController.cpp @@ -8,7 +8,7 @@ void PingController::initialize(Settings &settings, Paths &paths) this->initialized_ = true; for (const QString &channelName : this->pingSetting_.getValue()) { - this->channelVector.appendItem(channelName); + this->channelVector.append(channelName); } this->channelVector.delayedItemsChanged.connect([this] { // @@ -37,7 +37,7 @@ bool PingController::isMuted(const QString &channelName) void PingController::muteChannel(const QString &channelName) { - channelVector.appendItem(channelName); + channelVector.append(channelName); } void PingController::unmuteChannel(const QString &channelName) @@ -47,7 +47,7 @@ void PingController::unmuteChannel(const QString &channelName) { if (channelVector.raw()[i].toLower() == channelName.toLower()) { - channelVector.removeItem(i); + channelVector.removeAt(i); i--; } } diff --git a/src/providers/irc/Irc2.cpp b/src/providers/irc/Irc2.cpp index ee59e94ce..2f685be63 100644 --- a/src/providers/irc/Irc2.cpp +++ b/src/providers/irc/Irc2.cpp @@ -252,7 +252,7 @@ void Irc::load() { ids.insert(data.id); - this->connections.appendItem(data); + this->connections.append(data); } } } diff --git a/src/providers/twitch/TwitchAccountManager.cpp b/src/providers/twitch/TwitchAccountManager.cpp index b772f2911..5369e40e4 100644 --- a/src/providers/twitch/TwitchAccountManager.cpp +++ b/src/providers/twitch/TwitchAccountManager.cpp @@ -221,7 +221,7 @@ TwitchAccountManager::AddUserResponse TwitchAccountManager::addUser( // std::lock_guard lock(this->mutex); - this->accounts.insertItem(newUser); + this->accounts.insert(newUser); return AddUserResponse::UserAdded; } diff --git a/src/widgets/dialogs/SelectChannelDialog.cpp b/src/widgets/dialogs/SelectChannelDialog.cpp index c8e21a18b..a17c7022a 100644 --- a/src/widgets/dialogs/SelectChannelDialog.cpp +++ b/src/widgets/dialogs/SelectChannelDialog.cpp @@ -152,7 +152,7 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent) auto editor = new IrcConnectionEditor(unique); if (editor->exec() == QDialog::Accepted) { - Irc::instance().connections.appendItem(editor->data()); + Irc::instance().connections.append(editor->data()); } }); @@ -171,9 +171,9 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent) { if (conn.id == data.id) { - Irc::instance().connections.removeItem( + Irc::instance().connections.removeAt( i, Irc::noEraseCredentialCaller); - Irc::instance().connections.insertItem(data, i); + Irc::instance().connections.insert(data, i); } i++; } diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index bb75a61fb..e54a4373a 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -336,7 +336,7 @@ void UserInfoPopup::installEvents() if (checked) { - getApp()->highlights->blacklistedUsers.insertItem( + getApp()->highlights->blacklistedUsers.insert( HighlightBlacklistUser{this->userName_, false}); this->ui_.ignoreHighlights->setEnabled(true); } @@ -349,7 +349,7 @@ void UserInfoPopup::installEvents() { if (this->userName_ == vector[i].getPattern()) { - getApp()->highlights->blacklistedUsers.removeItem(i); + getApp()->highlights->blacklistedUsers.removeAt(i); i--; } } diff --git a/src/widgets/settingspages/CommandPage.cpp b/src/widgets/settingspages/CommandPage.cpp index 99b83ec90..7dc72c55f 100644 --- a/src/widgets/settingspages/CommandPage.cpp +++ b/src/widgets/settingspages/CommandPage.cpp @@ -46,7 +46,7 @@ CommandPage::CommandPage() view->setTitles({"Trigger", "Command"}); view->getTableView()->horizontalHeader()->setStretchLastSection(true); view->addButtonPressed.connect([] { - getApp()->commands->items_.appendItem( + getApp()->commands->items_.append( Command{"/command", "I made a new command HeyGuys"}); }); @@ -65,7 +65,7 @@ CommandPage::CommandPage() { if (int index = line.indexOf(' '); index != -1) { - getApp()->commands->items_.insertItem( + getApp()->commands->items_.insert( Command(line.mid(0, index), line.mid(index + 1))); } } diff --git a/src/widgets/settingspages/HighlightingPage.cpp b/src/widgets/settingspages/HighlightingPage.cpp index 9b8d1af94..fb2d7da01 100644 --- a/src/widgets/settingspages/HighlightingPage.cpp +++ b/src/widgets/settingspages/HighlightingPage.cpp @@ -72,7 +72,7 @@ HighlightingPage::HighlightingPage() }); view->addButtonPressed.connect([] { - getApp()->highlights->phrases.appendItem(HighlightPhrase{ + getApp()->highlights->phrases.append(HighlightPhrase{ "my phrase", true, false, false, false, "", *ColorProvider::instance().color( ColorType::SelfHighlight)}); @@ -120,7 +120,7 @@ HighlightingPage::HighlightingPage() }); view->addButtonPressed.connect([] { - getApp()->highlights->highlightedUsers.appendItem( + getApp()->highlights->highlightedUsers.append( HighlightPhrase{"highlighted user", true, false, false, false, "", *ColorProvider::instance().color( @@ -162,7 +162,7 @@ HighlightingPage::HighlightingPage() }); view->addButtonPressed.connect([] { - getApp()->highlights->blacklistedUsers.appendItem( + getApp()->highlights->blacklistedUsers.append( HighlightBlacklistUser{"blacklisted user", false}); }); } diff --git a/src/widgets/settingspages/IgnoresPage.cpp b/src/widgets/settingspages/IgnoresPage.cpp index 9cc657880..773fdea33 100644 --- a/src/widgets/settingspages/IgnoresPage.cpp +++ b/src/widgets/settingspages/IgnoresPage.cpp @@ -60,7 +60,7 @@ void addPhrasesTab(LayoutCreator layout) }); view->addButtonPressed.connect([] { - getApp()->ignores->phrases.appendItem( + getApp()->ignores->phrases.append( IgnorePhrase{"my pattern", false, false, getSettings()->ignoredPhraseReplace.getValue(), true}); }); diff --git a/src/widgets/settingspages/ModerationPage.cpp b/src/widgets/settingspages/ModerationPage.cpp index 479d0a7cb..87e3a5e5d 100644 --- a/src/widgets/settingspages/ModerationPage.cpp +++ b/src/widgets/settingspages/ModerationPage.cpp @@ -184,7 +184,7 @@ ModerationPage::ModerationPage() 0, QHeaderView::Stretch); view->addButtonPressed.connect([] { - getApp()->moderationActions->items.appendItem( + getApp()->moderationActions->items.append( ModerationAction("/timeout {user} 300")); }); diff --git a/src/widgets/settingspages/NotificationPage.cpp b/src/widgets/settingspages/NotificationPage.cpp index 27c1da4b5..b14af27fc 100644 --- a/src/widgets/settingspages/NotificationPage.cpp +++ b/src/widgets/settingspages/NotificationPage.cpp @@ -100,7 +100,7 @@ NotificationPage::NotificationPage() view->addButtonPressed.connect([] { getApp() ->notifications->channelMap[Platform::Twitch] - .appendItem("channel"); + .append("channel"); }); } /*