1
0
MozillaFirefox/mozilla-nsSound.patch

44 lines
1.4 KiB
Diff
Raw Normal View History

# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
# Date 1336632642 -7200
# Node ID 56cc5a3c431612fa98f0550f02a9f34b566e1d9b
# Parent 307671d73258761245d165e43591d885c7f68b73
Bug 749739 - New email sound notification file cannot contain spaces (Linux - Thunderbird 12). r=karlt, a=lsblakk (upstream in FF14)
diff --git a/widget/gtk2/nsSound.cpp b/widget/gtk2/nsSound.cpp
--- a/widget/gtk2/nsSound.cpp
+++ b/widget/gtk2/nsSound.cpp
@@ -353,23 +353,28 @@ NS_METHOD nsSound::Play(nsIURL *aURL)
bool isFile;
nsresult rv = aURL->SchemeIs("file", &isFile);
if (NS_SUCCEEDED(rv) && isFile) {
ca_context* ctx = ca_context_get_default();
if (!ctx) {
return NS_ERROR_OUT_OF_MEMORY;
}
- nsCAutoString path;
- rv = aURL->GetPath(path);
+ nsCAutoString spec;
+ rv = aURL->GetSpec(spec);
if (NS_FAILED(rv)) {
return rv;
}
+ gchar *path = g_filename_from_uri(spec.get(), NULL, NULL);
+ if (!path) {
+ return NS_ERROR_FILE_UNRECOGNIZED_PATH;
+ }
- ca_context_play(ctx, 0, "media.filename", path.get(), NULL);
+ ca_context_play(ctx, 0, "media.filename", path, NULL);
+ g_free(path);
} else {
nsCOMPtr<nsIStreamLoader> loader;
rv = NS_NewStreamLoader(getter_AddRefs(loader), aURL, this);
}
return rv;
}