Bug 448054 - Alerts service named notifications are not handled correctly.

Named notifications will now work as expected on OS X with growl.  Also fixed a
few whitespace issues as well as added vim and emacs filemode lines.
r=gavin
This commit is contained in:
Shawn Wilsher 2008-08-27 13:02:24 -04:00
Родитель 3db06b4e29
Коммит dc08b177e1
1 изменённых файлов: 6 добавлений и 4 удалений

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

@ -1,4 +1,6 @@
/* ***** BEGIN LICENSE BLOCK ***** /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=2 sts=2 expandtab
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
* The contents of this file are subject to the Mozilla Public License Version * The contents of this file are subject to the Mozilla Public License Version
@ -92,7 +94,7 @@ DispatchNamedNotification(const nsAString &aName,
if ([GrowlApplicationBridge isGrowlInstalled] == NO || if ([GrowlApplicationBridge isGrowlInstalled] == NO ||
[GrowlApplicationBridge isGrowlRunning] == NO) [GrowlApplicationBridge isGrowlRunning] == NO)
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
mozGrowlDelegate *delegate = mozGrowlDelegate *delegate =
static_cast<mozGrowlDelegate *>([GrowlApplicationBridge growlDelegate]); static_cast<mozGrowlDelegate *>([GrowlApplicationBridge growlDelegate]);
if (!delegate) if (!delegate)
@ -182,14 +184,14 @@ nsAlertsService::ShowAlertNotification(const nsAString& aImageUrl,
"Growl Delegate was not registered properly."); "Growl Delegate was not registered properly.");
if (!aAlertName.IsEmpty()) { if (!aAlertName.IsEmpty()) {
return DispatchNamedNotification(aAlertTitle, aImageUrl, aAlertTitle, return DispatchNamedNotification(aAlertName, aImageUrl, aAlertTitle,
aAlertText, aAlertCookie, aAlertListener); aAlertText, aAlertCookie, aAlertListener);
} }
nsresult rv; nsresult rv;
nsCOMPtr<nsIStringBundleService> bundleService = nsCOMPtr<nsIStringBundleService> bundleService =
do_GetService("@mozilla.org/intl/stringbundle;1", &rv); do_GetService("@mozilla.org/intl/stringbundle;1", &rv);
// We don't want to fail just yet if we can't get the alert name // We don't want to fail just yet if we can't get the alert name
nsString name = NS_LITERAL_STRING("General Notification"); nsString name = NS_LITERAL_STRING("General Notification");
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {