argh, also patch universal char det

similar to patch by bzbarsky@mit.edu that I had in my tree
fixes extensions bustage
This commit is contained in:
alecf%netscape.com 2005-11-02 16:57:00 +00:00
Родитель ca90824950
Коммит 54942a89c9
1 изменённых файлов: 11 добавлений и 23 удалений

Просмотреть файл

@ -45,7 +45,7 @@
#include "pratom.h" #include "pratom.h"
#include "nsUniversalCharDetDll.h" #include "nsUniversalCharDetDll.h"
#include "nsISupports.h" #include "nsISupports.h"
#include "nsIRegistry.h" #include "nsICategoryManager.h"
#include "nsIComponentManager.h" #include "nsIComponentManager.h"
#include "nsIFactory.h" #include "nsIFactory.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
@ -68,28 +68,16 @@ static NS_METHOD nsUniversalCharDetectorRegistrationProc(nsIComponentManager *aC
const char *componentType, const char *componentType,
const nsModuleComponentInfo *info) const nsModuleComponentInfo *info)
{ {
nsRegistryKey key; nsresult rv;
nsresult rv = NS_OK; nsCOMPtr<nsICategoryManager>
nsCOMPtr<nsIRegistry> registry = do_GetService(NS_REGISTRY_CONTRACTID, &rv); categoryManager(do_GetService("@mozilla.org/categorymanager;1", &rv));
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) return rv;
return rv;
}
// open the registry return categoryManager->AddCategoryEntry(NS_CHARSET_DETECTOR_CATEGORY,
rv = registry->OpenWellKnownRegistry( "universal_charset_detector",
nsIRegistry::ApplicationComponentRegistry); info->mContractID,
if (NS_FAILED(rv)) { PR_TRUE, PR_TRUE,
return rv; nsnull);
}
rv = registry -> AddSubtree(nsIRegistry::Common,
NS_CHARSET_DETECTOR_REG_BASE "universal_charset_detector" ,&key);
if (NS_SUCCEEDED(rv)) {
rv = registry-> SetStringUTF8(key, "type", "universal_charset_detector");
rv = registry-> SetStringUTF8(key, "defaultEnglishText", "UniversalDetector");
}
return rv;
} }
// Component Table // Component Table