update which actually let's you compile, but doesn't properly save an item after renaming it
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "NotificationController.hpp"
|
||||
#include "controllers/notifications/NotificationController.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "controllers/notifications/NotificationModel.hpp"
|
||||
@@ -33,23 +33,47 @@ void NotificationController::updateChannelNotification(
|
||||
|
||||
bool NotificationController::isChannelNotified(const QString &channelName)
|
||||
{
|
||||
for (std::vector<int>::size_type i = 0;
|
||||
i != notificationVector.getVector().size(); i++) {
|
||||
if (notificationVector.getVector()[i] == channelName) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
/*
|
||||
const auto &vector = notificationSetting_.getValue();
|
||||
return std::find(vector.begin(), vector.end(), channelName) != vector.end();
|
||||
*/
|
||||
}
|
||||
|
||||
void NotificationController::addChannelNotification(const QString &channelName)
|
||||
{
|
||||
notificationVector.appendItem(channelName);
|
||||
/*
|
||||
auto vector = notificationSetting_.getValue();
|
||||
vector.push_back(channelName);
|
||||
notificationSetting_.setValue(vector);
|
||||
*/
|
||||
}
|
||||
|
||||
void NotificationController::removeChannelNotification(
|
||||
const QString &channelName)
|
||||
{
|
||||
for (std::vector<int>::size_type i = 0;
|
||||
i != notificationVector.getVector().size(); i++) {
|
||||
if (notificationVector.getVector()[i] == channelName) {
|
||||
notificationVector.removeItem(i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
// notificationVector.removeItem(std::find(
|
||||
// notificationVector.begin(), notificationVector.end(), channelName));
|
||||
/*
|
||||
auto vector = notificationSetting_.getValue();
|
||||
vector.erase(std::find(vector.begin(), vector.end(), channelName));
|
||||
notificationSetting_.setValue(vector);
|
||||
*/
|
||||
}
|
||||
|
||||
NotificationModel *NotificationController::createModel(QObject *parent)
|
||||
|
||||
Reference in New Issue
Block a user