summaryrefslogtreecommitdiffstats
path: root/comm/suite/components/shell/nsGNOMEShellService.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'comm/suite/components/shell/nsGNOMEShellService.cpp')
-rw-r--r--comm/suite/components/shell/nsGNOMEShellService.cpp415
1 files changed, 209 insertions, 206 deletions
diff --git a/comm/suite/components/shell/nsGNOMEShellService.cpp b/comm/suite/components/shell/nsGNOMEShellService.cpp
index d62e66b..9133a01 100644
--- a/comm/suite/components/shell/nsGNOMEShellService.cpp
+++ b/comm/suite/components/shell/nsGNOMEShellService.cpp
@@ -14,7 +14,6 @@
#include "nsIPrefService.h"
#include "prenv.h"
#include "nsString.h"
-#include "nsIGConfService.h"
#include "nsIGIOService.h"
#include "nsIGSettingsService.h"
#include "nsIStringBundle.h"
@@ -27,8 +26,11 @@
#include "imgIRequest.h"
#include "imgIContainer.h"
#include "mozilla/Sprintf.h"
+#if defined(MOZ_WIDGET_GTK)
#include "nsIImageToPixbuf.h"
+#endif
#include "nsXULAppAPI.h"
+#include "gfxPlatform.h"
#include <glib.h>
#include <glib-object.h>
@@ -38,23 +40,10 @@
#include <limits.h>
#include <stdlib.h>
-// GConf registry key constants
-#define DG_BACKGROUND "/desktop/gnome/background"
-
-#define DGB_OPTIONS DG_BACKGROUND "/picture_options"
-#define DGB_IMAGE DG_BACKGROUND "/picture_filename"
-#define DGB_DRAWBG DG_BACKGROUND "/draw_background"
-#define DGB_COLOR DG_BACKGROUND "/primary_color"
-
-#define OGDB_SCHEMA "org.gnome.desktop.background"
-#define OGDB_OPTIONS "picture-options"
-#define OGDB_IMAGE "picture-uri"
-#define OGDB_DRAWBG "draw-background"
-#define OGDB_COLOR "primary-color"
-
struct ProtocolAssociation {
uint16_t app;
const char* protocol;
+ bool essential;
};
struct MimeTypeAssociation {
@@ -64,21 +53,29 @@ struct MimeTypeAssociation {
};
static const ProtocolAssociation gProtocols[] = {
- { nsIShellService::BROWSER, "http" },
- { nsIShellService::BROWSER, "https" },
- { nsIShellService::MAIL, "mailto" },
- { nsIShellService::NEWS, "news" },
- { nsIShellService::NEWS, "snews" },
- { nsIShellService::RSS, "feed" }
+ { nsIShellService::BROWSER, "http", true },
+ { nsIShellService::BROWSER, "https", true },
+ { nsIShellService::BROWSER, "ftp", false },
+ { nsIShellService::BROWSER, "chrome", false },
+ { nsIShellService::MAIL, "mailto", true },
+ { nsIShellService::NEWS, "news", true },
+ { nsIShellService::NEWS, "snews", true },
+ { nsIShellService::RSS, "feed", true }
};
static const MimeTypeAssociation gMimeTypes[] = {
- { nsIShellService::BROWSER, "text/html", "htm html" },
- { nsIShellService::BROWSER, "application/xhtml+xml", "xhtml" },
+ { nsIShellService::BROWSER, "text/html", "htm html shtml" },
+ { nsIShellService::BROWSER, "application/xhtml+xml", "xhtml xht" },
{ nsIShellService::MAIL, "message/rfc822", "eml" },
{ nsIShellService::RSS, "application/rss+xml", "rss" }
};
+#define kDesktopBGSchema "org.gnome.desktop.background"
+#define kDesktopImageGSKey "picture-uri"
+#define kDesktopOptionGSKey "picture-options"
+#define kDesktopDrawBGGSKey "draw-background"
+#define kDesktopColorGSKey "primary-color"
+
NS_IMPL_ISUPPORTS(nsGNOMEShellService, nsIGNOMEShellService, nsIShellService)
nsresult
@@ -106,30 +103,15 @@ nsGNOMEShellService::Init()
{
nsresult rv;
+ if (gfxPlatform::IsHeadless()) {
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+
// Check G_BROKEN_FILENAMES. If it's set, then filenames in glib use
// the locale encoding. If it's not set, they use UTF-8.
mUseLocaleFilenames = PR_GetEnv("G_BROKEN_FILENAMES") != nullptr;
- const char* launcher = PR_GetEnv("MOZ_APP_LAUNCHER");
- if (launcher) {
- if (g_path_is_absolute(launcher)) {
- mAppPath = launcher;
- gchar* basename = g_path_get_basename(launcher);
- gchar* fullpath = g_find_program_in_path(basename);
- mAppIsInPath = fullpath && mAppPath.Equals(fullpath);
- g_free(fullpath);
- g_free(basename);
- return NS_OK;
- }
-
- gchar* fullpath = g_find_program_in_path(launcher);
- if (fullpath) {
- mAppPath = fullpath;
- mAppIsInPath = true;
- g_free(fullpath);
- return NS_OK;
- }
- }
+ if (GetAppPathFromLauncher()) return NS_OK;
nsCOMPtr<nsIFile> appPath;
rv = NS_GetSpecialDirectory(XRE_EXECUTABLE_FILE, getter_AddRefs(appPath));
@@ -138,29 +120,63 @@ nsGNOMEShellService::Init()
return appPath->GetNativePath(mAppPath);
}
+bool nsGNOMEShellService::GetAppPathFromLauncher() {
+ gchar *tmp;
+
+ const char* launcher = PR_GetEnv("MOZ_APP_LAUNCHER");
+ if (!launcher) return false;
+
+ if (g_path_is_absolute(launcher)) {
+ mAppPath = launcher;
+ tmp = g_path_get_basename(launcher);
+ gchar* fullpath = g_find_program_in_path(tmp);
+ if (fullpath && mAppPath.Equals(fullpath)) mAppIsInPath = true;
+ g_free(fullpath);
+ } else {
+ tmp = g_find_program_in_path(launcher);
+ if (!tmp) return false;
+ mAppPath = tmp;
+ mAppIsInPath = true;
+ }
+
+ g_free(tmp);
+ return true;
+}
+
bool
-nsGNOMEShellService::HandlerMatchesAppName(const char* aHandler)
+nsGNOMEShellService::CheckHandlerMatchesAppName(const nsACString &handler) const
{
- bool matches = false;
gint argc;
gchar** argv;
- if (g_shell_parse_argv(aHandler, &argc, &argv, nullptr) && argc > 0) {
- gchar* command = nullptr;
- if (!mUseLocaleFilenames)
- command = g_find_program_in_path(argv[0]);
- else {
- gchar* nativeFile = g_filename_from_utf8(argv[0], -1,
- nullptr, nullptr, nullptr);
- if (nativeFile) {
- command = g_find_program_in_path(nativeFile);
- g_free(nativeFile);
- }
- }
- matches = command && mAppPath.Equals(command);
- g_free(command);
+ nsAutoCString command(handler);
+
+ // The string will be something of the form: [/path/to/]application "%s"
+ // We want to remove all of the parameters and get just the binary name.
+
+ if (g_shell_parse_argv(command.get(), &argc, &argv, nullptr) && argc > 0) {
+ command.Assign(argv[0]);
g_strfreev(argv);
}
+ gchar *commandPath;
+ if (mUseLocaleFilenames) {
+ gchar *nativePath =
+ g_filename_from_utf8(command.get(), -1, nullptr, nullptr, nullptr);
+ if (!nativePath) {
+ NS_ERROR("Error converting path to filesystem encoding");
+ return false;
+ }
+
+ commandPath = g_find_program_in_path(nativePath);
+ g_free(nativePath);
+ } else {
+ commandPath = g_find_program_in_path(command.get());
+ }
+
+ if (!commandPath) return false;
+
+ bool matches = mAppPath.Equals(commandPath);
+ g_free(commandPath);
return matches;
}
@@ -170,36 +186,34 @@ nsGNOMEShellService::IsDefaultClient(bool aStartupCheck, uint16_t aApps,
{
*aIsDefaultClient = false;
- nsCString handler;
- nsCOMPtr<nsIGIOMimeApp> gioApp;
nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
- nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
+ nsAutoCString handler;
+ nsCOMPtr<nsIGIOMimeApp> gioApp;
for (unsigned i = 0; i < mozilla::ArrayLength(gProtocols); i++) {
if (aApps & gProtocols[i].app) {
nsDependentCString protocol(gProtocols[i].protocol);
+ if (!gProtocols[i].essential)
+ continue;
+
if (giovfs) {
+ handler.Truncate();
nsCOMPtr<nsIHandlerApp> handlerApp;
+ nsDependentCString protocol(gProtocols[i].protocol);
giovfs->GetAppForURIScheme(protocol, getter_AddRefs(handlerApp));
-
gioApp = do_QueryInterface(handlerApp);
if (!gioApp)
return NS_OK;
-
+
if (NS_SUCCEEDED(gioApp->GetCommand(handler)) &&
- !HandlerMatchesAppName(handler.get()))
+ !CheckHandlerMatchesAppName(handler))
return NS_OK;
}
-
- bool enabled;
- if (gconf &&
- NS_SUCCEEDED(gconf->GetAppForProtocol(protocol, &enabled, handler)) &&
- (!enabled || !HandlerMatchesAppName(handler.get())))
- return NS_OK;
}
}
*aIsDefaultClient = true;
+
return NS_OK;
}
@@ -207,53 +221,43 @@ NS_IMETHODIMP
nsGNOMEShellService::SetDefaultClient(bool aForAllUsers,
bool aClaimAllTypes, uint16_t aApps)
{
- nsresult rv;
-
- nsCOMPtr<nsIGIOMimeApp> app;
nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
if (giovfs) {
+ nsresult rv;
nsCString brandName;
rv = GetBrandName(brandName);
NS_ENSURE_SUCCESS(rv, rv);
- rv = giovfs->CreateAppFromCommand(mAppPath, brandName, getter_AddRefs(app));
- NS_ENSURE_SUCCESS(rv, rv);
-
- for (unsigned i = 0; i < mozilla::ArrayLength(gMimeTypes); i++) {
- if (aApps & gMimeTypes[i].app) {
- rv = app->SetAsDefaultForMimeType(nsDependentCString(gMimeTypes[i].mimeType));
- NS_ENSURE_SUCCESS(rv, rv);
- rv = app->SetAsDefaultForFileExtensions(nsDependentCString(gMimeTypes[i].extensions));
- NS_ENSURE_SUCCESS(rv, rv);
- }
+ nsCOMPtr<nsIGIOMimeApp> appInfo;
+ rv = giovfs->FindAppFromCommand(mAppPath, getter_AddRefs(appInfo));
+ if (NS_FAILED(rv)) {
+ // Application was not found in the list of installed applications
+ // provided by OS. Fallback to create appInfo from command and name.
+ rv = giovfs->CreateAppFromCommand(mAppPath, brandName,
+ getter_AddRefs(appInfo));
+ NS_ENSURE_SUCCESS(rv, rv);
}
- }
- nsCString appKeyValue;
- nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
- if (gconf) {
- if (!mAppIsInPath)
- appKeyValue = mAppPath;
- else {
- gchar* basename = g_path_get_basename(mAppPath.get());
- appKeyValue = basename;
- g_free(basename);
- }
- appKeyValue.AppendLiteral(" %s");
- }
-
- for (unsigned i = 0; i < mozilla::ArrayLength(gProtocols); i++) {
- if (aApps & gProtocols[i].app) {
- nsDependentCString protocol(gProtocols[i].protocol);
- if (app) {
- rv = app->SetAsDefaultForURIScheme(protocol);
- NS_ENSURE_SUCCESS(rv, rv);
- }
- if (gconf) {
- rv = gconf->SetAppForProtocol(protocol, appKeyValue);
- NS_ENSURE_SUCCESS(rv, rv);
+ // set handler for the protocols
+ for (unsigned int i = 0; i < mozilla::ArrayLength(gProtocols); ++i) {
+ if (aApps & gProtocols[i].app) {
+ if (appInfo && (gProtocols[i].essential || aClaimAllTypes)) {
+ nsDependentCString protocol(gProtocols[i].protocol);
+ appInfo->SetAsDefaultForURIScheme(protocol);
+ }
}
}
+
+ if (aClaimAllTypes) {
+ for (unsigned int i = 0; i < mozilla::ArrayLength(gMimeTypes); i++) {
+ if (aApps & gMimeTypes[i].app) {
+ nsDependentCString type(gMimeTypes[i].mimeType);
+ appInfo->SetAsDefaultForMimeType(type);
+ nsDependentCString extensions(gMimeTypes[i].extensions);
+ appInfo->SetAsDefaultForFileExtensions(extensions);
+ }
+ }
+ }
}
return NS_OK;
@@ -262,139 +266,144 @@ nsGNOMEShellService::SetDefaultClient(bool aForAllUsers,
NS_IMETHODIMP
nsGNOMEShellService::GetCanSetDesktopBackground(bool* aResult)
{
- nsCOMPtr<nsIGConfService> gconf(do_GetService(NS_GCONFSERVICE_CONTRACTID));
- *aResult = gconf && getenv("GNOME_DESKTOP_SESSION_ID");
+ // for Gnome or desktops using the same GSettings keys
+ const char *currentDesktop = getenv("XDG_CURRENT_DESKTOP");
+ if (currentDesktop && strstr(currentDesktop, "GNOME") != nullptr) {
+ *aResult = true;
+ return NS_OK;
+ }
+
+ const char *gnomeSession = getenv("GNOME_DESKTOP_SESSION_ID");
+ if (gnomeSession) {
+ *aResult = true;
+ } else {
+ *aResult = false;
+ }
+
return NS_OK;
}
+static nsresult WriteImage(const nsCString &aPath, imgIContainer *aImage) {
+#if !defined(MOZ_WIDGET_GTK)
+ return NS_ERROR_NOT_AVAILABLE;
+#else
+ nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
+ do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
+ if (!imgToPixbuf) return NS_ERROR_NOT_AVAILABLE;
+
+ GdkPixbuf *pixbuf = imgToPixbuf->ConvertImageToPixbuf(aImage);
+ if (!pixbuf) return NS_ERROR_NOT_AVAILABLE;
+
+ gboolean res = gdk_pixbuf_save(pixbuf, aPath.get(), "png", nullptr, nullptr);
+
+ g_object_unref(pixbuf);
+ return res ? NS_OK : NS_ERROR_FAILURE;
+#endif
+}
+
NS_IMETHODIMP
nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
int32_t aPosition,
const nsACString& aImageName)
{
- nsCString brandName;
- nsresult rv = GetBrandName(brandName);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // build the file name
- nsCString filePath(PR_GetEnv("HOME"));
- filePath.Append('/');
- filePath.Append(brandName);
- filePath.AppendLiteral("_wallpaper.png");
-
- // get the image container
- nsCOMPtr<nsIImageLoadingContent> imageContent(do_QueryInterface(aElement, &rv));
- NS_ENSURE_SUCCESS(rv, rv);
+ nsresult rv;
+ nsCOMPtr<nsIImageLoadingContent> imageContent =
+ do_QueryInterface(aElement, &rv);
+ if (!imageContent) return rv;
+ // Get the image container.
nsCOMPtr<imgIRequest> request;
rv = imageContent->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
getter_AddRefs(request));
- NS_ENSURE_TRUE(request, rv);
-
+ if (!request) return rv;
nsCOMPtr<imgIContainer> container;
rv = request->GetImage(getter_AddRefs(container));
- NS_ENSURE_TRUE(request, rv);
-
- nsCOMPtr<nsIImageToPixbuf> imgToPixbuf(do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1"));
- if (!imgToPixbuf)
- return NS_ERROR_NOT_AVAILABLE;
-
- GdkPixbuf* pixbuf = imgToPixbuf->ConvertImageToPixbuf(container);
- if (!pixbuf)
- return NS_ERROR_NOT_AVAILABLE;
-
- // write the image to a file in the home dir
- gboolean res = gdk_pixbuf_save(pixbuf, filePath.get(), "png",
- nullptr, nullptr);
-
- g_object_unref(pixbuf);
- if (!res)
- return NS_ERROR_FAILURE;
-
- // set desktop wallpaper filling style
- const char* options;
+ if (!container) return rv;
+
+ // Set desktop wallpaper filling style.
+ nsAutoCString options;
switch (aPosition) {
case BACKGROUND_TILE:
- options = "wallpaper";
+ options.AssignLiteral("wallpaper");
break;
case BACKGROUND_STRETCH:
- options = "stretched";
+ options.AssignLiteral("stretched");
break;
case BACKGROUND_FILL:
- options = "zoom";
+ options.AssignLiteral("zoom");
break;
case BACKGROUND_FIT:
- options = "scaled";
+ options.AssignLiteral("scaled");
break;
default:
- options = "centered";
+ options.AssignLiteral("centered");
break;
}
- // Try GSettings first. If we don't have GSettings or the right schema, fall back
- // to using GConf instead. Note that if GSettings works ok, the changes get
- // mirrored to GConf by the gsettings->gconf bridge in gnome-settings-daemon
- nsCOMPtr<nsIGSettingsService> gsettings(do_GetService(NS_GSETTINGSSERVICE_CONTRACTID));
+ // Write the background file to the home directory.
+ nsCString filePath(PR_GetEnv("HOME"));
+
+ nsCString brandName;
+ rv = GetBrandName(brandName);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ // Build the file name.
+ filePath.Append('/');
+ filePath.Append(brandName);
+ filePath.AppendLiteral("_wallpaper.png");
+
+ // Write the image to a file in the home dir.
+ rv = WriteImage(filePath, container);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ nsCOMPtr<nsIGSettingsService> gsettings =
+ do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
if (gsettings) {
nsCOMPtr<nsIGSettingsCollection> background_settings;
- gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(OGDB_SCHEMA),
+ gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(kDesktopBGSchema),
getter_AddRefs(background_settings));
if (background_settings) {
gchar *file_uri = g_filename_to_uri(filePath.get(), nullptr, nullptr);
- if (!file_uri)
- return NS_ERROR_FAILURE;
+ if (!file_uri) return NS_ERROR_FAILURE;
- background_settings->SetString(NS_LITERAL_CSTRING(OGDB_OPTIONS),
- nsDependentCString(options));
- background_settings->SetString(NS_LITERAL_CSTRING(OGDB_IMAGE),
+ background_settings->SetString(NS_LITERAL_CSTRING(kDesktopOptionGSKey),
+ options);
+ background_settings->SetString(NS_LITERAL_CSTRING(kDesktopImageGSKey),
nsDependentCString(file_uri));
g_free(file_uri);
- background_settings->SetBoolean(NS_LITERAL_CSTRING(OGDB_DRAWBG), true);
- return NS_OK;
+ background_settings->SetBoolean(NS_LITERAL_CSTRING(kDesktopDrawBGGSKey),
+ true);
+ return rv;
}
}
- // if the file was written successfully, set it as the system wallpaper
- nsCOMPtr<nsIGConfService> gconf(do_GetService(NS_GCONFSERVICE_CONTRACTID));
-
- if (gconf) {
- gconf->SetString(NS_LITERAL_CSTRING(DGB_OPTIONS), nsDependentCString(options));
-
- // Set the image to an empty string first to force a refresh (since we could
- // be writing a new image on top of an existing SeaMonkey_wallpaper.png
- // and nautilus doesn't monitor the file for changes).
- gconf->SetString(NS_LITERAL_CSTRING(DGB_IMAGE), EmptyCString());
- gconf->SetString(NS_LITERAL_CSTRING(DGB_IMAGE), filePath);
- gconf->SetBool(NS_LITERAL_CSTRING(DGB_DRAWBG), true);
- }
-
- return NS_OK;
+ return NS_ERROR_FAILURE;
}
#define COLOR_16_TO_8_BIT(_c) ((_c) >> 8)
+#define COLOR_8_TO_16_BIT(_c) ((_c) << 8 | (_c))
NS_IMETHODIMP
nsGNOMEShellService::GetDesktopBackgroundColor(uint32_t *aColor)
{
- nsCOMPtr<nsIGSettingsService> gsettings(do_GetService(NS_GSETTINGSSERVICE_CONTRACTID));
+ nsCOMPtr<nsIGSettingsService> gsettings =
+ do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
nsCOMPtr<nsIGSettingsCollection> background_settings;
+ nsAutoCString background;
- if (gsettings)
- gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(OGDB_SCHEMA),
+ if (gsettings) {
+ gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(kDesktopBGSchema),
getter_AddRefs(background_settings));
-
- nsCString background;
- if (background_settings)
- background_settings->GetString(NS_LITERAL_CSTRING(OGDB_COLOR),
- background);
- else {
- nsCOMPtr<nsIGConfService> gconf(do_GetService(NS_GCONFSERVICE_CONTRACTID));
- if (gconf)
- gconf->GetString(NS_LITERAL_CSTRING(DGB_COLOR), background);
+ if (background_settings) {
+ background_settings->GetString(NS_LITERAL_CSTRING(kDesktopColorGSKey),
+ background);
+ }
}
- if (background.IsEmpty())
- return NS_ERROR_FAILURE;
+ if (background.IsEmpty()) {
+ *aColor = 0;
+ return NS_OK;
+ }
GdkColor color;
NS_ENSURE_TRUE(gdk_color_parse(background.get(), &color), NS_ERROR_FAILURE);
@@ -405,37 +414,31 @@ nsGNOMEShellService::GetDesktopBackgroundColor(uint32_t *aColor)
return NS_OK;
}
-#define COLOR_8_TO_16_BIT(_c) ((_c) << 8 | (_c))
-
NS_IMETHODIMP
nsGNOMEShellService::SetDesktopBackgroundColor(uint32_t aColor)
{
NS_ENSURE_ARG_MAX(aColor, 0xFFFFFF);
- uint8_t red = aColor >> 16;
- uint8_t green = aColor >> 8;
- uint8_t blue = aColor;
+ uint16_t red = COLOR_8_TO_16_BIT((aColor >> 16) & 0xff);
+ uint16_t green = COLOR_8_TO_16_BIT((aColor >> 8) & 0xff);
+ uint16_t blue = COLOR_8_TO_16_BIT(aColor & 0xff);
char colorString[14];
- sprintf(colorString, "#%04x%04x%04x", COLOR_8_TO_16_BIT(red),
- COLOR_8_TO_16_BIT(green), COLOR_8_TO_16_BIT(blue));
+ sprintf(colorString, "#%04x%04x%04x", red, green, blue);
- nsCOMPtr<nsIGSettingsService> gsettings(do_GetService(NS_GSETTINGSSERVICE_CONTRACTID));
+ nsCOMPtr<nsIGSettingsService> gsettings =
+ do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
if (gsettings) {
nsCOMPtr<nsIGSettingsCollection> background_settings;
- gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(OGDB_SCHEMA),
+ gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(kDesktopBGSchema),
getter_AddRefs(background_settings));
if (background_settings) {
- background_settings->SetString(NS_LITERAL_CSTRING(OGDB_COLOR),
+ background_settings->SetString(NS_LITERAL_CSTRING(kDesktopColorGSKey),
nsDependentCString(colorString));
return NS_OK;
}
}
- nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
- if (gconf)
- gconf->SetString(NS_LITERAL_CSTRING(DGB_COLOR), nsDependentCString(colorString));
-
- return NS_OK;
+ return NS_ERROR_FAILURE;
}
NS_IMETHODIMP