Revert part of the commit for compiler warnings, to fix loading themes.
authorJulien Lavergne <gilir@ubuntu.com>
Thu, 12 May 2011 06:52:27 +0000 (08:52 +0200)
committerJulien Lavergne <gilir@ubuntu.com>
Thu, 12 May 2011 06:52:27 +0000 (08:52 +0200)
src/cursor-theme.c
src/icon-theme.c
src/lxappearance.c
src/widget-theme.c

index 1a458ec..4e77d68 100644 (file)
@@ -37,8 +37,7 @@ static void update_cursor_demo()
         GDK_LEFT_SIDE,
         GDK_TOP_LEFT_CORNER,
         GDK_SB_H_DOUBLE_ARROW};
-    unsigned int i;
-    int s;
+    int i, n;
     for(i = 0; i < G_N_ELEMENTS(types); ++i)
     {
         GtkTreeIter it;
@@ -57,8 +56,8 @@ static void update_cursor_demo()
      * Unfortunately, this doesn't work for non-gtk+ programs.
      * KDE programs seem to require special handling with XFixes */
     cursor = gdk_cursor_new(GDK_LEFT_PTR);
-    s = gdk_display_get_n_screens(gdk_display_get_default());
-    while(--s >= 0)
+    i = gdk_display_get_n_screens(gdk_display_get_default());
+    while(--i >= 0)
     {
         GdkScreen* screen = gdk_display_get_screen(gdk_display_get_default(), i);
         gdk_window_set_cursor(gdk_screen_get_root_window(screen), cursor);
@@ -103,7 +102,7 @@ static void on_cursor_theme_size_changed(GtkRange* range, gpointer user_data)
 
 void cursor_theme_init(GtkBuilder* b)
 {
-    guint max_cursor_w, max_cursor_h, max_size;
+    int max_cursor_w, max_cursor_h, max_size;
     GtkTreeSelection* sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(app.cursor_theme_view));
     /* treeview and model are already set up in icon_theme_init() */
     g_signal_connect(sel, "changed", G_CALLBACK(on_cursor_theme_sel_changed), NULL);
index 498f83e..396c00b 100644 (file)
@@ -63,8 +63,8 @@ void load_icon_themes_from_dir(const char* base_dir, const char* theme_dir, GKey
     GDir* dir = g_dir_open(theme_dir, 0, NULL);
     if(dir)
     {
-        const char* name = NULL;
-        while(name == g_dir_read_name(dir))
+        const char* name;
+        while(name = g_dir_read_name(dir))
         {
             /* skip "default" */
             if(G_UNLIKELY(strcmp(name, "default") == 0))
@@ -157,6 +157,7 @@ static void on_install_theme_clicked(GtkButton* btn, gpointer user_data)
 
 static void on_remove_theme_clicked(GtkButton* btn, gpointer user_data)
 {
+    char* theme_name;
     GtkTreeSelection* sel;
     GtkTreeModel* model;
     GtkTreeIter it;
index ae8d973..ac3dafe 100644 (file)
@@ -121,12 +121,11 @@ static void reload_all_programs()
     gdk_event_send_clientmessage_toall((GdkEvent *)&event);
 }
 
-/* Disable, not used
 static const char* bool2str(gboolean val)
 {
     return val ? "TRUE" : "FALSE";
 }
-*/
+
 
 static void lxappearance_save_gtkrc()
 {
@@ -193,11 +192,11 @@ static void lxappearance_save_gtkrc()
 
     if(app.hinting_style)
         g_string_append_printf(content,
-            "gtk-xft-hintstyle=\"%i\"\n", app.hinting_style);
+            "gtk-xft-hintstyle=\"%s\"\n", app.hinting_style);
 
     if(app.font_rgba)
         g_string_append_printf(content,
-            "gtk-xft-rgba=\"%i\"\n", app.font_rgba);
+            "gtk-xft-rgba=\"%s\"\n", app.font_rgba);
 
     if(app.color_scheme)
     {
@@ -222,7 +221,7 @@ static void lxappearance_save_lxsession()
     char* rel_path = g_strconcat("lxsession/", lxsession_name, "/desktop.conf", NULL);
     char* user_config_file = g_build_filename(g_get_user_config_dir(), rel_path, NULL);
     char* buf;
-    gsize len;
+    int len;
     GKeyFile* kf = g_key_file_new();
 
     if(!g_key_file_load_from_file(kf, user_config_file, G_KEY_FILE_KEEP_COMMENTS|G_KEY_FILE_KEEP_TRANSLATIONS, NULL))
@@ -267,8 +266,8 @@ static void lxappearance_save_lxsession()
 #endif
     g_key_file_set_integer( kf, "GTK", "iXft/Antialias", app.enable_antialising);
     g_key_file_set_integer( kf, "GTK", "iXft/Hinting", app.enable_hinting);
-    g_key_file_set_integer( kf, "GTK", "sXft/HintStyle", app.hinting_style);
-    g_key_file_set_integer( kf, "GTK", "sXft/RGBA", app.font_rgba);
+    g_key_file_set_string( kf, "GTK", "sXft/HintStyle", app.hinting_style);
+    g_key_file_set_string( kf, "GTK", "sXft/RGBA", app.font_rgba);
 
     buf = g_key_file_to_data( kf, &len, NULL );
     g_key_file_free(kf);
index 17141e5..f891e99 100644 (file)
@@ -29,8 +29,8 @@ static GSList* load_themes_in_dir(const char* theme_dir, GSList* themes)
     GDir* dir = g_dir_open(theme_dir, 0, NULL);
     if(dir)
     {
-        const char* name = NULL;
-        while(name == g_dir_read_name(dir))
+        const char* name;
+        while(name = g_dir_read_name(dir))
         {
             /* test if we already have this in list */
             if(!g_slist_find_custom(themes, name, (GCompareFunc)strcmp))