From 29fe6f477c1abacd920b01565648948461debcca Mon Sep 17 00:00:00 2001 From: Andrea Azzarone Date: Wed, 1 Aug 2012 14:58:24 +0200 Subject: Add unit test. (bzr r2527.1.4) --- unity-shared/PanelStyle.cpp | 13 +++++++++++++ unity-shared/PanelStyle.h | 2 ++ 2 files changed, 15 insertions(+) (limited to 'unity-shared') diff --git a/unity-shared/PanelStyle.cpp b/unity-shared/PanelStyle.cpp index 0f2dd24e1..ff9ca4b74 100644 --- a/unity-shared/PanelStyle.cpp +++ b/unity-shared/PanelStyle.cpp @@ -68,6 +68,19 @@ Style::Style() : panel_height(24) , _style_context(gtk_style_context_new()) , _gsettings(g_settings_new(SETTINGS_NAME.c_str())) +{ + Init(); +} + +Style::Style(GSettingsBackend* backend) + : panel_height(24) + , _style_context(gtk_style_context_new()) + , _gsettings(g_settings_new_with_backend(SETTINGS_NAME.c_str(), backend)) +{ + Init(); +} + +void Style::Init() { if (style_instance) { diff --git a/unity-shared/PanelStyle.h b/unity-shared/PanelStyle.h index 397540f6c..fdc5df8e3 100644 --- a/unity-shared/PanelStyle.h +++ b/unity-shared/PanelStyle.h @@ -64,6 +64,7 @@ class Style { public: Style(); + Style(GSettingsBackend* backend); ~Style(); static Style& Instance(); @@ -81,6 +82,7 @@ public: sigc::signal changed; private: + void Init(); void Refresh(); glib::Object _style_context; -- cgit v1.2.3