summaryrefslogtreecommitdiff
diff options
authorMirco Müller <mirco.mueller@canonical.com>2012-02-07 15:38:02 +0100
committerMirco Müller <mirco.mueller@canonical.com>2012-02-07 15:38:02 +0100
commitd4569eca7cd62a2a287c9c98a96cc6102234d3ff (patch)
treee95b01b06cf987aafa643c2ef5e6ea4a2b6f133d
parentb586f9003d3f701bcc9a0ebc6d00a2add639e16b (diff)
Use client member-variable, be more C++-ish
(bzr r1906.1.2)
-rw-r--r--plugins/unityshell/src/BGHash.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/plugins/unityshell/src/BGHash.cpp b/plugins/unityshell/src/BGHash.cpp
index 81c5b7729..cf566b78b 100644
--- a/plugins/unityshell/src/BGHash.cpp
+++ b/plugins/unityshell/src/BGHash.cpp
@@ -35,8 +35,7 @@ namespace {
int level_of_recursion;
const int MAX_LEVEL_OF_RECURSION = 16;
const int MIN_LEVEL_OF_RECURSION = 2;
- const gchar* AVG_BG_COLOR = "average-bg-color\0";
- const gchar* UNITY_SCHEMA = "com.canonical.Unity\0";
+ std::string AVG_BG_COLOR = "average-bg-color";
}
namespace unity {
@@ -376,20 +375,15 @@ namespace unity {
0.5)
);
- GSettings* settings = NULL;
- gchar* color_string = NULL;
- GdkColor color = {0,
- (guint16) (_current_color.red * 65535.0 * 0.7f),
- (guint16) (_current_color.green * 65535.0 * 0.7f),
- (guint16) (_current_color.blue * 65535.0 * 0.7f)};
+ GdkColor color = {0,
+ (guint16) (_current_color.red * 65535.0 * 0.7f),
+ (guint16) (_current_color.green * 65535.0 * 0.7f),
+ (guint16) (_current_color.blue * 65535.0 * 0.7f)};
- settings = g_settings_new (UNITY_SCHEMA);
- if (settings)
+ if (client)
{
- color_string = gdk_color_to_string (&color);
- g_settings_set_string (settings, AVG_BG_COLOR, color_string);
- g_object_unref (settings);
- g_free (color_string);
+ unity::glib::String color_string(gdk_color_to_string(&color));
+ g_settings_set_string(client, AVG_BG_COLOR.c_str(), color_string);
}
}