Bug 1477669 - remove feed preview code and associated files/code, r=flod,mak,nika
Differential Revision: https://phabricator.services.mozilla.com/D8524
This commit is contained in:
@@ -760,50 +760,3 @@ nsWindowsShellService::OpenApplicationWithURI(nsIFile* aApplication,
|
||||
const char* specStr = spec.get();
|
||||
return process->Run(false, &specStr, 1);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowsShellService::GetDefaultFeedReader(nsIFile** _retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIWindowsRegKey> regKey =
|
||||
do_CreateInstance("@mozilla.org/windows-registry-key;1", &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT,
|
||||
NS_LITERAL_STRING("feed\\shell\\open\\command"),
|
||||
nsIWindowsRegKey::ACCESS_READ);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsAutoString path;
|
||||
rv = regKey->ReadStringValue(EmptyString(), path);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (path.IsEmpty())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (path.First() == '"') {
|
||||
// Everything inside the quotes
|
||||
path = Substring(path, 1, path.FindChar('"', 1) - 1);
|
||||
}
|
||||
else {
|
||||
// Everything up to the first space
|
||||
path = Substring(path, 0, path.FindChar(' '));
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFile> defaultReader =
|
||||
do_CreateInstance("@mozilla.org/file/local;1", &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = defaultReader->InitWithPath(path);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
bool exists;
|
||||
rv = defaultReader->Exists(&exists);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!exists)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
NS_ADDREF(*_retval = defaultReader);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user