GnomeKeyringResult
GnomeKeyring::findHostItemsAll(GList** found)
{
  AutoAttributeList attributes;
  newDisabledHostsAttributes(&attributes);
  return findItems(GNOME_KEYRING_ITEM_NOTE, attributes, found);
}
NS_IMETHODIMP GnomeKeyring::SetLoginSavingEnabled(const nsAString & aHost,
                                                  bool isEnabled)
{
  GnomeKeyringResult result;

  if (isEnabled) {
    AutoFoundList foundList;
    result = findHostItems(aHost, &foundList);
    MGK_GK_CHECKF_NS(result);

    return deleteFoundItems(foundList, PR_TRUE);
  }

  // TODO should check if host is already enabled

  AutoAttributeList attributes;
  newDisabledHostsAttributes(&attributes);
  addAttribute(attributes, kDisabledHostAttrName, aHost);

  // TODO name should be more explicit
  const char* name = "Mozilla disabled host entry";
  guint itemId;

  result = gnome_keyring_item_create_sync(keyringName.get(),
            GNOME_KEYRING_ITEM_NOTE,
            name,
            attributes,
            "", // no secret
            TRUE,
            &itemId);

  MGK_GK_CHECK_NS(result);
  return NS_OK;
}
GnomeKeyringResult
GnomeKeyring::findHostItems(const nsAString & aHost,
                            GList** found)
{
  AutoAttributeList attributes;
  newDisabledHostsAttributes(&attributes);
  addAttribute(attributes, kDisabledHostAttrName, aHost);
  // TODO: expect only one
  return findItems(GNOME_KEYRING_ITEM_NOTE, attributes, found);
}