[Freeciv-Dev] (PR#11083) unnecessary CM call in gtk2 client
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=11083 >
> [jdorje - Fri Nov 19 09:02:11 2004]:
>
> The CMA call that does all the work is, surprisingly, cm_query_result.
>
> This is called by the gui-gtk-2.0 citydlg code just to get a label text
> for the CMA tab. It should be easy to avoid it.
And a patch.
-jason
Index: client/gui-gtk/cma_fe.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/cma_fe.c,v
retrieving revision 1.23
diff -u -r1.23 cma_fe.c
--- client/gui-gtk/cma_fe.c 24 Nov 2004 03:34:56 -0000 1.23
+++ client/gui-gtk/cma_fe.c 24 Nov 2004 06:05:00 -0000
@@ -336,7 +336,7 @@
cmafec_get_fe_parameter(pcity, ¶m);
/* fill in result label */
- cm_query_result(pcity, ¶m, &result);
+ cm_copy_result_from_city(pcity, &result);
gtk_set_label(pdialog->result_label,
(char *) cmafec_get_result_descr(pcity, &result, ¶m));
Index: client/gui-gtk-2.0/cma_fe.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/cma_fe.c,v
retrieving revision 1.22
diff -u -r1.22 cma_fe.c
--- client/gui-gtk-2.0/cma_fe.c 24 Nov 2004 03:34:56 -0000 1.22
+++ client/gui-gtk-2.0/cma_fe.c 24 Nov 2004 06:05:00 -0000
@@ -354,7 +354,7 @@
cmafec_get_fe_parameter(pcity, ¶m);
/* fill in result label */
- cm_query_result(pcity, ¶m, &result);
+ cm_copy_result_from_city(pcity, &result);
gtk_label_set_text(GTK_LABEL(pdialog->result_label),
cmafec_get_result_descr(pcity, &result, ¶m));
Index: client/gui-mui/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/citydlg.c,v
retrieving revision 1.84
diff -u -r1.84 citydlg.c
--- client/gui-mui/citydlg.c 24 Nov 2004 03:34:56 -0000 1.84
+++ client/gui-mui/citydlg.c 24 Nov 2004 06:05:01 -0000
@@ -2130,7 +2130,7 @@
cmafec_get_fe_parameter(pcity, ¶m);
/* fill in result label */
- cm_query_result(pcity, ¶m, &result);
+ cm_copy_result_from_city(pcity, &result);
if (!result.found_a_valid) {
for (i = 0; i < 10; i++)
Index: client/gui-sdl/cma_fe.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/cma_fe.c,v
retrieving revision 1.14
diff -u -r1.14 cma_fe.c
--- client/gui-sdl/cma_fe.c 24 Nov 2004 03:34:56 -0000 1.14
+++ client/gui-sdl/cma_fe.c 24 Nov 2004 06:05:01 -0000
@@ -658,7 +658,7 @@
redraw_group(pBuf->prev, pBuf, 0);
/* fill in result label */
- cm_query_result(pCma->pCity, &pCma->edited_cm_parm, &result);
+ cm_copy_result_from_city(pCma->pCity, &result);
if(result.found_a_valid) {
/* redraw resources */
Index: client/gui-win32/cma_fe.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/cma_fe.c,v
retrieving revision 1.3
diff -u -r1.3 cma_fe.c
--- client/gui-win32/cma_fe.c 24 Nov 2004 03:34:56 -0000 1.3
+++ client/gui-win32/cma_fe.c 24 Nov 2004 06:05:01 -0000
@@ -256,7 +256,7 @@
if (!pdialog)
return;
/* fill in result label */
- cm_query_result(pcity, ¶m, &result);
+ cm_copy_result_from_city(pcity, &result);
SetWindowText(pdialog->result_label,
(char *) cmafec_get_result_descr(pcity, &result, ¶m));
/* if called from a hscale, we _don't_ want to do this */
Index: client/gui-xaw/cma_fe.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/cma_fe.c,v
retrieving revision 1.3
diff -u -r1.3 cma_fe.c
--- client/gui-xaw/cma_fe.c 24 Nov 2004 03:34:56 -0000 1.3
+++ client/gui-xaw/cma_fe.c 24 Nov 2004 06:05:01 -0000
@@ -359,7 +359,7 @@
XtRealizeWidget(cma_dialog);
update_stat_labels(True);
- cm_query_result(current_city, ¶meter, &result);
+ cm_copy_result_from_city(pcity, &result);
xaw_set_label(result_label,
(char *) cmafec_get_result_descr(current_city, &result, ¶meter));
@@ -503,7 +503,7 @@
}
cmafec_get_fe_parameter(current_city, ¶meter);
- cm_query_result(current_city, ¶meter, &result);
+ cm_copy_result_from_city(pcity, &result);
xaw_set_label(result_label,
(char *) cmafec_get_result_descr(current_city, &result, ¶meter));
@@ -613,7 +613,7 @@
}
cmafec_get_fe_parameter(current_city, ¶meter);
- cm_query_result(current_city, ¶meter, &result);
+ cm_copy_result_from_city(pcity, &result);
xaw_set_label(result_label,
(char *) cmafec_get_result_descr(current_city, &result, ¶meter));
@@ -671,7 +671,7 @@
}
cmafec_get_fe_parameter(current_city, ¶meter);
- cm_query_result(current_city, ¶meter, &result);
+ cm_copy_result_from_city(pcity, &result);
xaw_set_label(result_label,
(char *) cmafec_get_result_descr(current_city, &result, ¶meter));
@@ -792,7 +792,7 @@
}
cmafec_get_fe_parameter(current_city, ¶meter);
- cm_query_result(current_city, ¶meter, &result);
+ cm_copy_result_from_city(pcity, &result);
xaw_set_label(result_label,
(char *) cmafec_get_result_descr(current_city, &result, ¶meter));
|
|