Kaydet (Commit) 5f8f0b9f authored tarafından Nick Treleaven's avatar Nick Treleaven

Use 'while' instead of 'goto'.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4794 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst c2668958
...@@ -109,7 +109,6 @@ void project_new(void) ...@@ -109,7 +109,6 @@ void project_new(void)
GtkWidget *bbox; GtkWidget *bbox;
GtkWidget *label; GtkWidget *label;
PropertyDialogElements *e; PropertyDialogElements *e;
gint response;
if (! project_ask_close()) if (! project_ask_close())
return; return;
...@@ -190,16 +189,14 @@ void project_new(void) ...@@ -190,16 +189,14 @@ void project_new(void)
gtk_widget_show_all(e->dialog); gtk_widget_show_all(e->dialog);
retry: while (gtk_dialog_run(GTK_DIALOG(e->dialog)) == GTK_RESPONSE_OK)
response = gtk_dialog_run(GTK_DIALOG(e->dialog)); {
if (response == GTK_RESPONSE_OK) if (update_config(e))
{ {
if (! update_config(e))
goto retry;
else
ui_add_recent_project_file(app->project->file_name); ui_add_recent_project_file(app->project->file_name);
break;
}
} }
gtk_widget_destroy(e->dialog); gtk_widget_destroy(e->dialog);
g_free(e); g_free(e);
} }
...@@ -224,12 +221,7 @@ gboolean project_load_file_with_session(const gchar *locale_file_name) ...@@ -224,12 +221,7 @@ gboolean project_load_file_with_session(const gchar *locale_file_name)
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
static void run_open_dialog(GtkDialog *dialog) static void run_open_dialog(GtkDialog *dialog)
{ {
gint response; while (gtk_dialog_run(dialog) == GTK_RESPONSE_ACCEPT)
retry:
response = gtk_dialog_run(dialog);
if (response == GTK_RESPONSE_ACCEPT)
{ {
gchar *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); gchar *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
...@@ -242,9 +234,10 @@ static void run_open_dialog(GtkDialog *dialog) ...@@ -242,9 +234,10 @@ static void run_open_dialog(GtkDialog *dialog)
gtk_widget_grab_focus(GTK_WIDGET(dialog)); gtk_widget_grab_focus(GTK_WIDGET(dialog));
g_free(utf8_filename); g_free(utf8_filename);
g_free(filename); g_free(filename);
goto retry; continue;
} }
g_free(filename); g_free(filename);
break;
} }
} }
#endif #endif
...@@ -537,7 +530,6 @@ void project_properties(void) ...@@ -537,7 +530,6 @@ void project_properties(void)
{ {
PropertyDialogElements *e = g_new(PropertyDialogElements, 1); PropertyDialogElements *e = g_new(PropertyDialogElements, 1);
GeanyProject *p = app->project; GeanyProject *p = app->project;
gint response;
GtkWidget *widget = NULL; GtkWidget *widget = NULL;
GtkWidget *radio_long_line_custom; GtkWidget *radio_long_line_custom;
...@@ -596,16 +588,14 @@ void project_properties(void) ...@@ -596,16 +588,14 @@ void project_properties(void)
gtk_widget_show_all(e->dialog); gtk_widget_show_all(e->dialog);
retry: while (gtk_dialog_run(GTK_DIALOG(e->dialog)) == GTK_RESPONSE_OK)
response = gtk_dialog_run(GTK_DIALOG(e->dialog)); {
if (response == GTK_RESPONSE_OK) if (update_config(e))
{ {
if (! update_config(e))
goto retry;
stash_group_update(indent_group, e->dialog); stash_group_update(indent_group, e->dialog);
break;
}
} }
build_free_fields(e->build_properties); build_free_fields(e->build_properties);
gtk_widget_destroy(e->dialog); gtk_widget_destroy(e->dialog);
g_free(e); g_free(e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment