Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #855482 » 0014-Qt-Don-t-compare-equality-to-true-or-false.patch

S2_6 - Marko Lindqvist, 2020-01-10 07:27 PM

View differences:

client/gui-qt/chatline.cpp
327 327
***************************************************************************/
328 328
void chatwdg::toggle_size()
329 329
{
330
  if (gui()->infotab->chat_maximized == true) {
330
  if (gui()->infotab->chat_maximized) {
331 331
    gui()->infotab->restore_chat();
332 332
    return;
333
  }
334
  if (gui()->infotab->chat_maximized == false) {
333
  } else {
335 334
    gui()->infotab->maximize_chat();
336 335
    chat_line->setFocus();
337 336
  }
client/gui-qt/citydlg.cpp
680 680
  img = unit_pixmap->map_pixmap.toImage();
681 681
  crop = zealous_crop_rect(img);
682 682
  cropped_img = img.copy(crop);
683
  if (tileset_is_isometric(tileset) == true) {
683
  if (tileset_is_isometric(tileset)) {
684 684
    unit_img = cropped_img.scaledToHeight(tileset_unit_width(get_tileset())
685 685
                                          * isosize, Qt::SmoothTransformation);
686 686
  } else {
......
2041 2041
****************************************************************************/
2042 2042
void city_dialog::update_happiness_button()
2043 2043
{
2044
  if (happines_shown == false) {
2045
    happiness_button->setToolTip(_("Show happiness information"));
2046
  } else {
2044
  if (happines_shown) {
2047 2045
    happiness_button->setToolTip(_("Show city production"));
2046
  } else {
2047
    happiness_button->setToolTip(_("Show happiness information"));
2048 2048
  }
2049 2049
}
2050 2050

  
......
2055 2055
{
2056 2056
  setUpdatesEnabled(false);
2057 2057

  
2058
  if (happines_shown == false) {
2058
  if (!happines_shown) {
2059 2059
    leftbot_layout->replaceWidget(prod_unit_splitter,
2060 2060
                                  happiness_widget,
2061 2061
                                  Qt::FindDirectChildrenOnly);
......
2180 2180
****************************************************************************/
2181 2181
void city_dialog::showEvent(QShowEvent *event)
2182 2182
{
2183
  if (gui()->qt_settings.city_geometry.isNull() == false) {
2183
  if (!gui()->qt_settings.city_geometry.isNull()) {
2184 2184
    restoreGeometry(gui()->qt_settings.city_geometry);
2185 2185
    prod_unit_splitter->restoreState(gui()->qt_settings.city_splitter1);
2186 2186
    central_left_splitter->restoreState(gui()->qt_settings.city_splitter2);
......
2409 2409
  QVariant qvar;
2410 2410
  QLabel *label;
2411 2411

  
2412
  if (cma_is_city_under_agent(pcity, &param) == false) {
2412
  if (!cma_is_city_under_agent(pcity, &param)) {
2413 2413
    if (cma_table->currentRow() == -1 || cmafec_preset_num() == 0) {
2414 2414
      return;
2415 2415
    }
......
3948 3948

  
3949 3949
  qvar = index.data();
3950 3950

  
3951
  if (qvar.isValid() == false) {
3951
  if (!qvar.isValid()) {
3952 3952
    return;
3953 3953
  }
3954 3954

  
......
3977 3977
        && !uclass_has_flag(pclass, UCF_CAN_FORTIFY)
3978 3978
        && !uclass_has_flag(pclass, UCF_ZOC))
3979 3979
        || uclass_has_flag(pclass, UCF_MISSILE)) {
3980
      if (is_sea == true) {
3980
      if (is_sea) {
3981 3981
        is_sea = false;
3982 3982
      }
3983 3983
      is_flying = true;
......
4042 4042

  
4043 4043
  painter->restore();
4044 4044

  
4045
  if (free_sprite == TRUE) {
4045
  if (free_sprite) {
4046 4046
    qtg_free_sprite(sprite);
4047 4047
  }
4048 4048
}
......
4202 4202
        str = utype_name_translation(renegade->value.utype);
4203 4203
        sh.setX(qMax(sh.x(), fm.width(str)));
4204 4204

  
4205
        if (show_units == true) {
4205
        if (show_units) {
4206 4206
          pi = new production_item(renegade, this);
4207 4207
          city_target_list << pi;
4208 4208
        }
......
4382 4382
  index = indexes.at(0);
4383 4383
  qvar = index.data(Qt::UserRole);
4384 4384

  
4385
  if (qvar.isValid() == false) {
4385
  if (!qvar.isValid()) {
4386 4386
    return;
4387 4387
  }
4388 4388

  
client/gui-qt/cityrep.cpp
499 499
  if (!can_client_issue_orders()) {
500 500
    return;
501 501
  }
502
  if (select_only == false) {
502
  if (!select_only) {
503 503
    some_menu = list_menu.addMenu(_("Production"));
504 504
    tmp_menu = some_menu->addMenu(_("Change"));
505 505
    fill_production_menus(CHANGE_PROD_NOW, custom_labels, can_city_build_now,
......
540 540
  }
541 541
  some_menu = list_menu.addMenu(_("Select"));
542 542
  gen_select_labels(some_menu);
543
  if (select_only == false) {
543
  if (!select_only) {
544 544
    list_menu.addAction(&cty_view);
545 545
    connect(&cty_view, &QAction::triggered, this, &city_widget::city_view);
546 546
    list_menu.addAction(&cty_buy);
......
1263 1263
    i = gui()->gimme_index_of("CTS");
1264 1264
    fc_assert(i != -1);
1265 1265
    w = gui()->game_tab_widget->widget(i);
1266
    if (w->isVisible() == true) {
1266
    if (w->isVisible()) {
1267 1267
      gui()->game_tab_widget->setCurrentIndex(0);
1268 1268
      return;
1269 1269
    }
client/gui-qt/dialogs.cpp
210 210
***************************************************************************/
211 211
void qfc_dialog::mouseMoveEvent(QMouseEvent *event)
212 212
{
213
  if (moving_now == true) {
213
  if (moving_now) {
214 214
    move(event->globalPos() - point);
215 215
  }
216 216
}
......
1392 1392
      new_target = ptgt;
1393 1393
      first = false;
1394 1394
    }
1395
    if (break_next == true) {
1395
    if (break_next) {
1396 1396
      new_target = ptgt;
1397 1397
      break;
1398 1398
    }
......
2950 2950

  
2951 2951
  update_units();
2952 2952
  if (unit_list.count() > 0) {
2953
  if (tileset_is_isometric(tileset) == false) {
2953
  if (!tileset_is_isometric(tileset)) {
2954 2954
    item_size.setWidth(tileset_unit_width(tileset));
2955 2955
    item_size.setHeight(tileset_unit_width(tileset));
2956 2956
  } else {
......
2986 2986
    img = unit_pixmap->map_pixmap.toImage();
2987 2987
    crop = zealous_crop_rect(img);
2988 2988
    cropped_img = img.copy(crop);
2989
    if (tileset_is_isometric(tileset) == false) {
2989
    if (!tileset_is_isometric(tileset)) {
2990 2990
      img = cropped_img.scaled(tileset_unit_width(tileset),
2991 2991
                               tileset_unit_width(tileset),
2992 2992
                               Qt::KeepAspectRatio,
......
3160 3160
      painter->drawText(10, height() - 5, str2);
3161 3161
    }
3162 3162
    /* draw scroll */
3163
    if (more == true) {
3163
    if (more) {
3164 3164
      int maxl = ((unit_count - 1) / 4) + 1;
3165 3165
      float page_height = 3.0f / maxl;
3166 3166
      float page_start = (static_cast<float>(show_line)) / maxl;
......
3252 3252
{
3253 3253
  int nr;
3254 3254

  
3255
  if (more == false && utile == NULL) {
3255
  if (!more && utile == NULL) {
3256 3256
    return;
3257 3257
  }
3258 3258
  nr = qCeil(static_cast<qreal>(unit_list_size(utile->units)) / 4) - 3;
......
3356 3356
                           int attacker_hp, int defender_hp,
3357 3357
                           bool make_winner_veteran)
3358 3358
{
3359
  if (gui()->qt_settings.show_battle_log == true) {
3359
  if (gui()->qt_settings.show_battle_log) {
3360 3360
    hud_unit_combat* huc = new hud_unit_combat(attacker_unit_id,
3361 3361
                                              defender_unit_id,
3362 3362
                                              attacker_hp, defender_hp,
client/gui-qt/fc_client.cpp
144 144
  // General part not related to any single page
145 145
  menu_bar = new mr_menu();
146 146
  corner_wid = new fc_corner(this);
147
  if (gui_options.gui_qt_show_titlebar == false) {
147
  if (!gui_options.gui_qt_show_titlebar) {
148 148
    menu_bar->setCornerWidget(corner_wid);
149 149
  }
150 150
  setMenuBar(menu_bar);
......
180 180
  // PAGE_GAME
181 181
  gui_options.gui_qt_allied_chat_only = true;
182 182
  path = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
183
  if (path.isEmpty() == false) {
183
  if (!path.isEmpty()) {
184 184
    QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, path);
185 185
  }
186 186
  pages[PAGE_GAME] = new QWidget(central_wdg);
......
356 356
    update_load_page();
357 357
    break;
358 358
  case PAGE_GAME:
359
    if (gui_options.gui_qt_show_titlebar == false) {
359
    if (!gui_options.gui_qt_show_titlebar) {
360 360
      setWindowFlags(Qt::Window | Qt::CustomizeWindowHint);
361 361
    }
362 362
    showMaximized();
......
592 592
{
593 593
  QSettings s(QSettings::IniFormat, QSettings::UserScope,
594 594
              "freeciv-qt-client");
595
  if (s.contains("Fonts-set") == false) {
595
  if (!s.contains("Fonts-set")) {
596 596
    configure_fonts();
597 597
  }
598 598
  if (s.contains("Chat-fx-size")) {
......
799 799
void fc_client::remove_repo_dlg(QString str)
800 800
{
801 801
  /* if app is closing opened_repo_dlg is already deleted */
802
  if (is_closing() == false) {
802
  if (!is_closing()) {
803 803
    opened_repo_dlgs.remove(str);
804 804
  }
805 805
}
......
897 897
****************************************************************************/
898 898
void fc_corner::maximize()
899 899
{
900
  if (mw->isMaximized() == false) {
900
  if (!mw->isMaximized()) {
901 901
    mw->showMaximized();
902 902
  } else {
903 903
    mw->showNormal();
......
999 999
                                 + DIR_SEPARATOR
1000 1000
                                 + id + ".png").toLocal8Bit().data()));
1001 1001

  
1002
  if (status == false) {
1002
  if (!status) {
1003 1003
    str = str + "icons" + DIR_SEPARATOR;
1004 1004
    pm->load(fileinfoname(get_data_dirs(), QString(str
1005 1005
                          + id + ".png").toLocal8Bit().data()));
client/gui-qt/fonts.cpp
153 153
     << "Ubuntu" << "Noto Sans" << "DejaVu Sans" << "Luxi Sans"
154 154
     << "Lucida Sans" << "Trebuchet MS" << "Times New Roman";
155 155
  font_name = configure_font(fonts::default_font, sl, max);
156
  if (font_name.isEmpty() == false) {
156
  if (!font_name.isEmpty()) {
157 157
    fc_strlcpy(gui_options.gui_qt_font_default,
158 158
               font_name.toLocal8Bit().data(), 512);
159 159
  }
160 160
  font_name = configure_font(fonts::help_label, sl, max);
161
  if (font_name.isEmpty() == false) {
161
  if (!font_name.isEmpty()) {
162 162
    fc_strlcpy(gui_options.gui_qt_font_help_label,
163 163
               font_name.toLocal8Bit().data(), 512);
164 164
  }
165 165
  font_name = configure_font(fonts::city_names, sl, smaller, true);
166
  if (font_name.isEmpty() == false) {
166
  if (!font_name.isEmpty()) {
167 167
    fc_strlcpy(gui_options.gui_qt_font_city_names,
168 168
               font_name.toLocal8Bit().data(), 512);
169 169
  }
170 170
  /* default for help text */
171 171
  font_name = configure_font(fonts::help_text, sl, default_size);
172
  if (font_name.isEmpty() == false) {
172
  if (!font_name.isEmpty()) {
173 173
    fc_strlcpy(gui_options.gui_qt_font_help_text,
174 174
               font_name.toLocal8Bit().data(), 512);
175 175
  }
......
180 180
      << "Source Code Pro [ADBO]"
181 181
      << "Noto Mono" << "Ubuntu Mono" << "Courier New";
182 182
  font_name = configure_font(fonts::notify_label, sl, default_size);
183
  if (font_name.isEmpty() == false) {
183
  if (!font_name.isEmpty()) {
184 184
    fc_strlcpy(gui_options.gui_qt_font_notify_label,
185 185
               font_name.toLocal8Bit().data(), 512);
186 186
  }
187 187
  font_name = configure_font(fonts::comment_label, sl, default_size);
188
  if (font_name.isEmpty() == false) {
188
  if (!font_name.isEmpty()) {
189 189
    fc_strlcpy(gui_options.gui_qt_font_comment_label,
190 190
               font_name.toLocal8Bit().data(), 512);
191 191
  }
192 192

  
193 193
  /* the same font for city label but smaller */
194 194
  font_name = configure_font(fonts::city_label, sl, smaller);
195
  if (font_name.isEmpty() == false) {
195
  if (!font_name.isEmpty()) {
196 196
    fc_strlcpy(gui_options.gui_qt_font_city_label,
197 197
               font_name.toLocal8Bit().data(), 512);
198 198
  }
199 199
  /* standard for chat */
200 200
  font_name = configure_font(fonts::chatline, sl, default_size);
201
  if (font_name.isEmpty() == false) {
201
  if (!font_name.isEmpty()) {
202 202
    fc_strlcpy(gui_options.gui_qt_font_chatline,
203 203
               font_name.toLocal8Bit().data(), 512);
204 204
  }
......
208 208
  sl  <<  "Segoe Print" << "Papyrus" << "Vladimir Script"
209 209
      << "Comic Sans MS" << "Droid Sans" << "Noto Sans";
210 210
  font_name = configure_font(fonts::help_title, sl, max, true);
211
  if (font_name.isEmpty() == false) {
211
  if (!font_name.isEmpty()) {
212 212
    fc_strlcpy(gui_options.gui_qt_font_help_title,
213 213
               font_name.toLocal8Bit().data(), 512);
214 214
  }
......
218 218
      << "Droid Sans" << "Noto Sans";
219 219
  font_name = configure_font(fonts::city_productions, sl, default_size,
220 220
                             true);
221
  if (font_name.isEmpty() == false) {
221
  if (!font_name.isEmpty()) {
222 222
    fc_strlcpy(gui_options.gui_qt_font_city_productions,
223 223
               font_name.toLocal8Bit().data(), 512);
224 224
  }
......
227 227
  sl  << "Papyrus" << "Segoe Script" << "Comic Sans MS"
228 228
      << "Droid Sans" << "Noto Sans" << "Ubuntu";
229 229
  font_name = configure_font(fonts::reqtree_text, sl, max, true);
230
  if (font_name.isEmpty() == false) {
230
  if (!font_name.isEmpty()) {
231 231
    fc_strlcpy(gui_options.gui_qt_font_reqtree_text,
232 232
               font_name.toLocal8Bit().data(), 512);
233 233
  }
client/gui-qt/gui_main.cpp
361 361
    return;
362 362
  }
363 363

  
364
  if (val == true) {
364
  if (val) {
365 365
    w = new QWidget();
366 366
    gui()->setWindowFlags(flags);
367 367
    delete gui()->corner_wid;
client/gui-qt/helpdlg.cpp
200 200
{
201 201
  QList<int> sizes;
202 202

  
203
  if (gui()->qt_settings.help_geometry.isNull() == false) {
203
  if (!gui()->qt_settings.help_geometry.isNull()) {
204 204
    restoreGeometry(gui()->qt_settings.help_geometry);
205 205
    splitter->restoreState(gui()->qt_settings.help_splitter1);
206 206
  } else {
207 207
    QRect rect = QApplication::desktop()->screenGeometry();
208

  
208 209
    resize((rect.width() * 3) / 5, (rect.height() * 3) / 6);
209 210
    sizes << rect.width() / 10 << rect.width() / 3;
210 211
    splitter->setSizes(sizes);
......
327 328
        break;
328 329
      }
329 330

  
330
      if (icon.isNull() == false) {
331
      if (!icon.isNull()) {
331 332
        item->setIcon(0, icon);
332 333
      }
333 334

  
......
416 417

  
417 418
  help_wdg->set_topic(topics_map[item]);
418 419

  
419
  if (update_history == true) {
420
  if (update_history) {
420 421
    history_pos++;
421 422
    item_history.append(item);
422 423
  } else {
......
1020 1021
      break;
1021 1022
    } requirement_vector_iterate_end;
1022 1023

  
1023
    if (s1.isEmpty() == false) {
1024
    if (!s1.isEmpty()) {
1024 1025
      tb = new QLabel(this);
1025 1026
      str = _("Requirement:");
1026 1027
      str = "<b>" + str + "</b> " + s1;
......
1043 1044

  
1044 1045
    str = _("Obsolete by:");
1045 1046
    str = "<b>" + str + "</b> " + s2;
1046
    if (s2.isEmpty() == false) {
1047
    if (!s2.isEmpty()) {
1047 1048
      tb = new QLabel(this);
1048 1049
      tb->setProperty(fonts::help_label, "true");
1049 1050
      tb->setTextInteractionFlags(Qt::LinksAccessibleByMouse);
client/gui-qt/hudwidget.cpp
276 276
  int w;
277 277
  QPoint p;
278 278
  w = width();
279
  if (bound_rect.isEmpty() == false) {
279
  if (!bound_rect.isEmpty()) {
280 280
    setFixedSize(bound_rect.width(), bound_rect.height());
281 281
  }
282 282
  p = QPoint((parentWidget()->width() - w) / 2,
......
716 716
  font_width = (fm->width(move_pt_text) * 3) / 5;
717 717
  delete fm;
718 718
  p.setFont(font);
719
  if (fraction1.isNull() == false) {
719
  if (!fraction1.isNull()) {
720 720
    int t = 2 * font.pointSize();
721

  
721 722
    crop = QRect(bounding_rect.right() - font_width,
722 723
                 bounding_rect.top(), t, (t / 5) * 4);
723 724
    p.drawText(crop, Qt::AlignLeft | Qt::AlignBottom, fraction1);
......
831 832
  p.drawPixmap(rx, *action_pixmap, ry);
832 833
  p.setPen(QColor(palette().color(QPalette::Text)));
833 834
  p.drawRect(rz);
834
   if (focus == true) {
835
     p.setCompositionMode(QPainter::CompositionMode_DestinationOver);
836
     p.fillRect(rx, QColor(palette().color(QPalette::Highlight)));
837
   }
835
  if (focus) {
836
    p.setCompositionMode(QPainter::CompositionMode_DestinationOver);
837
    p.fillRect(rx, QColor(palette().color(QPalette::Highlight)));
838
  }
838 839
  p.end();
839 840

  
840 841
}
......
1627 1628
    }
1628 1629
  } extra_type_by_cause_iterate_end;
1629 1630

  
1630
  if (has_road == true) {
1631
  if (has_road) {
1631 1632
    ret = ret + QString(_("Movement cost: %1")).arg(move_text);
1632 1633
  } else {
1633 1634
    ret = ret + QString(_("Movement cost: %1")).arg(movement_cost);
......
1647 1648
  struct research *research;
1648 1649
  int i;
1649 1650

  
1650
  if (client_has_player() == false
1651
      || gui()->qt_settings.show_new_turn_text == false) {
1651
  if (!client_has_player()
1652
      || !gui()->qt_settings.show_new_turn_text) {
1652 1653
    return;
1653 1654
  }
1654 1655
  close_list = gui()->mapview_wdg->findChildren<hud_text *>();
......
1727 1728
                                      tileset_unit_height(tileset));
1728 1729
  defender_pixmap->map_pixmap.fill(Qt::transparent);
1729 1730
  if (defender != nullptr) {
1730
    if (redraw == false) {
1731
    if (!redraw) {
1731 1732
      put_unit(defender, defender_pixmap,  1.0, 0, 0);
1732 1733
    } else {
1733 1734
      put_unittype(type_defender, defender_pixmap, 1.0,  0, 0);
......
1751 1752
                                      tileset_unit_height(tileset));
1752 1753
  attacker_pixmap->map_pixmap.fill(Qt::transparent);
1753 1754
  if (attacker != nullptr) {
1754
    if (redraw == false) {
1755
    if (!redraw) {
1755 1756
      put_unit(attacker, attacker_pixmap, 1,  0, 0);
1756 1757
    } else {
1757 1758
      put_unittype(type_attacker, attacker_pixmap, 1,  0, 0);
......
1846 1847
  if (fading < 1.0) {
1847 1848
    p.setOpacity(fading);
1848 1849
  }
1849
  if (focus == true) {
1850
  if (focus) {
1850 1851
    p.fillRect(left, QColor(palette().color(QPalette::Highlight)));
1851 1852
    p.fillRect(right, QColor(palette().color(QPalette::Highlight)));
1852 1853
    c1.setAlpha(110);
......
2069 2070
  hud_unit_combat *hupdate;
2070 2071
  if (m_timer.elapsed() > 4000 && m_timer.elapsed() < 5000) {
2071 2072
    foreach (hudc, lhuc) {
2072
      if (hudc->get_focus() == true) {
2073
      if (hudc->get_focus()) {
2073 2074
        m_timer.restart();
2074 2075
        foreach (hupdate, lhuc) {
2075 2076
          hupdate->set_fading(1.0);
client/gui-qt/luaconsole.cpp
74 74
void qload_lua_script()
75 75
{
76 76
  QString str;
77

  
77 78
  str = QString(_("Lua scripts")) + QString(" (*.lua)");
78 79
  qlua_filename = QFileDialog::getOpenFileName(gui()->central_wdg,
79 80
                                              _("Load lua script"),
80 81
                                              QDir::homePath(), str);
81
  if (qlua_filename.isEmpty() == false) {
82
  if (!qlua_filename.isEmpty()) {
82 83
    script_client_do_file(qlua_filename.toLocal8Bit().constData());
83 84
  }
84 85
}
......
88 89
***************************************************************************/
89 90
void qreload_lua_script()
90 91
{
91
  if (qlua_filename.isEmpty() == false) {
92
  if (!qlua_filename.isEmpty()) {
92 93
    script_client_do_file(qlua_filename.toLocal8Bit().constData());
93 94
  }
94 95
}
client/gui-qt/mapctrl.cpp
178 178
      return;
179 179
    case Qt::Key_Escape:
180 180
      key_cancel_action();
181
      if (gui()->infotab->chat_maximized == true) {
181
      if (gui()->infotab->chat_maximized) {
182 182
        gui()->infotab->restore_chat();
183 183
      }
184 184
      return;
185 185
    case Qt::Key_Enter:
186 186
    case Qt::Key_Return:
187
      if (gui()->infotab->chat_maximized == false) {
187
      if (!gui()->infotab->chat_maximized) {
188 188
        gui()->infotab->maximize_chat();
189 189
        gui()->infotab->chtwdg->chat_line->setFocus();
190 190
      }
......
224 224
  /* Trade Generator - skip */
225 225
  sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
226 226
  if (bt == sc->mouse && md == sc->mod
227
      && gui()->trade_gen.hover_city == true) {
227
      && gui()->trade_gen.hover_city) {
228 228
    ptile = canvas_pos_to_tile(pos.x(), pos.y());
229 229
    gui()->trade_gen.add_tile(ptile);
230 230
    gui()->mapview_wdg->repaint();
......
233 233

  
234 234
  /* Rally point - select city - skip */
235 235
  if (bt == sc->mouse && md == sc->mod
236
      && gui()->rallies.hover_city == true) {
236
      && gui()->rallies.hover_city) {
237 237
    char text[1024];
238

  
238 239
    ptile = canvas_pos_to_tile(pos.x(), pos.y());
239 240
    if (tile_city(ptile)) {
240 241
      gui()->rallies.hover_tile = true;
......
259 260
  }
260 261

  
261 262
  /* Rally point - select tile  - skip */
262
  if (bt == Qt::LeftButton && gui()->rallies.hover_tile == true) {
263
  if (bt == Qt::LeftButton && gui()->rallies.hover_tile) {
263 264
    char text[1024];
264 265
    qfc_rally *rally = new qfc_rally;
265 266
    rally->ptile = canvas_pos_to_tile(pos.x(), pos.y());
......
273 274
    return;
274 275
  }
275 276

  
276
  if (bt == Qt::LeftButton && gui()->menu_bar->delayed_order == true) {
277
  if (bt == Qt::LeftButton && gui()->menu_bar->delayed_order) {
277 278
    ptile = canvas_pos_to_tile(pos.x(), pos.y());
278 279
    gui()->menu_bar->set_tile_for_order(ptile);
279 280
    set_hover_state(NULL, HOVER_NONE, ACTIVITY_LAST, NULL, ORDER_LAST);
......
281 282
    gui()->menu_bar->delayed_order = false;
282 283
    return;
283 284
  }
284
  if (bt == Qt::LeftButton  && gui()->infotab->chat_maximized == true) {
285
  if (bt == Qt::LeftButton  && gui()->infotab->chat_maximized) {
285 286
    gui()->infotab->restore_chat();
286 287
  }
287
  if (bt  == Qt::LeftButton && gui()->menu_bar->quick_airlifting == true) {
288
  if (bt  == Qt::LeftButton && gui()->menu_bar->quick_airlifting) {
288 289
    ptile = canvas_pos_to_tile(pos.x(), pos.y());
289 290
    if (tile_city(ptile)) {
290 291
      multiairlift(tile_city(ptile), gui()->menu_bar->airlift_type_id);
......
295 296
    return;
296 297
  }
297 298
  /* Check configured shortcuts */
298
  if (gui()->menu_bar->delayed_order == false) {
299
  if (!gui()->menu_bar->delayed_order) {
299 300
    sc = fc_shortcuts::sc()->get_shortcut(SC_QUICK_SELECT);
300 301
    if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
301 302
        && pcity != nullptr) {
......
404 405
  }
405 406
  sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
406 407
  if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
407
    if (goto_is_active() == false) {
408
    if (!goto_is_active()) {
408 409
      stored_autocenter = gui_options.auto_center_on_unit;
409 410
      gui_options.auto_center_on_unit = false;
410 411
      action_button_pressed(pos.x(), pos.y(), SELECT_FOCUS);
......
445 446

  
446 447
  sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
447 448
  if (bt == sc->mouse && md == sc->mod) {
448
    if (gui()->trade_gen.hover_city == true
449
        || gui()->rallies.hover_city == true) {
449
    if (gui()->trade_gen.hover_city
450
        || gui()->rallies.hover_city) {
450 451
      gui()->trade_gen.hover_city = false;
451 452
      gui()->rallies.hover_city = false;
452 453
      return;
453 454
    }
454
    if (menu_click == true) {
455
    if (menu_click) {
455 456
      menu_click = false;
456 457
      return;
457 458
    }
458
    if (keyboardless_goto_active == false || goto_is_active() == true) {
459
    if (!keyboardless_goto_active || goto_is_active()) {
459 460
      action_button_pressed(pos.x(), pos.y(), SELECT_POPUP);
460 461
      gui_options.auto_center_on_unit = stored_autocenter;
461 462
    }
client/gui-qt/mapview.cpp
340 340
   */
341 341

  
342 342
  for (i = 0; i < widgets.count(); i++) {
343
    if (widgets[i]->isVisible() == false) {
343
    if (!widgets[i]->isVisible()) {
344 344
      continue;
345 345
    }
346 346
    x = widgets[i]->pos().x();
......
405 405
****************************************************************************/
406 406
void move_widget::mouseMoveEvent(QMouseEvent *event)
407 407
{
408
  if(gui()->interface_locked == false) {
408
  if (!gui()->interface_locked) {
409 409
    parentWidget()->move(event->globalPos() - point);
410 410
  }
411 411
}
......
415 415
****************************************************************************/
416 416
void move_widget::mousePressEvent(QMouseEvent* event)
417 417
{
418
  if (gui()->interface_locked == false) {
418
  if (!gui()->interface_locked) {
419 419
    point = event->globalPos() - parentWidget()->geometry().topLeft();
420 420
  }
421 421
  update();
......
826 826
**************************************************************************/
827 827
void minimap_view::update_image()
828 828
{
829
  if (isHidden() == true ) {
829
  if (isHidden()) {
830 830
    return;
831 831
  }
832 832
  thread.render(scale_factor, width(), height());
client/gui-qt/menu.cpp
315 315
      tc->curr_tr_cities.clear();
316 316
      tc->done = false;
317 317
      foreach (ttc, cities) {
318
        if (have_cities_trade_route(tc->city, ttc->city) == false
318
        if (!have_cities_trade_route(tc->city, ttc->city)
319 319
            && can_establish_trade_route(tc->city, ttc->city)) {
320 320
          tc->poss_trade_num++;
321 321
          tc->pos_cities.append(ttc->city);
......
399 399

  
400 400
  for (int i = j; i > -j; i--) {
401 401
    while ((tc = find_most_free())) {
402
      if (discard_one(tc) == false) {
403
        if (discard_any(tc, i) == false) {
402
      if (!discard_one(tc)) {
403
        if (!discard_any(tc, i)) {
404 404
          break;
405 405
        }
406 406
      }
......
572 572
{
573 573
  if (C_S_RUNNING <= client_state()) {
574 574
    gui()->menuBar()->setVisible(true);
575
    if (is_waiting_turn_change() == false) {
575
    if (!is_waiting_turn_change()) {
576 576
      gui()->menu_bar->menus_sensitive();
577 577
      gui()->menu_bar->update_airlift_menu();
578 578
      gui()->menu_bar->update_roads_menu();
......
1719 1719
        }
1720 1720
        break;
1721 1721
      case NOT_4_OBS:
1722
        if (client_is_observer() == false) {
1722
        if (!client_is_observer()) {
1723 1723
          i.value()->setEnabled(true);
1724 1724
        }
1725 1725
        break;
1726 1726
      case MULTIPLIERS:
1727
        if (client_is_observer() == false && multiplier_count() > 0) {
1727
        if (!client_is_observer() && multiplier_count() > 0) {
1728 1728
          i.value()->setEnabled(true);
1729 1729
          i.value()->setVisible(true);
1730 1730
        } else {
......
1746 1746
    }
1747 1747
  }
1748 1748

  
1749
  if (can_client_issue_orders() == false || get_num_units_in_focus() == 0) {
1749
  if (!can_client_issue_orders() || get_num_units_in_focus() == 0) {
1750 1750
    return;
1751 1751
  }
1752 1752

  
......
3247 3247
  }
3248 3248
  map_canvas_resized(full_size_x, full_size_y);
3249 3249
  img_name = QString("FreeCiv-Turn%1").arg(game.info.turn);
3250
  if (client_has_player() == true) {
3250
  if (client_has_player()) {
3251 3251
    img_name = img_name + "-"
3252 3252
                + QString(nation_plural_for_player(client_player()));
3253 3253
  }
3254 3254
  path = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
3255
  if (path.isEmpty() == false) {
3255
  if (!path.isEmpty()) {
3256 3256
    img_name = path + DIR_SEPARATOR + img_name;
3257 3257
  } else {
3258 3258
    img_name = QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
......
3297 3297
  current_file = QFileDialog::getSaveFileName(gui()->central_wdg,
3298 3298
                                              _("Save Game As..."),
3299 3299
                                              location, str);
3300
  if (current_file.isEmpty() == false) {
3300
  if (!current_file.isEmpty()) {
3301 3301
    send_save_game(current_file.toLocal8Bit().data());
3302 3302
  }
3303 3303
}
client/gui-qt/optiondlg.cpp
295 295
  QCheckBox *c;
296 296

  
297 297
  c = reinterpret_cast<QCheckBox *>(option_get_gui_data(poption));
298
  if (value == true) {
298
  if (value) {
299 299
    c->setCheckState(Qt::Checked);
300 300
  } else {
301 301
    c->setCheckState(Qt::Unchecked);
......
345 345
  qApp->processEvents();
346 346
  qp = reinterpret_cast<QPushButton *>(option_get_gui_data(poption));
347 347
  ql = s.split(",");
348
  if (s.isEmpty() == false) {
348
  if (!s.isEmpty()) {
349 349
    qp->setText(ql[0] + " " + ql[1]);
350 350
    qp->setFont(*fp);
351 351
  }
client/gui-qt/pages.cpp
444 444
void fc_client::clear_status_bar()
445 445
{
446 446
  QString str;
447
  if (status_bar_queue.isEmpty() == false) {
447

  
448
  if (!status_bar_queue.isEmpty()) {
448 449
    str = status_bar_queue.takeFirst();
449 450
    status_bar_label->setText(str);
450 451
    QTimer::singleShot(2000, this, SLOT(clear_status_bar()));
......
1238 1239
        pl_str = QString("player") + QString::number(i);
1239 1240
        if ((sf = secfile_load_section(current_file.toLocal8Bit().data(),
1240 1241
                                       pl_str.toLocal8Bit().data(), true))) {
1241
          if ((sbool = secfile_lookup_bool_default(sf, true,
1242
          if (!(sbool = secfile_lookup_bool_default(sf, true,
1242 1243
                                       "player%d.unassigned_user",
1243
                                       i)) == false) {
1244
                                       i))) {
1244 1245
              curr_player = i;
1245 1246
              break;
1246 1247
          }
......
1449 1450
          }
1450 1451
        }
1451 1452

  
1452
        if (found == true) {
1453
        if (found) {
1453 1454
          sl = item->data(Qt::UserRole).toStringList();
1454 1455
          found_ver = sl.at(3).toInt();
1455 1456
          if (found_ver < fcver) {
......
1854 1855
    }
1855 1856
  } else {
1856 1857
    text = _("Start");
1857
    if (can_client_access_hack() && client.conn.observer == TRUE) {
1858
    if (can_client_access_hack() && client.conn.observer) {
1858 1859
      sensitive = true;
1859 1860
      players_iterate(plr) {
1860 1861
        if (!plr->ai_controlled) {
......
2080 2081
    max = 100;
2081 2082
  }
2082 2083

  
2083
  if (client_is_global_observer() == false) {
2084
  if (!client_is_global_observer()) {
2084 2085
    sw_science->set_tooltip(science_dialog_text());
2085 2086
    str = QString(nation_plural_for_player(client_player()));
2086 2087
    str = str + '\n' + get_info_label_text(false);
......
2126 2127
  players_iterate(pplayer) {
2127 2128
    if (pplayer != client_player()) {
2128 2129
      city_list_iterate(pplayer->cities, pcity) {
2129
        if (first_tile == false) {
2130
        if (!first_tile) {
2130 2131
          first_tile = true;
2131 2132
          ptile = pcity->tile;
2132 2133
          first_id = pcity->id;
2133 2134
        }
2134
        if ((last_center_enemy_city == 0) || center_next == true) {
2135
        if ((last_center_enemy_city == 0) || center_next) {
2135 2136
          last_center_enemy_city = pcity->id;
2136 2137
          center_tile_mapcanvas(pcity->tile);
2137 2138
          return;
......
2162 2163
  players_iterate(pplayer) {
2163 2164
    if (pplayer == client_player()) {
2164 2165
      city_list_iterate(pplayer->cities, pcity) {
2165
        if (first_tile == false) {
2166
        if (!first_tile) {
2166 2167
          first_tile = true;
2167 2168
          ptile = pcity->tile;
2168 2169
          first_id = pcity->id;
2169 2170
        }
2170
        if ((last_center_player_city == 0) || center_next == true) {
2171
        if ((last_center_player_city == 0) || center_next) {
2171 2172
          last_center_player_city = pcity->id;
2172 2173
          center_tile_mapcanvas(pcity->tile);
2173 2174
          return;
......
2202 2203
      if (capital == nullptr) {
2203 2204
        continue;
2204 2205
      }
2205
        if (first_tile == false) {
2206
        if (!first_tile) {
2206 2207
          first_tile = true;
2207 2208
          ptile = capital->tile;
2208 2209
          first_id = capital->id;
2209 2210
        }
2210
        if ((last_center_player_city == 0) || center_next == true) {
2211
        if ((last_center_player_city == 0) || center_next) {
2211 2212
          last_center_player_city = capital->id;
2212 2213
          center_tile_mapcanvas(capital->tile);
2213 2214
          put_cross_overlay_tile(capital->tile);
......
2253 2254
  players_iterate(pplayer) {
2254 2255
    if (pplayer != client_player()) {
2255 2256
      unit_list_iterate(pplayer->units, punit) {
2256
        if (first_tile == false) {
2257
        if (!first_tile) {
2257 2258
          first_tile = true;
2258 2259
          ptile = punit->tile;
2259 2260
          first_id = punit->id;
2260 2261
        }
2261
        if ((last_center_enemy == 0) || center_next == true) {
2262
        if ((last_center_enemy == 0) || center_next) {
2262 2263
          last_center_enemy = punit->id;
2263 2264
          center_tile_mapcanvas(punit->tile);
2264 2265
          return;
client/gui-qt/plrdlg.cpp
435 435
  pplayer = reinterpret_cast<player *>(qvar.value<void *>());
436 436
  selected_player = pplayer;
437 437
  other_player = pplayer;
438
  if (pplayer->is_alive == false) {
438
  if (!pplayer->is_alive) {
439 439
    plr->update_report(false);
440 440
    return;
441 441
  }
......
512 512
      state = player_diplstate_get(pplayer, other);
513 513
      if (static_cast<int>(state->type) == i
514 514
          && (global_observer || could_intel_with_player(me, pplayer))) {
515
        if (added == false) {
515
        if (!added) {
516 516
          ally_str = ally_str  + QString("<b>")
517 517
                     + QString(diplstate_type_translated_name(
518 518
                                 static_cast<diplstate_type>(i)))
......
701 701
**************************************************************************/
702 702
void plr_report::call_meeting()
703 703
{
704
  if (meet_but->isEnabled() == true) {
704
  if (meet_but->isEnabled()) {
705 705
    req_meeeting();
706 706
  }
707 707
}
......
766 766
  }
767 767
  if (act && act->isVisible()) {
768 768
    level = act->data().toInt();
769
    if (plr_wdg->other_player->ai_controlled == false) {
769
    if (!plr_wdg->other_player->ai_controlled) {
770 770
      send_chat_printf("/aitoggle \"%s\"", player_name(plr_wdg->other_player));
771 771
    }
772 772
    send_chat_printf("/%s %s", ai_level_cmd(static_cast<ai_level>(level)),
......
797 797
  int player_count = 0;
798 798
  
799 799
  /* Force updating selected player information */
800
  if (update_selection == true) {
800
  if (update_selection) {
801 801
    qmi = plr_wdg->currentIndex();
802 802
    if (qmi.isValid()) {
803 803
      plr_wdg->clearSelection();
......
842 842
      && !players_on_same_team(client_player(), other_player)) {
843 843
    withdraw_but->setEnabled(true);
844 844
  }
845
  if (can_meet_with_player(other_player) == true) {
845
  if (can_meet_with_player(other_player)) {
846 846
    meet_but->setEnabled(true);
847 847
  }
848 848
  plr_wdg->restore_selection();
......
866 866

  
867 867
    i = gui()->gimme_index_of("PLR");
868 868
    w = gui()->game_tab_widget->widget(i);
869
    if (w->isVisible() == true) {
869
    if (w->isVisible()) {
870 870
      gui()->game_tab_widget->setCurrentIndex(0);
871 871
      return;
872 872
    }
client/gui-qt/repodlgs.cpp
800 800
      tooltip_text = tt_text.trimmed();
801 801
      tooltip_rect = rttp->rect;
802 802
      tooltip_pos = event->globalPos();
803
      if (QToolTip::isVisible() == false && timer_active == false) {
803
      if (!QToolTip::isVisible() && !timer_active) {
804 804
        timer_active = true;
805 805
        QTimer::singleShot(500, this, SLOT(show_tooltip()));
806 806
      }
......
1171 1171
   str = " ";
1172 1172
 }
1173 1173

  
1174
  if (blk == true) {
1174
  if (blk) {
1175 1175
    gui()->sw_science->keep_blinking = true;
1176 1176
    gui()->sw_science->set_custom_labels(str);
1177 1177
    gui()->sw_science->sblink();
......
1702 1702
    i = gui()->gimme_index_of("ECO");
1703 1703
    fc_assert(i != -1);
1704 1704
    w = gui()->game_tab_widget->widget(i);
1705
    if (w->isVisible() == true) {
1705
    if (w->isVisible()) {
1706 1706
      gui()->game_tab_widget->setCurrentIndex(0);
1707 1707
      return;
1708 1708
    }
client/gui-qt/shortcuts.cpp
280 280
  if (read) {
281 281
    suc = read_shortcuts();
282 282
  }
283
  if (suc == false) {
283
  if (!suc) {
284 284
    for (i = 0 ; i < num_shortcuts; i++) {
285 285
      s = new fc_shortcut();
286 286
      s->id = default_shortcuts[i].id;
......
368 368
{
369 369
  fc_sc_button *scp;
370 370
  if (sc != nullptr) {
371
    if (check_if_exist() == false) {
371
    if (!check_if_exist()) {
372 372
      scp = reinterpret_cast<fc_sc_button *>(parentWidget());
373 373
      scp->setText(shortcut_to_string(scp->sc));
374 374
      fc_shortcuts::sc()->set_shortcut(sc);
......
400 400
      }
401 401
      id++;
402 402
    }
403
    if (desc.isEmpty() == true) {
403
    if (desc.isEmpty()) {
404 404
      desc = gui()->menu_bar->shortcut_exist(sc);
405 405
    }
406
    if (desc.isEmpty() == false) {
406
    if (!desc.isEmpty()) {
407 407
      fc_sc_button *fsb;
408 408
      fsb = qobject_cast<fc_sc_button*>(parentWidget());
409 409
      fsb->show_info(desc);
client/gui-qt/sidebar.cpp
206 206
***************************************************************************/
207 207
void fc_sidewidget::enterEvent(QEvent *event)
208 208
{
209
  if (hover == false) {
209
  if (!hover) {
210 210
    hover = true;
211 211
    update_final_pixmap();
212 212
    QWidget::enterEvent(event);
......
311 311
void fc_sidewidget::sblink()
312 312
{
313 313
  if (keep_blinking) {
314
    if (timer->isActive() == false) {
314
    if (!timer->isActive()) {
315 315
      timer->start();
316 316
    }
317 317
    blink = !blink;
......
338 338
  act = qobject_cast<QAction *>(sender());
339 339
  qvar = act->data();
340 340

  
341
  if (qvar.isValid() == false) {
341
  if (!qvar.isValid()) {
342 342
    return;
343 343
  }
344 344

  
345
  if (act->property("scimenu") == true) {
345
  if (act->property("scimenu").toBool()) {
346 346
    dsend_packet_player_research(&client.conn, qvar.toInt());
347 347
    return;
348 348
  }
......
391 391
  pen.setColor(QColor(232, 255, 0));
392 392
  p.setPen(pen);
393 393

  
394
  if (standard == SW_TAX && client_is_global_observer() == false) {
394
  if (standard == SW_TAX && !client_is_global_observer()) {
395 395
    pos = 0;
396 396
    int d, modulo;
397 397
    sprite = get_tax_sprite(tileset, O_GOLD);
......
448 448
  }
449 449

  
450 450
  p.setPen(palette().color(QPalette::Text));
451
  if (custom_label.isEmpty() == false) {
451
  if (!custom_label.isEmpty()) {
452 452
    p.setFont(*info_font);
453 453
    p.drawText(0, 0, width(), height(), Qt::AlignLeft | Qt::TextWordWrap,
454 454
               custom_label);
......
551 551
  w = (100 * screen_hres) / 1920;
552 552
  w = qMax(w, 80);
553 553

  
554
  if (force == false && w == width() && h == height()) {
554
  if (!force && w == width() && h == height()) {
555 555
    return;
556 556
  }
557 557

  
......
603 603
***************************************************************************/
604 604
void side_rates_wdg(bool nothing)
605 605
{
606
  if (client_is_observer() == false) {
606
  if (!client_is_observer()) {
607 607
    popup_rates_dialog();
608 608
  }
609 609
}
......
678 678
      menu->addAction(eiskalt);
679 679
    } players_iterate_end
680 680

  
681
    if (client_is_global_observer() == false) {
681
    if (!client_is_global_observer()) {
682 682
      eiskalt = new QAction(_("Observe globally"), gui()->mapview_wdg);
683 683
      eiskalt->setData(-1);
684 684
      menu->addAction(eiskalt);
......
708 708
  QList<qlist_item> curr_list;
709 709
  qlist_item item;
710 710

  
711
  if (client_is_observer() == false) {
711
  if (!client_is_observer()) {
712 712
    struct research *research = research_get(client_player());
713 713

  
714 714
    advance_index_iterate(A_FIRST, i) {
......
763 763
  } else {
764 764
    i = gui()->gimme_index_of("SCI");
765 765
    w = gui()->game_tab_widget->widget(i);
766
    if (w->isVisible() == true) {
766
    if (w->isVisible()) {
767 767
      gui()->game_tab_widget->setCurrentIndex(0);
768 768
      return;
769 769
    }
client/gui-qt/sprite.cpp
45 45
  gfx_ext = QImageReader::supportedImageFormats();
46 46

  
47 47
  gfx_array_extensions = new const char *[gfx_ext.count()];
48
  while (gfx_ext.isEmpty() == false) {
48
  while (!gfx_ext.isEmpty()) {
49 49
    char *ext;
50

  
50 51
    cp = gfx_ext.takeFirst();
51 52
    ext = static_cast<char *>(fc_malloc(sizeof(cp)));
52 53
    strncpy(ext, cp.data(), sizeof(cp));
client/gui-qt/themes.cpp
161 161
  foreach(str, sl) {
162 162
    f.setFileName(name + DIR_SEPARATOR + str
163 163
                  + DIR_SEPARATOR + "resource.qss");
164
    if (f.exists() == false) {
164
    if (!f.exists()) {
165 165
      continue;
166 166
    }
167 167
    theme_list << str;
168
- 
(3-3/3)