nsAutoString topicA(gEQActivatedNotification); nsAutoString topicB(gEQDestroyedNotification);
nsAutoString topicA; topicA.AssignWithConversion(gEQActivatedNotification); nsAutoString topicB; topicB.AssignWithConversion(gEQDestroyedNotification);
void nsAppShellService::RegisterObserver(PRBool aRegister){  nsresult           rv;  nsISupports        *glop;  nsAutoString topicA(gEQActivatedNotification);  nsAutoString topicB(gEQDestroyedNotification);  // here's a silly dance. seems better to do it than not, though...  nsCOMPtr<nsIObserver> weObserve(do_QueryInterface(NS_STATIC_CAST(nsIObserver *, this)));  NS_ASSERTION(weObserve, "who's been chopping bits off nsAppShellService?");  rv = nsServiceManager::GetService(NS_OBSERVERSERVICE_PROGID,                           nsIObserverService::GetIID(), &glop);  if (NS_SUCCEEDED(rv)) {    nsIObserverService *os = NS_STATIC_CAST(nsIObserverService*,glop);    if (aRegister) {      os->AddObserver(weObserve, topicA.GetUnicode());      os->AddObserver(weObserve, topicB.GetUnicode());    } else {      os->RemoveObserver(weObserve, topicA.GetUnicode());      os->RemoveObserver(weObserve, topicB.GetUnicode());    }    nsServiceManager::ReleaseService(NS_OBSERVERSERVICE_PROGID, glop);  }}