Add stubs for profile module.
[tweakr] / modules / tweakr-desktop.c
index b012091..de1de77 100644 (file)
@@ -383,8 +383,6 @@ tweakr_desktop_section_init (TweakrDesktopSection *section)
 
     gint snap_value = SNAP_NONE_VALUE;
 
-    section->snap_button = _build_snap_to_grid ();
-
     section->ini = g_key_file_new ();
 
     if (!g_key_file_load_from_file (section->ini, TRANSITIONS,
@@ -394,38 +392,47 @@ tweakr_desktop_section_init (TweakrDesktopSection *section)
         return;
     }
 
-    snap_value = g_key_file_get_integer (section->ini, "edit_mode",
-                                         "snap_grid_size", NULL);
-
-    if (snap_value < SNAP_SMALL_VALUE)
-    {
-        hildon_picker_button_set_active
-            (HILDON_PICKER_BUTTON (section->snap_button), SNAP_NONE);
-    }
-    else if (snap_value < SNAP_LARGE_VALUE)
-    {
-        hildon_picker_button_set_active
-            (HILDON_PICKER_BUTTON (section->snap_button), SNAP_SMALL);
-    }
-    else if (snap_value < SNAP_HUGE_VALUE)
+    if (g_key_file_has_key (section->ini, "edit_mode", "snap_grid_size",
+                            NULL))
     {
-        hildon_picker_button_set_active
-            (HILDON_PICKER_BUTTON (section->snap_button), SNAP_LARGE);
-    }
-    else
-    {
-        hildon_picker_button_set_active
-            (HILDON_PICKER_BUTTON (section->snap_button), SNAP_HUGE);
-    }
+        section->snap_button = _build_snap_to_grid ();
+
+        snap_value = g_key_file_get_integer (section->ini, "edit_mode",
+                                             "snap_grid_size", NULL);
 
+        if (snap_value < SNAP_SMALL_VALUE)
+        {
+            hildon_picker_button_set_active
+                (HILDON_PICKER_BUTTON (section->snap_button), SNAP_NONE);
+        }
+        else if (snap_value < SNAP_LARGE_VALUE)
+        {
+            hildon_picker_button_set_active
+                (HILDON_PICKER_BUTTON (section->snap_button), SNAP_SMALL);
+        }
+        else if (snap_value < SNAP_HUGE_VALUE)
+        {
+            hildon_picker_button_set_active
+                (HILDON_PICKER_BUTTON (section->snap_button), SNAP_LARGE);
+        }
+        else
+        {
+            hildon_picker_button_set_active
+                (HILDON_PICKER_BUTTON (section->snap_button), SNAP_HUGE);
+        }
+    }
     section->gconf = gconf_client_get_default ();
     section->bookmarks_button = _build_bookmarks_button (section);
 
     iface = TWEAKR_SECTION (section);
     iface->name = _("Desktop");
     iface->widget = gtk_vbox_new (FALSE, 0);
-    gtk_box_pack_start (GTK_BOX (iface->widget), section->snap_button,
-                        FALSE, FALSE, 0);
+
+    if (section->snap_button)
+    {
+        gtk_box_pack_start (GTK_BOX (iface->widget), section->snap_button,
+                            FALSE, FALSE, 0);
+    }
     if (section->bookmarks_button)
     {
         gtk_box_pack_start (GTK_BOX (iface->widget),