Adding upstream version 0.5.1.
[debian/lxappearance.git] / src / utils.c
index f3dddfc..2ae5b46 100644 (file)
@@ -58,7 +58,11 @@ gboolean show_progress_for_pid(GtkWindow* parent, const char* title, const char*
 {
     gint res;
     GtkWidget* dlg = gtk_dialog_new_with_buttons(title, parent,
+#if GTK_CHECK_VERSION(3, 0, 0)
+                            GTK_DIALOG_MODAL,
+#else
                             GTK_DIALOG_NO_SEPARATOR|GTK_DIALOG_MODAL,
+#endif
                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
     GtkWidget* progress = gtk_progress_bar_new();
     GtkWidget* vbox = gtk_dialog_get_content_area(GTK_DIALOG(dlg));
@@ -73,7 +77,7 @@ gboolean show_progress_for_pid(GtkWindow* parent, const char* title, const char*
     gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 0);
     gtk_widget_show(progress);
     gtk_box_pack_start(GTK_BOX(vbox), progress, FALSE, TRUE, 0);
-    gtk_progress_set_activity_mode(GTK_PROGRESS(progress), TRUE);
+    gtk_progress_bar_pulse(GTK_PROGRESS_BAR(progress));
     g_signal_connect(dlg, "response", G_CALLBACK(on_progress_dlg_response), &pid);
 
     res = gtk_dialog_run(GTK_DIALOG(dlg));
@@ -160,7 +164,7 @@ static gboolean install_icon_theme_package(const char* package_path)
             if(dir)
             {
                 char* name;
-                while(name = (char*)g_dir_read_name(dir))
+                while((name = (char*)g_dir_read_name(dir)) != NULL)
                 {
                     char* index_theme = g_build_filename(tmp_dir, name, "index.theme", NULL);
                     gboolean is_theme = g_file_test(index_theme, G_FILE_TEST_EXISTS);
@@ -188,6 +192,7 @@ static gboolean install_icon_theme_package(const char* package_path)
                         g_free(theme_target);
                         g_free(theme_tmp);
                     }
+                    g_free(name);
                 }
                 g_dir_close(dir);