Index: compiled/subscription/UserDefinedSubscription.cpp |
=================================================================== |
--- a/compiled/subscription/UserDefinedSubscription.cpp |
+++ b/compiled/subscription/UserDefinedSubscription.cpp |
@@ -38,16 +38,33 @@ bool UserDefinedSubscription::IsDefaultF |
return mDefaults & filterTypeToDefaults[filter->mType]; |
} |
void UserDefinedSubscription::MakeDefaultFor(const Filter* filter) |
{ |
mDefaults |= filterTypeToDefaults[filter->mType]; |
} |
+void UserDefinedSubscription::InsertFilterAt(Filter* filter, unsigned pos) |
+{ |
+ if (pos >= mFilters.size()) |
+ mFilters.emplace_back(filter); |
+ else |
+ mFilters.emplace(mFilters.begin() + pos, filter); |
+} |
+ |
+bool UserDefinedSubscription::RemoveFilterAt(unsigned pos) |
+{ |
+ if (pos >= mFilters.size()) |
+ return false; |
+ |
+ mFilters.erase(mFilters.begin() + pos); |
+ return true; |
+} |
+ |
OwnedString UserDefinedSubscription::Serialize() const |
{ |
OwnedString result(Subscription::Serialize()); |
if (mDefaults) |
{ |
result.append(u"defaults="_str); |
if (mDefaults & Defaults::BLOCKING) |
result.append(u" blocking"_str); |