NS_IMETHODIMP
mozHunspell::Observe(nsISupports* aSubj, const char *aTopic,
                    const PRUnichar *aData)
{
  NS_ASSERTION(!strcmp(aTopic, "profile-do-change"),
               "Unexpected observer topic");

  LoadDictionaryList();

  return NS_OK;
}
nsresult
mozHunspell::Init()
{
  LoadDictionaryList();

  nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
  if (obs) {
    obs->AddObserver(this, "profile-do-change", true);
    obs->AddObserver(this, "profile-after-change", true);
  }

  mozilla::RegisterWeakMemoryReporter(this);

  return NS_OK;
}
nsresult
mozHunspell::Init()
{
  if (!mDictionaries.Init())
    return NS_ERROR_OUT_OF_MEMORY;

  LoadDictionaryList();

  nsCOMPtr<nsIObserverService> obs =
    do_GetService("@mozilla.org/observer-service;1");
  if (obs) {
    obs->AddObserver(this, "profile-do-change", PR_TRUE);
  }

  return NS_OK;
}
nsresult
mozHunspell::Init()
{
  mDictionaries.Init();
  LoadDictionaryList();

  nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
  if (obs) {
    obs->AddObserver(this, "profile-do-change", true);
    obs->AddObserver(this, "profile-after-change", true);
  }

  mHunspellReporter = new NS_MEMORY_REPORTER_NAME(Hunspell);
  NS_RegisterMemoryReporter(mHunspellReporter);

  return NS_OK;
}
Exemple #5
0
/* void removeDirectory(in nsIFile dir); */
NS_IMETHODIMP mozHunspell::RemoveDirectory(nsIFile *aDir)
{
  mDynamicDirectories.RemoveObject(aDir);
  LoadDictionaryList();
  return NS_OK;
}