diff --git a/demos/gtk-demo/application.c b/demos/gtk-demo/application.c index ffb7ed6d29..718bf9c5f5 100644 --- a/demos/gtk-demo/application.c +++ b/demos/gtk-demo/application.c @@ -89,7 +89,7 @@ open_response_cb (GObject *source, GFile *file; GError *error = NULL; - file = gtk_file_dialog_save_finish (dialog, result, &error); + file = gtk_file_dialog_open_finish (dialog, result, &error); if (file) { char *contents; @@ -99,15 +99,16 @@ open_response_cb (GObject *source, create_window (app, contents); g_free (contents); } - else - { - GtkAlertDialog *alert; + } - alert = gtk_alert_dialog_new ("Error loading file: \"%s\"", error->message); - gtk_alert_dialog_show (alert, NULL); - g_object_unref (alert); - g_error_free (error); - } + if (error) + { + GtkAlertDialog *alert; + + alert = gtk_alert_dialog_new ("Error loading file: \"%s\"", error->message); + gtk_alert_dialog_show (alert, NULL); + g_object_unref (alert); + g_error_free (error); } g_object_unref (app); diff --git a/demos/gtk-demo/pickers.c b/demos/gtk-demo/pickers.c index 2a5d1b58ce..430158049c 100644 --- a/demos/gtk-demo/pickers.c +++ b/demos/gtk-demo/pickers.c @@ -65,8 +65,6 @@ open_file (GtkButton *picker, g_object_unref (dialog); } -#define COLOR(r,g,b) { r/255., g/255., b/255., 1.0 } - GtkWidget * do_pickers (GtkWidget *do_widget) {