Fix notify icons settings
@@ -107,8 +107,14 @@ VOID PhNfLoadSettings(
{
PPH_NF_ICON icon;
+ if (pluginNamePart.Length)
+ {
if (icon = PhNfFindIcon(&pluginNamePart, (ULONG)idInteger))
+ icon->Flags |= PH_NF_ICON_ENABLED;
+ }
+ else
{
+ if (icon = PhNfGetIconById((ULONG)idInteger))
icon->Flags |= PH_NF_ICON_ENABLED;
}
}
@@ -142,6 +148,9 @@ VOID PhNfSaveSettings(
);
}
+ if (iconListBuilder.String->Length != 0)
+ PhRemoveEndStringBuilder(&iconListBuilder, 1);
+
settingsString = PhFinalStringBuilderString(&iconListBuilder);
PhSetStringSetting2(L"IconSettings", &settingsString->sr);
PhDereferenceObject(settingsString);
@@ -491,7 +500,7 @@ PPH_NF_ICON PhNfGetIconById(
}
PPH_NF_ICON PhNfFindIcon(
- _In_opt_ PPH_STRINGREF PluginName,
+ _In_ PPH_STRINGREF PluginName,
_In_ ULONG SubId
)
{
@@ -499,21 +508,14 @@ PPH_NF_ICON PhNfFindIcon(
{
PPH_NF_ICON icon = PhTrayIconItemList->Items[i];
- if (PluginName)
+ if (icon->Plugin)
{
- if (
- icon->SubId == SubId &&
- (icon->Plugin ? PhEqualStringRef(PluginName, &icon->Plugin->AppContext.AppName, TRUE) : TRUE)
- )
+ if (icon->SubId == SubId &&
+ PhEqualStringRef(PluginName, &icon->Plugin->Name, TRUE))
{
return icon;
}
}
- else
- {
- if (icon->SubId == SubId)
- return icon;
- }
}
return NULL;
