Author: cazfi
Date: Thu Oct 27 22:09:59 2016
New Revision: 34271

URL: http://svn.gna.org/viewcvs/freeciv?rev=34271&view=rev
Log:
Moved can_city_sell_universal() present in many guis to a single implementation
in client common code.

See patch #7879

Modified:
    trunk/client/cityrepdata.c
    trunk/client/cityrepdata.h
    trunk/client/gui-gtk-2.0/cityrep.c
    trunk/client/gui-gtk-3.0/cityrep.c
    trunk/client/gui-gtk-3.22/cityrep.c
    trunk/client/gui-qt/cityrep.cpp

Modified: trunk/client/cityrepdata.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/cityrepdata.c?rev=34271&r1=34270&r2=34271&view=diff
==============================================================================
--- trunk/client/cityrepdata.c  (original)
+++ trunk/client/cityrepdata.c  Thu Oct 27 22:09:59 2016
@@ -1034,3 +1034,13 @@
 
   return retval;
 }
+
+/****************************************************************
+  Same as can_city_sell_building(), but with universal argument.
+*****************************************************************/
+bool can_city_sell_universal(const struct city *pcity,
+                             const struct universal *target)
+{
+  return target->kind == VUT_IMPROVEMENT
+    && can_city_sell_building(pcity, target->value.building);
+}

Modified: trunk/client/cityrepdata.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/cityrepdata.h?rev=34271&r1=34270&r2=34271&view=diff
==============================================================================
--- trunk/client/cityrepdata.h  (original)
+++ trunk/client/cityrepdata.h  Thu Oct 27 22:09:59 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -67,6 +67,9 @@
 
 int cityrepfield_compare(const char *field1, const char *field2);
 
+bool can_city_sell_universal(const struct city *pcity,
+                             const struct universal *target);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: trunk/client/gui-gtk-2.0/cityrep.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/cityrep.c?rev=34271&r1=34270&r2=34271&view=diff
==============================================================================
--- trunk/client/gui-gtk-2.0/cityrep.c  (original)
+++ trunk/client/gui-gtk-2.0/cityrep.c  Thu Oct 27 22:09:59 2016
@@ -1719,16 +1719,6 @@
 }
 
 /****************************************************************
-  Same as can_city_sell_building(), but with universal argument.
-*****************************************************************/
-static bool can_city_sell_universal(const struct city *pcity,
-                                    const struct universal *target)
-{
-  return (target->kind == VUT_IMPROVEMENT
-          && can_city_sell_building(pcity, target->value.building));
-}
-
-/****************************************************************
   Update the sell menu.
 *****************************************************************/
 static void recreate_sell_menu(void)

Modified: trunk/client/gui-gtk-3.0/cityrep.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/cityrep.c?rev=34271&r1=34270&r2=34271&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/cityrep.c  (original)
+++ trunk/client/gui-gtk-3.0/cityrep.c  Thu Oct 27 22:09:59 2016
@@ -1738,16 +1738,6 @@
 }
 
 /****************************************************************
-  Same as can_city_sell_building(), but with universal argument.
-*****************************************************************/
-static bool can_city_sell_universal(const struct city *pcity,
-                                    const struct universal *target)
-{
-  return target->kind == VUT_IMPROVEMENT
-    && can_city_sell_building(pcity, target->value.building);
-}
-
-/****************************************************************
   Update the sell menu.
 *****************************************************************/
 static void recreate_sell_menu(void)

Modified: trunk/client/gui-gtk-3.22/cityrep.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.22/cityrep.c?rev=34271&r1=34270&r2=34271&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.22/cityrep.c (original)
+++ trunk/client/gui-gtk-3.22/cityrep.c Thu Oct 27 22:09:59 2016
@@ -1738,16 +1738,6 @@
 }
 
 /****************************************************************
-  Same as can_city_sell_building(), but with universal argument.
-*****************************************************************/
-static bool can_city_sell_universal(const struct city *pcity,
-                                    const struct universal *target)
-{
-  return target->kind == VUT_IMPROVEMENT
-    && can_city_sell_building(pcity, target->value.building);
-}
-
-/****************************************************************
   Update the sell menu.
 *****************************************************************/
 static void recreate_sell_menu(void)

Modified: trunk/client/gui-qt/cityrep.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/cityrep.cpp?rev=34271&r1=34270&r2=34271&view=diff
==============================================================================
--- trunk/client/gui-qt/cityrep.cpp     (original)
+++ trunk/client/gui-qt/cityrep.cpp     Thu Oct 27 22:09:59 2016
@@ -23,9 +23,6 @@
 #include "cityrep.h"
 #include "hudwidget.h"
 #include "qtg_cxxside.h"
-
-static bool can_city_sell_universal(const struct city *pcity,
-                                    const struct universal *target);
 
 /***************************************************************************
   Overriden compare for sorting items
@@ -1233,17 +1230,6 @@
   city_wdg->update_city(pcity);
 }
 
-/****************************************************************
-  Same as can_city_sell_building(), but with universal argument.
-*****************************************************************/
-static bool can_city_sell_universal(const struct city *pcity,
-                                    const struct universal *target)
-{
-  return (target->kind == VUT_IMPROVEMENT
-          && can_city_sell_building(pcity, target->value.building));
-}
-
-
 /**************************************************************************
   Display the city report dialog.  Optionally raise it.
 **************************************************************************/


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to