From 86f136aca99a4d0af02cfa9196d03c6f933f861b Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Wed, 29 Sep 2021 03:41:45 +0300
Subject: [PATCH 40/40] Qt: Use SEX_xxx macros instead of magic values

See osdn #42948

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/gui-qt/dialogs.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/client/gui-qt/dialogs.cpp b/client/gui-qt/dialogs.cpp
index a28729674c..fb23fec42d 100644
--- a/client/gui-qt/dialogs.cpp
+++ b/client/gui-qt/dialogs.cpp
@@ -44,6 +44,7 @@
 #include "movement.h"
 #include "nation.h"
 #include "research.h"
+#include "sex.h"
 
 // client
 #include "audio.h"
@@ -437,7 +438,7 @@ races_dialog::races_dialog(struct player *pplayer,
 
   selected_nation = -1;
   selected_style = -1;
-  selected_sex = -1;
+  selected_sex = SEX_UNKNOWN;
   setWindowTitle(_("Select Nation"));
   selected_nation_tabs->setRowCount(0);
   selected_nation_tabs->setColumnCount(1);
@@ -809,11 +810,11 @@ void races_dialog::leader_selected(int index)
   if (leader_name->itemData(index).toBool()) {
     is_male->setChecked(true);
     is_female->setChecked(false);
-    selected_sex = 1;
+    selected_sex = SEX_MALE;
   } else {
     is_male->setChecked(false);
     is_female->setChecked(true);
-    selected_sex = 0;
+    selected_sex = SEX_FEMALE;
   }
 }
 
@@ -829,7 +830,7 @@ void races_dialog::ok_pressed()
     return;
   }
 
-  if (selected_sex == -1) {
+  if (selected_sex == SEX_UNKNOWN) {
     output_window_append(ftc_client, _("You must select your sex."));
     return;
   }
-- 
2.33.0