summaryrefslogtreecommitdiff
path: root/mate-applet/mdock-mate-panel-applet.c
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-01-25 17:52:24 +0100
committerJavier <dev.git@javispedro.com>2015-01-25 17:52:24 +0100
commit4da68b43f3e86a4e53815b147176942d118f8eab (patch)
tree8e2d8c28880d9f1a61519f355c557c425b3c8076 /mate-applet/mdock-mate-panel-applet.c
parent566165c32861bca7b565f4e226a9e78fa85fb3d9 (diff)
downloadmdock-4da68b43f3e86a4e53815b147176942d118f8eab.tar.gz
mdock-4da68b43f3e86a4e53815b147176942d118f8eab.zip
fix applet settings path
Diffstat (limited to 'mate-applet/mdock-mate-panel-applet.c')
-rw-r--r--mate-applet/mdock-mate-panel-applet.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/mate-applet/mdock-mate-panel-applet.c b/mate-applet/mdock-mate-panel-applet.c
index ba18f43..62d0bde 100644
--- a/mate-applet/mdock-mate-panel-applet.c
+++ b/mate-applet/mdock-mate-panel-applet.c
@@ -17,6 +17,8 @@
* along with MDock. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <mate-panel-applet-gsettings.h>
+
#include "mdock-mate-panel-applet.h"
#include <glib/gi18n.h>
@@ -71,6 +73,13 @@ static gboolean transform_applet_orient_to_orientation(GBinding *binding, const
g_value_set_enum(to_value, applet_orient_to_orientation(orient));
}
+static gboolean transform_prefs_path_to_gsettings(GBinding *binding, const GValue *from_value, GValue *to_value, gpointer user_data)
+{
+ const gchar *prefs_path = g_value_get_string(from_value);
+ GSettings *settings = g_settings_new_with_path(MDOCK_WIDGET_GSETTINGS_SCHEMA, prefs_path);
+ g_value_take_object(to_value, settings);
+}
+
static GtkOrientation mdock_mate_panel_applet_get_orientation(MDockMatePanelApplet *self)
{
MatePanelAppletOrient orient = mate_panel_applet_get_orient(MATE_PANEL_APPLET(self));
@@ -91,8 +100,6 @@ static void mdock_mate_panel_applet_size_request(GtkWidget *widget, GtkRequisiti
gtk_widget_size_request(GTK_WIDGET(self->dock), requisition);
- g_debug("size request %dx%d", requisition->width, requisition->height);
-
// Try to force a square aspect ratio for the icons
// by requesting a big enough major panel dimension
GtkAllocation allocation;
@@ -106,8 +113,6 @@ static void mdock_mate_panel_applet_size_request(GtkWidget *widget, GtkRequisiti
requisition->width = MAX(requisition->width, allocation.width);
requisition->height = MAX(requisition->height, nitems * (requisition->width + spacing));
}
-
- g_debug("size request %dx%d", requisition->width, requisition->height);
}
static void mdock_mate_panel_applet_class_init(MDockMatePanelAppletClass *klass)
@@ -120,23 +125,18 @@ static void mdock_mate_panel_applet_class_init(MDockMatePanelAppletClass *klass)
static void mdock_mate_panel_applet_init(MDockMatePanelApplet *self)
{
MatePanelApplet *applet = MATE_PANEL_APPLET(self);
- gchar *prefs_path = mate_panel_applet_get_preferences_path(applet);
- g_warn_if_fail(prefs_path);
-
- if (prefs_path) {
- self->dock = MDOCK_WIDGET(mdock_widget_new_with_settings_path(prefs_path));
- } else {
- self->dock = MDOCK_WIDGET(mdock_widget_new());
- }
+ self->dock = MDOCK_WIDGET(mdock_widget_new());
gtk_container_add(GTK_CONTAINER(self), GTK_WIDGET(self->dock));
- g_free(prefs_path);
-
g_object_bind_property_full(self, "orient", self->dock, "orientation",
G_BINDING_DEFAULT,
transform_applet_orient_to_orientation,
NULL, NULL, NULL);
+ g_object_bind_property_full(self, "prefs-path", self->dock, "settings",
+ G_BINDING_DEFAULT,
+ transform_prefs_path_to_gsettings,
+ NULL, NULL, NULL);
GtkActionGroup *action_group = gtk_action_group_new("MDock Mate Panel Applet Actions");
gtk_action_group_add_actions(action_group,