refactored IgnoredController
This commit is contained in:
@@ -1,26 +1,10 @@
|
||||
#include "HighlightController.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "common/ChatterinoSetting.hpp"
|
||||
#include "util/PersistSignalVector.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
template <typename T>
|
||||
inline void persist(SignalVector<T> &vec, const std::string &name)
|
||||
{
|
||||
auto setting = std::make_unique<ChatterinoSetting<std::vector<T>>>(name);
|
||||
|
||||
for (auto &&item : setting->getValue())
|
||||
vec.append(item);
|
||||
|
||||
vec.delayedItemsChanged.connect([setting = setting.get(), vec = &vec] {
|
||||
setting->setValue(vec->raw());
|
||||
});
|
||||
|
||||
// TODO: Delete when appropriate.
|
||||
setting.release();
|
||||
}
|
||||
|
||||
void HighlightController::initialize(Settings &settings, Paths &paths)
|
||||
{
|
||||
assert(!this->initialized_);
|
||||
|
||||
Reference in New Issue
Block a user