Minor cleanup in Omnifilter

Small cleanup inspired by a coversation with Zi.
Remove a redundant callback and ensure the owner UUID is handled properly.

Signed-off-by: PanteraPolnocy <panterapolnocy@gmail.com>
master
PanteraPolnocy 2025-12-19 14:52:31 +01:00
parent 4c745004bc
commit 4a430585c4
2 changed files with 7 additions and 2 deletions

View File

@ -261,7 +261,7 @@ void Omnifilter::onOwnerChanged()
{
static LLColor4 default_text_color = mOwnerCtrl->getFgColor();
if (LLUUID::validate(mOwnerCtrl->getValue()))
if (LLUUID::validate(mOwnerCtrl->getValue().asString()))
{
mOwnerCtrl->setFgColor(default_text_color);
}
@ -372,7 +372,6 @@ bool Omnifilter::postBuild()
mRemoveNeedleBtn->setCommitCallback(boost::bind(&Omnifilter::onRemoveNeedleClicked, this));
mNeedleNameCtrl->setCommitCallback(boost::bind(&Omnifilter::onNeedleNameChanged, this));
mSenderNameCtrl->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));
mContentCtrl->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));
mSenderCaseSensitiveCheck->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));
mSenderMatchTypeCombo->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));
mContentCtrl->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));

View File

@ -319,6 +319,12 @@ void OmnifilterEngine::loadNeedles()
new_needle.mSenderNameCaseInsensitive = needle_data["sender_name_case_insensitive"].asBoolean();
new_needle.mContentCaseInsensitive = needle_data["content_case_insensitive"].asBoolean();
const std::string owner_id_str = needle_data["owner_id"].asString();
if (!owner_id_str.empty())
{
new_needle.mOwnerID.set(owner_id_str);
}
mNeedles[new_needle_name] = new_needle;
}
}