From 83462aea5336e3f850cb34b2d9182bb7447e2ba4 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 25 May 2022 21:54:07 +0300 Subject: [PATCH 20/20] Use // for all single-line comments in C++ code See osdn #44670 Signed-off-by: Marko Lindqvist --- client/gui-qt/canvas.cpp | 7 +-- client/gui-qt/canvas.h | 5 +- client/gui-qt/chatline.cpp | 32 ++++++------- client/gui-qt/chatline.h | 3 +- client/gui-qt/citydlg.cpp | 83 +++++++++++++++++----------------- client/gui-qt/citydlg.h | 4 +- client/gui-qt/cityrep.cpp | 5 +- client/gui-qt/cityrep.h | 2 +- client/gui-qt/colors.cpp | 5 +- client/gui-qt/colors.h | 4 +- client/gui-qt/connectdlg.cpp | 10 ++-- client/gui-qt/connectdlg.h | 4 +- client/gui-qt/diplodlg.cpp | 18 ++++---- client/gui-qt/diplodlg.h | 4 +- client/gui-qt/fc_client.cpp | 18 ++++---- client/gui-qt/fc_client.h | 6 +-- client/gui-qt/finddlg.cpp | 2 +- client/gui-qt/finddlg.h | 4 +- client/gui-qt/fonts.cpp | 17 ++++--- client/gui-qt/gotodlg.cpp | 6 +-- client/gui-qt/gotodlg.h | 6 +-- client/gui-qt/graphics.h | 4 +- client/gui-qt/gui_main.h | 4 +- client/gui-qt/helpdlg.cpp | 8 ++-- client/gui-qt/helpdlg.h | 4 +- client/gui-qt/hudwidget.cpp | 45 +++++++++--------- client/gui-qt/hudwidget.h | 2 +- client/gui-qt/inteldlg.cpp | 6 +-- client/gui-qt/inteldlg.h | 4 +- client/gui-qt/luaconsole.cpp | 4 +- client/gui-qt/luaconsole.h | 2 +- client/gui-qt/mapctrl.cpp | 12 ++--- client/gui-qt/mapctrl.h | 4 +- client/gui-qt/mapview.cpp | 24 +++++----- client/gui-qt/mapview.h | 2 +- client/gui-qt/menu.cpp | 82 ++++++++++++++++----------------- client/gui-qt/menu.h | 20 ++++---- client/gui-qt/messagedlg.cpp | 4 +- client/gui-qt/messagedlg.h | 6 +-- client/gui-qt/messagewin.cpp | 8 ++-- client/gui-qt/messagewin.h | 6 +-- client/gui-qt/optiondlg.cpp | 6 +-- client/gui-qt/optiondlg.h | 5 +- client/gui-qt/pages.cpp | 61 ++++++++++--------------- client/gui-qt/pages.h | 2 +- client/gui-qt/plrdlg.cpp | 6 +-- client/gui-qt/plrdlg.h | 5 +- client/gui-qt/qtg_cxxside.h | 2 +- client/gui-qt/ratesdlg.cpp | 4 +- client/gui-qt/ratesdlg.h | 2 +- client/gui-qt/repodlgs.cpp | 18 ++++---- client/gui-qt/repodlgs.h | 3 +- client/gui-qt/shortcuts.cpp | 4 +- client/gui-qt/shortcuts.h | 4 +- client/gui-qt/sidebar.cpp | 5 +- client/gui-qt/sidebar.h | 5 +- client/gui-qt/spaceshipdlg.cpp | 3 +- client/gui-qt/spaceshipdlg.h | 10 ++-- client/gui-qt/sprite.cpp | 2 +- client/gui-qt/sprite.h | 4 +- client/gui-qt/themes.cpp | 12 ++--- client/gui-qt/voteinfo_bar.cpp | 6 +-- client/gui-qt/voteinfo_bar.h | 4 +- client/gui-qt/wldlg.cpp | 2 +- client/gui-qt/wldlg.h | 4 +- tools/fcmp/mpgui_qt.cpp | 8 ++-- tools/ruledit/effect_edit.h | 4 +- tools/ruledit/req_edit.cpp | 4 +- tools/ruledit/req_vec_fix.cpp | 43 +++++++++--------- tools/ruledit/req_vec_fix.h | 8 ++-- tools/ruledit/ruledit.cpp | 34 +++++++------- tools/ruledit/ruledit.h | 6 +-- tools/ruledit/ruledit_qt.cpp | 4 +- tools/ruledit/ruledit_qt.h | 6 +-- tools/ruledit/tab_enablers.cpp | 26 +++++------ tools/ruledit/tab_enablers.h | 2 +- 76 files changed, 405 insertions(+), 415 deletions(-) diff --git a/client/gui-qt/canvas.cpp b/client/gui-qt/canvas.cpp index 070a841397..83c177d9ec 100644 --- a/client/gui-qt/canvas.cpp +++ b/client/gui-qt/canvas.cpp @@ -29,6 +29,7 @@ #include "sprite.h" static QFont *get_font(enum client_font font); + /************************************************************************//** Create a canvas of the given size. ****************************************************************************/ @@ -54,7 +55,7 @@ void qtg_canvas_free(struct canvas *store) ****************************************************************************/ void qtg_canvas_set_zoom(struct canvas *store, float zoom) { - /* Qt-client has no zoom support */ + // Qt-client has no zoom support } /************************************************************************//** @@ -117,7 +118,7 @@ void pixmap_copy(QPixmap *dest, QPixmap *src, int src_x, int src_y, Copies an area from the source image to the destination image. ****************************************************************************/ void image_copy(QImage *dest, QImage *src, int src_x, int src_y, - int dest_x, int dest_y, int width, int height) + int dest_x, int dest_y, int width, int height) { QRectF source_rect(src_x, src_y, width, height); QRectF dest_rect(dest_x, dest_y, width, height); @@ -309,7 +310,7 @@ void qtg_canvas_put_curved_line(struct canvas *pcanvas, struct color *pcolor, may be NULL in which case those values simply shouldn't be filled out. ****************************************************************************/ void qtg_get_text_size(int *width, int *height, - enum client_font font, const char *text) + enum client_font font, const char *text) { QFont *afont; QFontMetrics *fm; diff --git a/client/gui-qt/canvas.h b/client/gui-qt/canvas.h index 564e1574f9..c1297ef1e0 100644 --- a/client/gui-qt/canvas.h +++ b/client/gui-qt/canvas.h @@ -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 @@ -31,4 +31,5 @@ void pixmap_copy(QPixmap *dest, QPixmap *src, int src_x, int src_y, void image_copy(QImage *dest, QImage *src, int src_x, int src_y, int dest_x, int dest_y, int width, int height); QRect zealous_crop_rect(QImage &p); -#endif /* FC__CANVAS_H */ + +#endif // FC__CANVAS_H diff --git a/client/gui-qt/chatline.cpp b/client/gui-qt/chatline.cpp index ba6e8708bb..64294a278a 100644 --- a/client/gui-qt/chatline.cpp +++ b/client/gui-qt/chatline.cpp @@ -15,7 +15,7 @@ #include #endif -//Qt +// Qt #include #include #include @@ -34,7 +34,7 @@ // client #include "audio.h" #include "climap.h" -#include "climisc.h" /* for write_chatline_content */ +#include "climisc.h" // For write_chatline_content #include "connectdlg_common.h" #include "control.h" #include "game.h" @@ -122,7 +122,7 @@ void chat_listener::send_chat_message(const QString &message) if (index != -1) { s = s.remove("PICK:"); - /* now should be playername left in string */ + // Now should be playername left in string players_iterate(pplayer) { splayer = QString(pplayer->name); @@ -136,9 +136,7 @@ void chat_listener::send_chat_message(const QString &message) history << message; reset_history_position(); - /* - * If client send commands to take ai, set /away to disable AI - */ + // If client send commands to take ai, set /away to disable AI if (message.startsWith("/take ")) { s = s.remove("/take "); players_iterate(pplayer) { @@ -155,9 +153,7 @@ void chat_listener::send_chat_message(const QString &message) } players_iterate_end; } - /* - * Option to send to allies by default - */ + // Option to send to allies by default if (!message.isEmpty()) { if (client_state() >= C_S_RUNNING && gui_options.gui_qt_allied_chat_only && is_plain_public_message(message)) { @@ -423,6 +419,7 @@ void chatwdg::chat_message_received(const QString& message, const struct text_tag_list *tags) { QColor col = chat_output->palette().color(QPalette::Text); + append(apply_tags(message, tags, col)); } @@ -467,6 +464,7 @@ bool chatwdg::eventFilter(QObject *obj, QEvent *event) if (obj == chat_line) { if (event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(event); + if (keyEvent->key() == Qt::Key_Escape) { gui()->infotab->restore_chat(); gui()->mapview_wdg->setFocus(); @@ -639,7 +637,7 @@ QString apply_tags(QString str, const struct text_tag_list *tags, } if (!pcolor) { - break; /* Not a valid link type case. */ + break; // Not a valid link type case. } color = pcolor->qcolor.name(QColor::HexRgb); str_col = QString("").arg(color); @@ -653,7 +651,7 @@ QString apply_tags(QString str, const struct text_tag_list *tags, } } text_tag_list_iterate_end; - /* insert html starting from last items */ + // Insert html starting from last items last_i = str.count(); QMultiMap::const_iterator i = mm.constEnd(); QMultiMap::const_iterator j = mm.constEnd(); @@ -700,14 +698,14 @@ static bool is_plain_public_message(QString s) return false; } - /* Search for private message */ + // Search for private message if (!str.contains(CHAT_DIRECT_PREFIX)) { return true; } i = str.indexOf(CHAT_DIRECT_PREFIX); str = str.left(i); - /* Compare all players and connections looking for match */ + // Compare all players and connections looking for match conn_list_iterate(game.all_connections, pconn) { s1 = pconn->username; if (s1.length() < i) { @@ -746,7 +744,7 @@ void qtg_real_output_window_append(const char *astring, wakeup = gui_options.gui_qt_wakeup_text; - /* Format wakeup string if needed */ + // Format wakeup string if needed if (wakeup.contains("%1")) { wakeup = wakeup.arg(client.conn.username); } @@ -755,7 +753,7 @@ void qtg_real_output_window_append(const char *astring, qapp->alert(gui()->central_wdg); } - /* Play sound if we encountered wakeup string */ + // Play sound if we encountered wakeup string if (str.contains(wakeup) && client_state() < C_S_RUNNING && !wakeup.isEmpty()) { qapp->alert(gui()->central_wdg); @@ -773,7 +771,7 @@ void qtg_real_output_window_append(const char *astring, ***************************************************************************/ void log_output_window(void) { - /* PORTME */ + // PORTME write_chatline_content(NULL); } @@ -782,7 +780,7 @@ void log_output_window(void) ***************************************************************************/ void clear_output_window(void) { - /* PORTME */ + // PORTME #if 0 set_output_window_text(_("Cleared output window.")); #endif diff --git a/client/gui-qt/chatline.h b/client/gui-qt/chatline.h index 5e7fea362b..71c143d6aa 100644 --- a/client/gui-qt/chatline.h +++ b/client/gui-qt/chatline.h @@ -39,6 +39,7 @@ class QPushButton; QString apply_tags(QString str, const struct text_tag_list *tags, QColor bg_color); template<> std::set listener::instances; + /*************************************************************************** Listener for chat. See listener<> for information about how to use it ***************************************************************************/ @@ -150,4 +151,4 @@ public: QString get_message() const { return message; } }; -#endif /* FC__CHATLINE_H */ +#endif // FC__CHATLINE_H diff --git a/client/gui-qt/citydlg.cpp b/client/gui-qt/citydlg.cpp index 2497b5215a..a3d7b5ef4f 100644 --- a/client/gui-qt/citydlg.cpp +++ b/client/gui-qt/citydlg.cpp @@ -241,7 +241,7 @@ void progress_bar::paintEvent(QPaintEvent *event) c = palette().color(QPalette::Window); p.fillRect(r2, c); - /* draw icon */ + // Draw icon if (pix != nullptr) { p.setCompositionMode(QPainter::CompositionMode_SourceOver); p.drawPixmap(2 , 2, pix_width @@ -249,7 +249,7 @@ void progress_bar::paintEvent(QPaintEvent *event) pix_width, *pix, 0, 0, pix->width(), pix->height()); } - /* draw text */ + // Draw text c = palette().color(QPalette::Text); p.setPen(c); sfont->setCapitalization(QFont::AllUppercase); @@ -536,13 +536,13 @@ void impr_info::wheelEvent(QWheelEvent *event) event->buttons(), event->modifiers(), event->phase(), false, event->source()); -#else /* FC_QT5_MODE */ +#else // FC_QT5_MODE QWheelEvent new_event(QPoint(5, 5), p + QPoint(5,5), event->pixelDelta(), event->angleDelta(), event->angleDelta().y(), Qt::Horizontal, event->buttons(), event->modifiers(), event->phase(), event->source()); -#endif /* FC_QT5_MODE */ +#endif // FC_QT5_MODE QApplication::sendEvent(parentWidget(), &new_event); } @@ -593,13 +593,13 @@ void impr_item::wheelEvent(QWheelEvent *event) event->buttons(), event->modifiers(), event->phase(), false, event->source()); -#else /* FC_QT5_MODE */ +#else // FC_QT5_MODE QWheelEvent new_event(QPoint(5, 5), p + QPoint(5,5), event->pixelDelta(), event->angleDelta(), event->angleDelta().y(), Qt::Horizontal, event->buttons(), event->modifiers(), event->phase(), event->source()); -#endif /* FC_QT5_MODE */ +#endif // FC_QT5_MODE QApplication::sendEvent(parentWidget()->parentWidget(), &new_event); } @@ -1007,13 +1007,13 @@ void unit_item::wheelEvent(QWheelEvent *event) event->buttons(), event->modifiers(), event->phase(), false, event->source()); -#else /* FC_QT5_MODE */ +#else // FC_QT5_MODE QWheelEvent new_event(QPoint(5, 5), p + QPoint(5,5), event->pixelDelta(), event->angleDelta(), event->angleDelta().y(), Qt::Horizontal, event->buttons(), event->modifiers(), event->phase(), event->source()); -#endif /* FC_QT5_MODE */ +#endif // FC_QT5_MODE QApplication::sendEvent(parentWidget()->parentWidget(), &new_event); } @@ -1095,13 +1095,13 @@ void unit_info::wheelEvent(QWheelEvent *event) event->buttons(), event->modifiers(), event->phase(), false, event->source()); -#else /* FC_QT5_MODE */ +#else // FC_QT5_MODE QWheelEvent new_event(QPoint(5, 5), p + QPoint(5,5), event->pixelDelta(), event->angleDelta(), event->angleDelta().y(), Qt::Horizontal, event->buttons(), event->modifiers(), event->phase(), event->source()); -#endif /* FC_QT5_MODE */ +#endif // FC_QT5_MODE QApplication::sendEvent(parentWidget(), &new_event); } @@ -1258,7 +1258,7 @@ void city_map::paintEvent(QPaintEvent *event) painter.fillRect(0, 0, zoomed_pixmap.width(), zoomed_pixmap.height(), QBrush(QColor(60, 60 , 60 , 110))); painter.setPen(QColor(255, 255, 255)); - /* TRANS: %1 is custom string choosen by player. */ + // TRANS: %1 is custom string choosen by player. str = QString(_("Governor %1")) .arg(cmafec_get_short_descr_of_city(mcity)); painter.drawText(5, zoomed_pixmap.height() - 10, str); @@ -1462,7 +1462,7 @@ void city_map::context_menu(QPoint point) } else if (act == con_clear) { task.activity = ACTIVITY_LAST; } else { - /* Closed dialog without selecting any activity entry. */ + // Closed dialog without selecting any activity entry. return; } @@ -1548,13 +1548,13 @@ city_dialog::city_dialog(QWidget *parent): qfc_dialog(parent) setSizePolicy(size_expanding_policy); current_building = 0; - /* map view */ + // Map view map_box = new QGroupBox(this); - /* City information widget texts about surpluses and so on */ + // City information widget texts about surpluses and so on info_wdg = new QWidget(this); - /* Fill info_wdg with labels */ + // Fill info_wdg with labels info_grid_layout = new QGridLayout(parent); info_wdg->setFont(*small_font); @@ -1579,7 +1579,7 @@ city_dialog::city_dialog(QWidget *parent): qfc_dialog(parent) info_wdg->setLayout(info_grid_layout); - /* Buy button */ + // Buy button buy_button = new QPushButton(); buy_button->setIcon(fc_icons::instance()->get_icon("help-donate")); connect(buy_button, &QAbstractButton::clicked, this, &city_dialog::buy); @@ -1605,7 +1605,7 @@ city_dialog::city_dialog(QWidget *parent): qfc_dialog(parent) zoom_vbox->addWidget(zoom_in_button); zoom_vbox->addWidget(zoom_out_button); - /* City map group box */ + // City map group box vbox_layout = new QVBoxLayout; hbox_layout = new QHBoxLayout; hbox_layout->addStretch(100); @@ -1617,7 +1617,7 @@ city_dialog::city_dialog(QWidget *parent): qfc_dialog(parent) map_box->setLayout(vbox_layout); map_box->setTitle(_("City map")); - /* current/supported units/improvements widgets */ + // Current/supported units/improvements widgets supp_units = new QLabel(); curr_units = new QLabel(); curr_impr = new QLabel(); @@ -1699,7 +1699,7 @@ city_dialog::city_dialog(QWidget *parent): qfc_dialog(parent) prod_options->setLayout(prod_option_layout); prod_options->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); - /* prev/next and close buttons */ + // Prev/next and close buttons button = new QPushButton; button->setIcon(fc_icons::instance()->get_icon("city-close")); button->setIconSize(QSize(56, 56)); @@ -1739,13 +1739,13 @@ city_dialog::city_dialog(QWidget *parent): qfc_dialog(parent) hbox_layout->addWidget(info_wdg, Qt::AlignLeft); hbox_layout->addWidget(map_box, Qt::AlignCenter); - /* Layout with city view and buttons */ + // Layout with city view and buttons lefttop_layout->addWidget(citizens_label, Qt::AlignHCenter); lefttop_layout->addStretch(0); lefttop_layout->addLayout(hbox_layout); lefttop_layout->addStretch(50); - /* Layout for units/buildings */ + // Layout for units/buildings curr_unit_wdg = new QWidget(); supp_unit_wdg = new QWidget(); curr_impr_wdg = new QWidget(); @@ -2552,7 +2552,7 @@ void city_dialog::update_cma_tab() Qt::IgnoreAspectRatio, Qt::SmoothTransformation); cma_result_pix->setPixmap(pix); cma_result_pix->setAlignment(Qt::AlignRight | Qt::AlignVCenter); - /* TRANS: %1 is custom string chosen by player */ + // TRANS: %1 is custom string chosen by player cma_result->setText(QString(_("

Governor Enabled
(%1)

")) .arg(s.toHtmlEscaped())); cma_result->setAlignment(Qt::AlignCenter); @@ -3008,7 +3008,7 @@ void city_dialog::update_info_label() buf_tooltip[i][0] = '\0'; } - /* fill the buffers with the necessary info */ + // Fill the buffers with the necessary info spec = city_specialists(dlgcity); fc_snprintf(buf_info[INFO_CITIZEN], sizeof(buf_info[INFO_CITIZEN]), "%3d (%4d)", dlgcity->size, spec); @@ -3055,15 +3055,15 @@ void city_dialog::update_info_label() granaryturns = city_turns_to_grow(dlgcity); if (granaryturns == 0) { - /* TRANS: city growth is blocked. Keep short. */ + // TRANS: city growth is blocked. Keep short. fc_snprintf(buf_info[INFO_GROWTH], sizeof(buf_info[INFO_GROWTH]), _("blocked")); } else if (granaryturns == FC_INFINITY) { - /* TRANS: city is not growing. Keep short. */ + // TRANS: city is not growing. Keep short. fc_snprintf(buf_info[INFO_GROWTH], sizeof(buf_info[INFO_GROWTH]), _("never")); } else { /* A negative value means we'll have famine in that many turns. But that's handled down below. */ - /* TRANS: city growth turns. Keep short. */ + // TRANS: city growth turns. Keep short. fc_snprintf(buf_info[INFO_GROWTH], sizeof(buf_info[INFO_GROWTH]), PL_("%d turn", "%d turns", abs(granaryturns)), abs(granaryturns)); @@ -3083,7 +3083,7 @@ void city_dialog::update_info_label() " -.-"); } else { illness = city_illness_calc(dlgcity, NULL, NULL, NULL, NULL); - /* illness is in tenth of percent */ + // Illness is in tenth of percent fc_snprintf(buf_info[INFO_ILLNESS], sizeof(buf_info[INFO_ILLNESS]), "%5.1f%%", (float) illness / 10.0); } @@ -3649,19 +3649,19 @@ void city_dialog::update_title() .replace("&", "&&")); if (city_unhappy(dlgcity)) { - /* TRANS: city dialog title */ + // TRANS: city dialog title buf = QString(_("%1 - %2 citizens - DISORDER")).arg(city_name_get(dlgcity), population_to_text(city_population(dlgcity))); } else if (city_celebrating(dlgcity)) { - /* TRANS: city dialog title */ + // TRANS: city dialog title buf = QString(_("%1 - %2 citizens - celebrating")).arg(city_name_get(dlgcity), population_to_text(city_population(dlgcity))); } else if (city_happy(dlgcity)) { - /* TRANS: city dialog title */ + // TRANS: city dialog title buf = QString(_("%1 - %2 citizens - happy")).arg(city_name_get(dlgcity), population_to_text(city_population(dlgcity))); } else { - /* TRANS: city dialog title */ + // TRANS: city dialog title buf = QString(_("%1 - %2 citizens")).arg(city_name_get(dlgcity), population_to_text(city_population(dlgcity))); } @@ -3993,7 +3993,7 @@ QString get_tooltip(QVariant qvar) NULL, target->value.building); } - /* Remove all lines from help which has '*' in first 3 chars */ + // Remove all lines from help which has '*' in first 3 chars ret_str = cut_helptext(str); ret_str = split_text(ret_str, true); ret_str = ret_str.trimmed(); @@ -4198,7 +4198,7 @@ production_item::production_item(struct universal *ptarget, ****************************************************************************/ production_item::~production_item() { - /* allocated as renegade in model */ + // Allocated as renegade in model if (target != NULL) { delete target; } @@ -4255,12 +4255,13 @@ QVariant city_production_model::data(const QModelIndex &index, int role) const if (index.row() >= 0 && index.row() < rowCount() && index.column() >= 0 && index.column() < columnCount() && (index.column() + index.row() * 3 < city_target_list.count())) { - int r, c, t ,new_index; + int r, c, t, new_index; + r = index.row(); c = index.column(); t = r * 3 + c; new_index = t / 3 + rowCount() * c; - /* Exception, shift whole column */ + // Exception, shift whole column if ((c == 2) && city_target_list.count() % 3 == 1) { new_index = t / 3 + rowCount() * c - 1; } @@ -4302,7 +4303,7 @@ void city_production_model::populate() if (future_t || can_city_build_now(mcity, &items[item].item)) { renegade = new universal(items[item].item); - /* renagade deleted in production_item destructor */ + // Renagade deleted in production_item destructor if (VUT_UTYPE == renegade->kind) { str = utype_name_translation(renegade->value.utype); sh.setX(qMax(sh.x(), fm.horizontalAdvance(str))); @@ -4493,14 +4494,14 @@ void production_widget::prod_selected(const QItemSelection &sl, if (target != NULL) { city_get_queue(pw_city, &queue); switch (when_change) { - case 0: /* Change current target */ + case 0: // Change current target city_change_production(pw_city, target); if (city_can_buy(pw_city) && buy_it) { city_buy_production(pw_city); } break; - case 1: /* Change current (selected on list)*/ + case 1: // Change current (selected on list) if (curr_selection < 0 || curr_selection > worklist_length(&queue)) { city_change_production(pw_city, target); } else { @@ -4510,7 +4511,7 @@ void production_widget::prod_selected(const QItemSelection &sl, } break; - case 2: /* Insert before */ + case 2: // Insert before if (curr_selection < 0 || curr_selection > worklist_length(&queue)) { curr_selection = 0; } @@ -4520,7 +4521,7 @@ void production_widget::prod_selected(const QItemSelection &sl, city_set_queue(pw_city, &queue); break; - case 3: /* Insert after */ + case 3: // Insert after if (curr_selection < 0 || curr_selection > worklist_length(&queue)) { city_queue_insert(pw_city, -1, target); break; @@ -4530,7 +4531,7 @@ void production_widget::prod_selected(const QItemSelection &sl, city_set_queue(pw_city, &queue); break; - case 4: /* Add last */ + case 4: // Add last city_queue_insert(pw_city, -1, target); break; diff --git a/client/gui-qt/citydlg.h b/client/gui-qt/citydlg.h index 79b9c112cb..60f9911a10 100644 --- a/client/gui-qt/citydlg.h +++ b/client/gui-qt/citydlg.h @@ -82,7 +82,7 @@ class QVBoxLayout; #define SPECENUM_VALUE15 INFO_AIRLIFT #define SPECENUM_VALUE15NAME N_("Airlift:") -#define SPECENUM_COUNT NUM_INFO_FIELDS /* number of city_info panel enumerated fields */ +#define SPECENUM_COUNT NUM_INFO_FIELDS // number of city_info panel enumerated fields #include "specenum_gen.h" class QImage; @@ -561,4 +561,4 @@ protected: void destroy_city_dialog(); void city_font_update(); -#endif /* FC__CITYDLG_H */ +#endif // FC__CITYDLG_H diff --git a/client/gui-qt/cityrep.cpp b/client/gui-qt/cityrep.cpp index cfbea3b601..760c2c453d 100644 --- a/client/gui-qt/cityrep.cpp +++ b/client/gui-qt/cityrep.cpp @@ -793,7 +793,6 @@ void city_widget::invert_selection() struct city *pcity; QVariant qvar; - for (int j = 0; j < filter_model->rowCount(); j++) { i = filter_model->index(j, 0); qvar = i.data(Qt::UserRole); @@ -1355,7 +1354,7 @@ void popdown_city_report() ***************************************************************************/ void hilite_cities_from_canvas(void) { - /* PORTME */ + // PORTME } /***********************************************************************//** @@ -1363,5 +1362,5 @@ void hilite_cities_from_canvas(void) ***************************************************************************/ void toggle_city_hilite(struct city *pcity, bool on_off) { - /* PORTME */ + // PORTME } diff --git a/client/gui-qt/cityrep.h b/client/gui-qt/cityrep.h index 49245fab26..ab9a97fc9e 100644 --- a/client/gui-qt/cityrep.h +++ b/client/gui-qt/cityrep.h @@ -216,4 +216,4 @@ private: void popdown_city_report(); -#endif /* FC__CITYREP_H */ +#endif // FC__CITYREP_H diff --git a/client/gui-qt/colors.cpp b/client/gui-qt/colors.cpp index c33aa38605..6f4813d43b 100644 --- a/client/gui-qt/colors.cpp +++ b/client/gui-qt/colors.cpp @@ -15,13 +15,14 @@ #include #endif -/* utility */ +// utility #include "mem.h" // gui-qt -#include "colors.h" #include "qtg_cxxside.h" +#include "colors.h" + /************************************************************************//** Allocate a color (adjusting it for our colormap if necessary on paletted systems) and return a pointer to it. diff --git a/client/gui-qt/colors.h b/client/gui-qt/colors.h index bfafc2712e..87eeb031c3 100644 --- a/client/gui-qt/colors.h +++ b/client/gui-qt/colors.h @@ -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 @@ -25,4 +25,4 @@ struct color { QColor qcolor; }; -#endif /* FC__COLORS_H */ +#endif // FC__COLORS_H diff --git a/client/gui-qt/connectdlg.cpp b/client/gui-qt/connectdlg.cpp index e1b3d4694a..7751fc984b 100644 --- a/client/gui-qt/connectdlg.cpp +++ b/client/gui-qt/connectdlg.cpp @@ -15,15 +15,15 @@ #include #endif -/* utility */ +// utility #include "fcintl.h" #include "log.h" #include "support.h" #include "connectdlg_g.h" -/* client */ -#include "chatline_common.h" /* for append_output_window */ +// client +#include "chatline_common.h" // For append_output_window #include "client_main.h" #include "packhand_gen.h" @@ -65,7 +65,7 @@ void handle_game_load(bool load_successful, const char *filename) set_client_page(PAGE_START); if (game.info.is_new_game) { - /* It's pregame. Create a player and connect to it */ + // It's pregame. Create a player and connect to it send_chat("/take -"); } } @@ -76,5 +76,5 @@ void handle_game_load(bool load_successful, const char *filename) **************************************************************************/ void qtg_server_connect() { - /* PORTME */ + // PORTME } diff --git a/client/gui-qt/connectdlg.h b/client/gui-qt/connectdlg.h index 3a9a2cbfc4..6979b976a2 100644 --- a/client/gui-qt/connectdlg.h +++ b/client/gui-qt/connectdlg.h @@ -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 @@ -18,4 +18,4 @@ extern "C" { #include "connectdlg_g.h" } -#endif /* FC__CONNECTDLG_H */ +#endif // FC__CONNECTDLG_H diff --git a/client/gui-qt/diplodlg.cpp b/client/gui-qt/diplodlg.cpp index 1c8485f1ce..71bf27b0af 100644 --- a/client/gui-qt/diplodlg.cpp +++ b/client/gui-qt/diplodlg.cpp @@ -325,7 +325,7 @@ void diplo_wdg::show_menu(struct player *pplayer) pgiver = pplayer; pother = other_player; - /* Maps */ + // Maps map_menu = menu->addMenu(_("Maps")); world_map = new QAction(_("World-map"), this); connect(world_map, &QAction::triggered, this, &diplo_wdg::world_map_clause); @@ -334,7 +334,7 @@ void diplo_wdg::show_menu(struct player *pplayer) connect(sea_map, &QAction::triggered, this, &diplo_wdg::sea_map_clause); map_menu->addAction(sea_map); - /* Trading: advances */ + // Trading: advances if (game.info.trading_tech) { const struct research *gresearch = research_get(pgiver); const struct research *oresearch = research_get(pother); @@ -353,13 +353,13 @@ void diplo_wdg::show_menu(struct player *pplayer) } } advance_iterate_end; - /* All advances */ + // All advances all_advancs = new QAction(_("All advances"), this); connect(all_advancs, &QAction::triggered, this, &diplo_wdg::all_advances); adv_menu->addAction(all_advancs); adv_menu->addSeparator(); - /* QMap is sorted by default when iterating */ + // QMap is sorted by default when iterating adv_iter = adv_list.constBegin(); if (adv_list.count() > 0) { while (adv_iter != adv_list.constEnd()) { @@ -376,7 +376,7 @@ void diplo_wdg::show_menu(struct player *pplayer) } - /* Trading: cities. */ + // Trading: cities. if (game.info.trading_city) { city_menu = menu->addMenu(_("Cities")); @@ -413,7 +413,7 @@ void diplo_wdg::show_menu(struct player *pplayer) some_action->setDisabled(true); } - /* Pacts */ + // Pacts if (curr_player == client_player()) { pacts_menu = menu->addMenu(_("Pacts")); ds = player_diplstate_get(pgiver, pother)->type; @@ -437,7 +437,7 @@ void diplo_wdg::show_menu(struct player *pplayer) } } - /* Check user response for not defined responses in slots */ + // Check user response for not defined responses in slots menu->setAttribute(Qt::WA_DeleteOnClose); menu->popup(QCursor::pos()); } @@ -590,7 +590,7 @@ void diplo_wdg::all_advances() other = giver; } - /* All techs. */ + // All techs. dresearch = research_get(dest); gresearch = research_get(giver); @@ -953,7 +953,7 @@ void qtg_init_meeting(struct Treaty *ptreaty, struct player *they, } dd->make_active(they); - /* Bring it to front if user requested meeting */ + // Bring it to front if user requested meeting if (initiator == client_player()) { gui()->game_tab_widget->setCurrentIndex(i); } diff --git a/client/gui-qt/diplodlg.h b/client/gui-qt/diplodlg.h index 1d4e47e9ea..b904234dad 100644 --- a/client/gui-qt/diplodlg.h +++ b/client/gui-qt/diplodlg.h @@ -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 @@ -124,4 +124,4 @@ private: int index; }; -#endif /* FC__DIPLODLG_H */ +#endif // FC__DIPLODLG_H diff --git a/client/gui-qt/fc_client.cpp b/client/gui-qt/fc_client.cpp index 9cde838865..4ad991f89a 100644 --- a/client/gui-qt/fc_client.cpp +++ b/client/gui-qt/fc_client.cpp @@ -36,7 +36,7 @@ #ifdef FC_QT5_MODE #include -#endif /* FC_QT5_MODE */ +#endif // FC_QT5_MODE #include @@ -71,7 +71,7 @@ fc_client::fc_client() : QMainWindow() { #ifdef FC_QT5_MODE QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); -#endif /* FC_QT5_MODE */ +#endif // FC_QT5_MODE /** * Somehow freeciv-client-common asks to switch to page when all widgets * haven't been created yet by Qt, even constructor finished job, @@ -362,7 +362,7 @@ void fc_client::switch_page(int new_pg) setWindowFlags(Qt::Window | Qt::CustomizeWindowHint); } showMaximized(); - /* For MS Windows, it might ingore first */ + // For MS Windows, it might ingore first showMaximized(); gui()->infotab->chtwdg->update_widgets(); status_bar->setVisible(false); @@ -818,7 +818,7 @@ void fc_client::popdown_unit_sel() ****************************************************************************/ void fc_client::remove_repo_dlg(QString str) { - /* if app is closing opened_repo_dlg is already deleted */ + // If app is closing, opened_repo_dlg is already deleted */ if (!is_closing()) { opened_repo_dlgs.remove(str); } @@ -970,14 +970,14 @@ QIcon fc_icons::get_icon(const QString &id) QByteArray png_bytes; str = QString("themes") + DIR_SEPARATOR + "gui-qt" + DIR_SEPARATOR; - /* Try custom icon from theme */ + // Try custom icon from theme pn_bytes = str.toLocal8Bit(); png_bytes = QString(pn_bytes.data() + current_theme + DIR_SEPARATOR + id + ".png").toLocal8Bit(); icon.addFile(fileinfoname(get_data_dirs(), png_bytes.data())); str = str + "icons" + DIR_SEPARATOR; - /* Try icon from icons dir */ + // Try icon from icons dir if (icon.isNull()) { pn_bytes = str.toLocal8Bit(); png_bytes = QString(pn_bytes.data() + id + ".png").toLocal8Bit(); @@ -1094,7 +1094,7 @@ void fc_game_tab_widget::current_changed(int index) currentWidget()->hide(); widget(index)->show(); - /* Set focus to map instead sidebar */ + // Set focus to map instead sidebar if (gui()->mapview_wdg && gui()->current_page() == PAGE_GAME && index == 0) { gui()->mapview_wdg->setFocus(); @@ -1187,7 +1187,7 @@ void pregame_options::set_rulesets(int num_rulesets, char **rulesets) } } - /* HACK: server should tell us the current ruleset. */ + // HACK: server should tell us the current ruleset. cruleset->setCurrentIndex(def_idx); cruleset->blockSignals(false); } @@ -1263,7 +1263,7 @@ void pregame_options::ailevel_change(int i) if (v.isValid()) { enum ai_level k = static_cast(v.toInt()); - /* Suppress changes provoked by server rather than local user */ + // Suppress changes provoked by server rather than local user if (server_ai_level() != k) { const char *name = ai_level_cmd(k); diff --git a/client/gui-qt/fc_client.h b/client/gui-qt/fc_client.h index 2faac6e1f7..2ed4ae80d3 100644 --- a/client/gui-qt/fc_client.h +++ b/client/gui-qt/fc_client.h @@ -236,7 +236,7 @@ public: void set_status_bar(QString str, int timeout = 2000); int add_game_tab(QWidget *widget); - void rm_game_tab(int index); /* doesn't delete widget */ + void rm_game_tab(int index); // Doesn't delete widget void update_start_page(); void toggle_unit_sel_widget(struct tile *ptile); void update_unit_sel(); @@ -386,6 +386,4 @@ public slots: // Return fc_client instance. Implementation in gui_main.cpp class fc_client *gui(); -#endif /* FC__FC_CLIENT_H */ - - +#endif // FC__FC_CLIENT_H diff --git a/client/gui-qt/finddlg.cpp b/client/gui-qt/finddlg.cpp index 1693519301..4ee5346c08 100644 --- a/client/gui-qt/finddlg.cpp +++ b/client/gui-qt/finddlg.cpp @@ -24,5 +24,5 @@ **************************************************************************/ void popup_find_dialog(void) { - /* PORTME */ + // PORTME } diff --git a/client/gui-qt/finddlg.h b/client/gui-qt/finddlg.h index 960545f312..8b7c7da730 100644 --- a/client/gui-qt/finddlg.h +++ b/client/gui-qt/finddlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2003 - The Freeciv Project 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 @@ -17,4 +17,4 @@ extern "C" { #include "finddlg_g.h" } -#endif /* FC__FINDDLG_H */ +#endif // FC__FINDDLG_H diff --git a/client/gui-qt/fonts.cpp b/client/gui-qt/fonts.cpp index e6de6cc131..ae04a4fa5d 100644 --- a/client/gui-qt/fonts.cpp +++ b/client/gui-qt/fonts.cpp @@ -62,9 +62,7 @@ void fc_font::drop() ****************************************************************************/ QFont *fc_font::get_font(QString name) { - /** - * example: get_font("gui_qt_font_notify_label") - */ + // Example: get_font("gui_qt_font_notify_label") if (font_map.contains(name)) { return font_map.value(name); @@ -146,7 +144,7 @@ void configure_fonts() smaller = qRound(scale * 12); default_size = qRound(scale *14); - /* default and help label*/ + // Default and help label sl << "Segoe UI" << "Cousine" << "Liberation Sans" << "Droid Sans" << "Ubuntu" << "Noto Sans" << "DejaVu Sans" << "Luxi Sans" << "Lucida Sans" << "Trebuchet MS" << "Times New Roman"; @@ -162,7 +160,7 @@ void configure_fonts() fc_strlcpy(gui_options.gui_qt_font_city_names, fn_bytes.data(), 512); } - /* default for help text */ + // Default for help text font_name = configure_font(fonts::help_text, sl, default_size); if (!font_name.isEmpty()) { fn_bytes = font_name.toLocal8Bit(); @@ -171,7 +169,7 @@ void configure_fonts() } sl.clear(); - /* notify */ + // Notify sl << "Cousine" << "Liberation Mono" << "Source Code Pro" << "Source Code Pro [ADBO]" << "Noto Mono" << "Ubuntu Mono" << "Courier New"; @@ -182,7 +180,7 @@ void configure_fonts() fn_bytes.data(), 512); } - /* standard for chat */ + // Standard for chat font_name = configure_font(fonts::chatline, sl, default_size); if (!font_name.isEmpty()) { fn_bytes = font_name.toLocal8Bit(); @@ -190,7 +188,7 @@ void configure_fonts() fn_bytes.data(), 512); } - /* City production */ + // City production sl.clear(); sl << "Arimo" << "Play" << "Tinos" << "Ubuntu" << "Times New Roman" << "Droid Sans" << "Noto Sans"; @@ -201,7 +199,8 @@ void configure_fonts() fc_strlcpy(gui_options.gui_qt_font_city_productions, fn_bytes.data(), 512); } - /* Reqtree */ + + // Reqtree sl.clear(); sl << "Papyrus" << "Segoe Script" << "Comic Sans MS" << "Droid Sans" << "Noto Sans" << "Ubuntu"; diff --git a/client/gui-qt/gotodlg.cpp b/client/gui-qt/gotodlg.cpp index f92cfb13c2..463839bb27 100644 --- a/client/gui-qt/gotodlg.cpp +++ b/client/gui-qt/gotodlg.cpp @@ -26,10 +26,10 @@ #include #include -/* common */ +// common #include "game.h" -/* client */ +// client #include "client_main.h" #include "control.h" #include "goto.h" @@ -60,7 +60,7 @@ #define SPECENUM_VALUE7 GOTODLG_TRADE #define SPECENUM_VALUE7NAME N_("Trade") -#define SPECENUM_COUNT NUM_GOTODLG_COLUMNS /* number of columns in the goto dialog */ +#define SPECENUM_COUNT NUM_GOTODLG_COLUMNS // number of columns in the goto dialog #include "specenum_gen.h" diff --git a/client/gui-qt/gotodlg.h b/client/gui-qt/gotodlg.h index 64f4a7806a..87564a1eab 100644 --- a/client/gui-qt/gotodlg.h +++ b/client/gui-qt/gotodlg.h @@ -22,10 +22,10 @@ extern "C" { #include "gotodlg_g.h" } -//Qt +// Qt #include -//common +// common #include "dialogs.h" #include "unit.h" @@ -75,4 +75,4 @@ private: struct tile *original_tile; }; -#endif /* FC__GOTODLG_H */ +#endif // FC__GOTODLG_H diff --git a/client/gui-qt/graphics.h b/client/gui-qt/graphics.h index f4f3754189..2108193dfc 100644 --- a/client/gui-qt/graphics.h +++ b/client/gui-qt/graphics.h @@ -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 @@ -18,4 +18,4 @@ extern "C" { #include "graphics_g.h" } -#endif /* FC__GRAPHICS_H */ +#endif // FC__GRAPHICS_H diff --git a/client/gui-qt/gui_main.h b/client/gui-qt/gui_main.h index fe721e545a..54e6464fec 100644 --- a/client/gui-qt/gui_main.h +++ b/client/gui-qt/gui_main.h @@ -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 @@ -17,4 +17,4 @@ void popup_quit_dialog(); QApplication *current_app(); -#endif /* FC__GUI_MAIN_H */ +#endif // FC__GUI_MAIN_H diff --git a/client/gui-qt/helpdlg.cpp b/client/gui-qt/helpdlg.cpp index 8e25a2658c..29952b65c3 100644 --- a/client/gui-qt/helpdlg.cpp +++ b/client/gui-qt/helpdlg.cpp @@ -252,7 +252,7 @@ void help_dialog::make_tree() title = pitem->topic; for (s = pitem->topic; *s == ' '; s++) { - /* nothing */ + // Nothing } item = new QTreeWidgetItem(QStringList(title)); @@ -922,7 +922,7 @@ void help_widget::set_topic_unit(const help_item *topic, QLabel *tb; tb = new QLabel(this); - /* TRANS: this and similar literal strings interpreted as (Qt) HTML */ + // TRANS: this and similar literal strings interpreted as (Qt) HTML str = _("Requires"); str = "" + str + " " + link_me(advance_name_translation(tech), HELP_TECH); @@ -1390,7 +1390,7 @@ void help_widget::set_topic_terrain(const help_item *topic, } if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { - /* TRANS: this and similar literal strings interpreted as (Qt) HTML */ + // TRANS: this and similar literal strings interpreted as (Qt) HTML add_extras_of_act_for_terrain(pterrain, ACTIVITY_IRRIGATE, _("Build as irrigation")); } if (action_id_univs_not_blocking(ACTION_MINE, NULL, &for_terr)) { @@ -1414,7 +1414,7 @@ void help_widget::set_topic_terrain(const help_item *topic, if (*(pterrain->resources)) { struct extra_type **r; - /* TODO: include resource frequency information */ + // TODO: include resource frequency information for (r = pterrain->resources; *r; r++) { canvas = terrain_canvas(pterrain, *r); vbox->addLayout(create_terrain_widget( diff --git a/client/gui-qt/helpdlg.h b/client/gui-qt/helpdlg.h index 79d31bc02a..e48a0c96ab 100644 --- a/client/gui-qt/helpdlg.h +++ b/client/gui-qt/helpdlg.h @@ -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 @@ -150,4 +150,4 @@ public: void update_help_fonts(); -#endif /* FC__HELPDLG_H */ +#endif // FC__HELPDLG_H diff --git a/client/gui-qt/hudwidget.cpp b/client/gui-qt/hudwidget.cpp index 752ce63f3c..8a146b5c0c 100644 --- a/client/gui-qt/hudwidget.cpp +++ b/client/gui-qt/hudwidget.cpp @@ -455,7 +455,6 @@ void hud_input_box::timerEvent(QTimerEvent *event) update(); } - /************************************************************************//** Paint event for custom input box ****************************************************************************/ @@ -636,7 +635,7 @@ void hud_units::update_actions(unit_list *punits) + punit->moves_left), false)) + QString(")"); } - /* TRANS: MP = Movement points */ + // TRANS: MP = Movement points mp = QString(_("MP: ")) + mp; text_str = text_str + mp + " "; text_str += QString(_("HP:%1/%2")).arg( @@ -646,7 +645,8 @@ void hud_units::update_actions(unit_list *punits) snum = QString::number(unit_list_size(punit->tile->units) - 1); if (unit_list_size(get_units_in_focus()) > 1) { int n = unit_list_size(get_units_in_focus()); - /* TRANS: preserve leading space; always at least 2 */ + + // TRANS: preserve leading space; always at least 2 text_str = text_str + QString(PL_(" (Selected %1 unit)", " (Selected %1 units)", n)) .arg(n); @@ -654,7 +654,7 @@ void hud_units::update_actions(unit_list *punits) QByteArray ut_bytes; ut_bytes = snum.toLocal8Bit(); - /* TRANS: preserve leading space */ + // TRANS: preserve leading space text_str = text_str + QString(PL_(" +%1 unit", " +%1 units", num-1)) .arg(ut_bytes.data()); @@ -688,7 +688,7 @@ void hud_units::update_actions(unit_list *punits) p.end(); pix = pix2; } - /* Draw movement points */ + // Draw movement points move_pt_text = move_points_text(punit->moves_left, false); if (move_pt_text.contains('/')) { fraction2 = move_pt_text.right(1); @@ -988,7 +988,7 @@ int unit_actions::update_actions() qDeleteAll(actions); actions.clear(); - /* Create possible actions */ + // Create possible actions if (unit_can_add_or_build_city(current_unit)) { a = new hud_action(this); @@ -1033,11 +1033,13 @@ int unit_actions::update_actions() actions.append(a); } - /* Road */ + // Road { bool ok = false; + extra_type_by_cause_iterate(EC_ROAD, pextra) { struct road_type *proad = extra_road_get(pextra); + if (can_build_road(proad, current_unit, unit_tile(current_unit))) { ok = true; } @@ -1049,7 +1051,7 @@ int unit_actions::update_actions() actions.append(a); } } - /* Goto */ + // Goto a = new hud_action(this); a->action_shortcut = SC_GOTO; a->set_pixmap(fc_icons::instance()->get_pixmap("goto")); @@ -1071,7 +1073,7 @@ int unit_actions::update_actions() actions.append(a); } - /* Load */ + // Load if (unit_can_load(current_unit)) { a = new hud_action(this); a->action_shortcut = SC_LOAD; @@ -1079,7 +1081,7 @@ int unit_actions::update_actions() actions.append(a); } - /* Set homecity */ + // Set homecity if (tile_city(unit_tile(current_unit))) { if (can_unit_change_homecity_to(current_unit, tile_city(unit_tile(current_unit)))) { @@ -1090,7 +1092,7 @@ int unit_actions::update_actions() } } - /* Upgrade */ + // Upgrade if (UU_OK == unit_upgrade_test(current_unit, FALSE)) { a = new hud_action(this); a->action_shortcut = SC_UPGRADE_UNIT; @@ -1098,7 +1100,7 @@ int unit_actions::update_actions() actions.append(a); } - /* Automate */ + // Automate if (can_unit_do_autosettlers(current_unit)) { a = new hud_action(this); a->action_shortcut = SC_AUTOMATE; @@ -1106,7 +1108,7 @@ int unit_actions::update_actions() actions.append(a); } - /* Paradrop */ + // Paradrop if (can_unit_paradrop(current_unit)) { a = new hud_action(this); a->action_shortcut = SC_PARADROP; @@ -1114,7 +1116,7 @@ int unit_actions::update_actions() actions.append(a); } - /* Clean pollution */ + // Clean pollution if (can_unit_do_activity(current_unit, ACTIVITY_POLLUTION)) { a = new hud_action(this); a->action_shortcut = SC_PARADROP; @@ -1122,7 +1124,7 @@ int unit_actions::update_actions() actions.append(a); } - /* Unload */ + // Unload if (unit_transported(current_unit) && can_unit_unload(current_unit, unit_transport_get(current_unit)) && can_unit_exist_at_tile(&(wld.map), current_unit, @@ -1133,7 +1135,7 @@ int unit_actions::update_actions() actions.append(a); } - /* Nuke */ + // Nuke if (unit_can_do_action(current_unit, ACTION_NUKE)) { a = new hud_action(this); a->action_shortcut = SC_NUKE; @@ -1141,13 +1143,13 @@ int unit_actions::update_actions() actions.append(a); } - /* Wait */ + // Wait a = new hud_action(this); a->action_shortcut = SC_WAIT; a->set_pixmap(fc_icons::instance()->get_pixmap("wait")); actions.append(a); - /* Done moving */ + // Done moving a = new hud_action(this); a->action_shortcut = SC_DONE_MOVING; a->set_pixmap(fc_icons::instance()->get_pixmap("done")); @@ -1246,10 +1248,11 @@ void hud_unit_loader::show_me() setColumnCount(max_size + 1); for (i = 0 ; i < transports.count(); i++) { QString str; + spite = get_unittype_sprite(tileset, transports.at(i)->utype, direction8_invalid()); str = utype_rule_name(transports.at(i)->utype); - /* TRANS: MP - just movement points */ + // TRANS: MP - just movement points str = str + " (" + QString(move_points_text(transports.at(i)->moves_left, false)) + _("MP") + ")"; @@ -1685,10 +1688,10 @@ void show_new_turn_info() } s = s + "\n" + science_dialog_text() + "\n"; - /* Can't use QString().sprintf() as msys libintl.h defines sprintf() as a macro */ + // Can't use QString().sprintf() as msys libintl.h defines sprintf() as a macro fc_snprintf(buf, sizeof(buf), "%+d", player_get_expected_income(client.conn.playing)); - /* TRANS: current gold, then loss/gain per turn */ + // TRANS: current gold, then loss/gain per turn s = s + QString(_("Gold: %1 (%2)")) .arg(client.conn.playing->economic.gold) .arg(buf); diff --git a/client/gui-qt/hudwidget.h b/client/gui-qt/hudwidget.h index 723461d936..8a7a8a3fb0 100644 --- a/client/gui-qt/hudwidget.h +++ b/client/gui-qt/hudwidget.h @@ -378,5 +378,5 @@ private: QElapsedTimer m_timer; }; -#endif /* FC__HUDWIDGET_H */ +#endif // FC__HUDWIDGET_H diff --git a/client/gui-qt/inteldlg.cpp b/client/gui-qt/inteldlg.cpp index bf4b6a3352..69be2a7eab 100644 --- a/client/gui-qt/inteldlg.cpp +++ b/client/gui-qt/inteldlg.cpp @@ -24,7 +24,7 @@ **************************************************************************/ void close_intel_dialog(struct player *p) { - /* PORTME */ + // PORTME } /**********************************************************************//** @@ -32,7 +32,7 @@ void close_intel_dialog(struct player *p) **************************************************************************/ void popup_intel_dialog(struct player *p) { - /* PORTME */ + // PORTME } /**********************************************************************//** @@ -41,5 +41,5 @@ void popup_intel_dialog(struct player *p) **************************************************************************/ void update_intel_dialog(struct player *p) { - /* PORTME */ + // PORTME } diff --git a/client/gui-qt/inteldlg.h b/client/gui-qt/inteldlg.h index 672dbc0129..d6009835c6 100644 --- a/client/gui-qt/inteldlg.h +++ b/client/gui-qt/inteldlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2003 - The Freeciv Project 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 @@ -17,4 +17,4 @@ extern "C" { #include "inteldlg_g.h" } -#endif /* FC__INTELDLG_H */ +#endif // FC__INTELDLG_H diff --git a/client/gui-qt/luaconsole.cpp b/client/gui-qt/luaconsole.cpp index 9bd833228c..c1b6ac7810 100644 --- a/client/gui-qt/luaconsole.cpp +++ b/client/gui-qt/luaconsole.cpp @@ -24,7 +24,7 @@ // common #include "featured_text.h" -/* client/luascript */ +// client/luascript #include "script_client.h" // gui-qt @@ -39,7 +39,7 @@ QString qlua_filename; *****************************************************************************/ void luaconsole_dialog_popup(bool raise) { - /* lua output is in chat */ + // Lua output is in chat } /*************************************************************************//** diff --git a/client/gui-qt/luaconsole.h b/client/gui-qt/luaconsole.h index c7527d1c87..a9b8a07769 100644 --- a/client/gui-qt/luaconsole.h +++ b/client/gui-qt/luaconsole.h @@ -20,4 +20,4 @@ extern "C" { void qload_lua_script(); void qreload_lua_script(); -#endif /* FC__LUACONSOLE_H */ +#endif // FC__LUACONSOLE_H diff --git a/client/gui-qt/mapctrl.cpp b/client/gui-qt/mapctrl.cpp index acd988a141..c3d8f57433 100644 --- a/client/gui-qt/mapctrl.cpp +++ b/client/gui-qt/mapctrl.cpp @@ -106,7 +106,7 @@ void create_line_at_mouse_pos(void) **************************************************************************/ void update_rect_at_mouse_pos(void) { - /* PLS DONT PORT IT */ + // PLS DONT PORT IT } /**********************************************************************//** @@ -229,7 +229,7 @@ void map_view::shortcut_pressed(int key) pcity = nullptr; } - /* Trade Generator - skip */ + // Trade Generator - skip sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON); if (bt == sc->mouse && md == sc->mod && gui()->trade_gen.hover_city) { @@ -240,7 +240,7 @@ void map_view::shortcut_pressed(int key) return; } - /* Rally point - select city - skip */ + // Rally point - select city - skip if (bt == sc->mouse && md == sc->mod && gui()->rallies.hover_city) { char text[1024]; @@ -263,7 +263,7 @@ void map_view::shortcut_pressed(int key) return; } - /* Rally point - select tile - skip */ + // Rally point - select tile - skip if (bt == Qt::LeftButton && gui()->rallies.hover_tile && ctile != NULL) { char text[1024]; @@ -316,7 +316,7 @@ void map_view::shortcut_pressed(int key) return; } - /* Check configured shortcuts */ + // Check configured shortcuts if (!gui()->menu_bar->delayed_order) { sc = fc_shortcuts::sc()->get_shortcut(SC_QUICK_SELECT); if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod @@ -438,7 +438,7 @@ void map_view::shortcut_pressed(int key) sc = fc_shortcuts::sc()->get_shortcut(SC_SCROLL_MAP); sc_sec = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON); if ((((key && key == sc->key) || (bt == sc->mouse - /* check if keyboardless goto active and its shortcut if pressed */ + // Check if keyboardless goto active and its shortcut if pressed || (goto_is_active() && (bt == (sc->mouse | sc_sec->mouse))))) && md == sc->mod)) { recenter_button_pressed(pos.x(), pos.y()); diff --git a/client/gui-qt/mapctrl.h b/client/gui-qt/mapctrl.h index d68f0dbbf0..6387267436 100644 --- a/client/gui-qt/mapctrl.h +++ b/client/gui-qt/mapctrl.h @@ -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 @@ -18,4 +18,4 @@ extern "C" { #include "mapctrl_g.h" } -#endif /* FC__MAPCTRL_H */ +#endif // FC__MAPCTRL_H diff --git a/client/gui-qt/mapview.cpp b/client/gui-qt/mapview.cpp index 736d125fb9..ddc4457045 100644 --- a/client/gui-qt/mapview.cpp +++ b/client/gui-qt/mapview.cpp @@ -70,8 +70,8 @@ extern int last_center_enemy_city; bool is_point_in_area(int x, int y, int px, int py, int pxe, int pye) { if (x >= px && y >= py && x <= pxe && y <= pye) { - return true; - } + return true; + } return false; } @@ -93,7 +93,7 @@ void draw_calculated_trade_routes(QPainter *painter) return; } pcolor = get_color(tileset, COLOR_MAPVIEW_TRADE_ROUTES_NO_BUILT); - /* Draw calculated trade routes */ + // Draw calculated trade routes if (gui_options.draw_city_trade_routes) { foreach (qgilles, gui()->trade_gen.lines) { @@ -104,7 +104,7 @@ void draw_calculated_trade_routes(QPainter *painter) tile_to_canvas_pos(&x1, &y1, qgilles.t1); tile_to_canvas_pos(&x2, &y2, qgilles.t2); - /* Dont draw if route was already established */ + // Dont draw if route was already established if (tile_city(qgilles.t1) && tile_city(qgilles.t2) && have_cities_trade_route(tile_city(qgilles.t1), tile_city(qgilles.t2))) { @@ -133,7 +133,7 @@ void draw_calculated_trade_routes(QPainter *painter) y2 + tileset_tile_height(tileset) / 2 - h); } } - /* Draw virtual cities */ + // Draw virtual cities foreach (pcity, gui()->trade_gen.virtual_cities) { float canvas_x, canvas_y; if (pcity->tile != nullptr @@ -333,9 +333,7 @@ void map_view::find_place(int pos_x, int pos_y, int &w, int &h, int wdth, bool cont_searching = false; if (recursive_nr >= 1000) { - /** - * give up searching position - */ + // Give up searching position return; } /** @@ -1207,7 +1205,7 @@ void update_map_canvas_scrollbars(void) **************************************************************************/ void update_map_canvas_scrollbars_size(void) { - /* PORTME */ + // PORTME } /**********************************************************************//** @@ -1228,7 +1226,7 @@ void pixmap_put_overlay_tile(int canvas_x, int canvas_y, return; } - /* PORTME */ + // PORTME } /**********************************************************************//** @@ -1250,7 +1248,7 @@ void put_cross_overlay_tile(struct tile *ptile) **************************************************************************/ void draw_selection_rectangle(int canvas_x, int canvas_y, int w, int h) { - /* PORTME */ + // PORTME } /**********************************************************************//** @@ -1264,7 +1262,7 @@ void tileset_changed(void) update_unit_info_label(get_units_in_focus()); destroy_city_dialog(); - /* Update science report if open */ + // Update science report if open if (gui()->is_repo_dlg_open("SCI")) { i = gui()->gimme_index_of("SCI"); fc_assert(i != -1); @@ -1312,7 +1310,7 @@ void overview_size_changed(void) **************************************************************************/ void update_overview_scroll_window_pos(int x, int y) { - /* TODO: PORTME. */ + // TODO: PORTME. } /**********************************************************************//** diff --git a/client/gui-qt/mapview.h b/client/gui-qt/mapview.h index 26adc9898d..d0ef6f8d0c 100644 --- a/client/gui-qt/mapview.h +++ b/client/gui-qt/mapview.h @@ -262,4 +262,4 @@ bool mapview_is_frozen(void); void pixmap_put_overlay_tile(int canvas_x, int canvas_y, struct sprite *ssprite); -#endif /* FC__MAPVIEW_H */ +#endif // FC__MAPVIEW_H diff --git a/client/gui-qt/menu.cpp b/client/gui-qt/menu.cpp index 8a145eb6c6..e44ec1dbaa 100644 --- a/client/gui-qt/menu.cpp +++ b/client/gui-qt/menu.cpp @@ -515,7 +515,7 @@ void real_menus_init(void) gov_menu::create_all(); - /* A new ruleset may have been loaded. */ + // A new ruleset may have been loaded. go_act_menu::reset_all(); } @@ -694,7 +694,7 @@ void gov_menu::update_all() go_act_menu::go_act_menu(QWidget* parent) : QMenu(_("Go to and..."), parent) { - /* Will need auto updates etc. */ + // Will need auto updates etc. instances << this; } @@ -703,7 +703,7 @@ go_act_menu::go_act_menu(QWidget* parent) **************************************************************************/ go_act_menu::~go_act_menu() { - /* Updates are no longer needed. */ + // Updates are no longer needed. instances.remove(this); } @@ -714,10 +714,10 @@ static void reset_menu_and_sub_menues(QMenu *menu) { QAction *action; - /* Delete each existing menu item. */ + // Delete each existing menu item. foreach(action, menu->actions()) { if (action->menu() != nullptr) { - /* Delete the sub menu */ + // Delete the sub menu reset_menu_and_sub_menues(action->menu()); action->menu()->deleteLater(); } @@ -732,10 +732,10 @@ static void reset_menu_and_sub_menues(QMenu *menu) **************************************************************************/ void go_act_menu::reset() { - /* Clear menu item to action ID mapping. */ + // Clear menu item to action ID mapping. items.clear(); - /* Remove the menu items */ + // Remove the menu items reset_menu_and_sub_menues(this); } @@ -747,7 +747,7 @@ void go_act_menu::create() QAction *item; int tgt_kind_group; - /* Group goto and perform action menu items by target kind. */ + // Group goto and perform action menu items by target kind. for (tgt_kind_group = 0; tgt_kind_group < ATK_COUNT; tgt_kind_group++) { action_iterate(act_id) { struct action *paction = action_by_number(act_id); @@ -755,12 +755,12 @@ void go_act_menu::create() .replace("&", "&&")); if (action_id_get_actor_kind(act_id) != AAK_UNIT) { - /* This action isn't performed by a unit. */ + // This action isn't performed by an unit. continue; } if (action_id_get_target_kind(act_id) != tgt_kind_group) { - /* Wrong group. */ + // Wrong group. continue; } @@ -798,7 +798,7 @@ void go_act_menu::create() extra_type_iterate(pextra) { if (!(action_creates_extra(paction, pextra) || action_removes_extra(paction, pextra))) { - /* Not relevant */ + // Not relevant continue; } @@ -808,11 +808,11 @@ void go_act_menu::create() } extra_type_iterate_end; break; case ASTK_NONE: - /* Should not be here. */ + // Should not be here. fc_assert(action_get_sub_target_kind(paction) != ASTK_NONE); break; case ASTK_COUNT: - /* Should not exits */ + // Should not exits fc_assert(action_get_sub_target_kind(paction) != ASTK_COUNT); break; } @@ -851,12 +851,12 @@ void go_act_menu::update() bool can_do_something = false; if (!actions_are_ready()) { - /* Nothing to do. */ + // Nothing to do. return; } if (items.isEmpty()) { - /* The goto and act menu needs menu items. */ + // The goto and act menu needs menu items. create(); } @@ -875,10 +875,10 @@ void go_act_menu::update() } if (can_do_something) { - /* At least one menu item is enabled for one of the selected units. */ + // At least one menu item is enabled for one of the selected units. setEnabled(true); } else { - /* No menu item is enabled any of the selected units. */ + // No menu item is enabled any of the selected units. setEnabled(false); } } @@ -939,7 +939,7 @@ struct tile *mr_menu::find_last_unit_pos(unit *punit, int pos) continue; } - if (punit == zunit) { /* Unit found */ + if (punit == zunit) { // Unit found /* Unit was ordered to attack city so it might stay in front of that city */ if (is_non_allied_city_tile(fui->ptile, unit_owner(punit))) { @@ -950,7 +950,7 @@ struct tile *mr_menu::find_last_unit_pos(unit *punit, int pos) } else { ptile = fui->ptile; } - /* unit found in tranporter */ + // Unit found in tranporter } else if (unit_contained_in(punit, zunit)) { ptile = fui->ptile; } @@ -982,7 +982,7 @@ void mr_menu::setup_menus() airlift_type_id = 0; quick_airlifting = false; - /* Game Menu */ + // Game Menu main_menu = this->addMenu(_("Game")); #ifdef __APPLE__ @@ -1032,7 +1032,7 @@ void mr_menu::setup_menus() act->setIcon(style()->standardIcon(QStyle::SP_TitleBarCloseButton)); connect(act, &QAction::triggered, this, &mr_menu::quit_game); - /* View Menu */ + // View Menu main_menu = this->addMenu(Q_("?verb:View")); act = main_menu->addAction(_("Center View")); act->setShortcut(QKeySequence(shortcut_to_string( @@ -1155,7 +1155,7 @@ void mr_menu::setup_menus() fc_shortcuts::sc()->get_shortcut(SC_STACK_SIZE)))); connect(act, &QAction::triggered, this, &mr_menu::slot_stack_size); - /* Select Menu */ + // Select Menu main_menu = this->addMenu(_("Select")); act = main_menu->addAction(_("Single Unit (Unselect Others)")); act->setShortcut(QKeySequence(tr("shift+z"))); @@ -1197,7 +1197,7 @@ void mr_menu::setup_menus() menu_list.insert(NOT_4_OBS, act); connect(act, &QAction::triggered, this, &mr_menu::slot_unit_filter); - /* Unit Menu */ + // Unit Menu main_menu = this->addMenu(_("Unit")); act = main_menu->addAction(_("Go to Tile")); act->setShortcut(QKeySequence(shortcut_to_string( @@ -1205,7 +1205,7 @@ void mr_menu::setup_menus() menu_list.insert(STANDARD, act); connect(act, &QAction::triggered, this, &mr_menu::slot_unit_goto); - /* The goto and act sub menu is handled as a separate object. */ + // The goto and act sub menu is handled as a separate object. main_menu->addMenu(new go_act_menu()); act = main_menu->addAction(_("Go to Nearest City")); @@ -1278,7 +1278,7 @@ void mr_menu::setup_menus() menu_list.insert(DISBAND, act); connect(act, &QAction::triggered, this, &mr_menu::slot_disband); - /* Combat Menu */ + // Combat Menu main_menu = this->addMenu(_("Combat")); act = main_menu->addAction(_("Fortify Unit")); menu_list.insert(FORTIFY, act); @@ -1301,14 +1301,14 @@ void mr_menu::setup_menus() menu_list.insert(PILLAGE, act); act->setShortcut(QKeySequence(tr("shift+p"))); connect(act, &QAction::triggered, this, &mr_menu::slot_pillage); - /* TRANS: Menu item to bring up the action selection dialog. */ + // TRANS: Menu item to bring up the action selection dialog. act = main_menu->addAction(_("Do...")); menu_list.insert(ORDER_DIPLOMAT_DLG, act); act->setShortcut(QKeySequence(shortcut_to_string( fc_shortcuts::sc()->get_shortcut(SC_DO)))); connect(act, &QAction::triggered, this, &mr_menu::slot_action); - /* Work Menu */ + // Work Menu main_menu = this->addMenu(_("Work")); act = main_menu->addAction(QString(action_id_name_translation(ACTION_FOUND_CITY)) .replace("&", "&&")); @@ -1419,7 +1419,7 @@ void mr_menu::setup_menus() airlift_type = new QActionGroup(this); airlift_menu = multiplayer_menu->addMenu(_("Unit type for quickairlifting")); - /* Default diplo */ + // Default diplo action_vs_city = new QActionGroup(this); action_vs_unit = new QActionGroup(this); action_unit_menu = multiplayer_menu->addMenu(_("Default action vs unit")); @@ -1530,7 +1530,7 @@ void mr_menu::setup_menus() action_vs_city->addAction(act); connect(act, &QAction::triggered, this, &mr_menu::slot_action_vs_city); - /* Civilization menu */ + // Civilization menu main_menu = this->addMenu(_("Civilization")); act = main_menu->addAction(_("Tax Rates...")); menu_list.insert(NOT_4_OBS, act); @@ -1592,7 +1592,7 @@ void mr_menu::setup_menus() menu_list.insert(ENDGAME, act); connect(act, &QAction::triggered, this, &mr_menu::slot_endgame); - /* Help Menu */ + // Help Menu main_menu = this->addMenu(_("Help")); act = main_menu->addAction(Q_(HELP_OVERVIEW_ITEM)); @@ -2028,7 +2028,7 @@ void mr_menu::menus_sensitive() } } players_iterate_end; - /** Disable first all sensitive menus */ + // Disable first all sensitive menus foreach(QAction *a, menu_list) { a->setEnabled(false); } @@ -2039,7 +2039,7 @@ void mr_menu::menus_sensitive() multiplayer_menu->setDisabled(false); } - /* Non unit menus */ + // Non unit menus keys = menu_list.keys(); foreach (munit key, keys) { i = menu_list.find(key); @@ -2167,7 +2167,7 @@ void mr_menu::menus_sensitive() if (pextra != NULL) { i.value()->setText( - /* TRANS: Build mine of specific type */ + // TRANS: Build mine of specific type QString(_("Build %1")) .arg(extra_name_translation(pextra)) .replace("&", "&&")); @@ -2204,7 +2204,7 @@ void mr_menu::menus_sensitive() if (pextra != NULL) { i.value()->setText( - /* TRANS: Build irrigation of specific type */ + // TRANS: Build irrigation of specific type QString(_("Build %1")) .arg(extra_name_translation(pextra)) .replace("&", "&&")); @@ -2227,7 +2227,7 @@ void mr_menu::menus_sensitive() pterrain = tile_terrain(unit_tile(punit)); if (pterrain->cultivate_result != T_NONE) { i.value()->setText( - /* TRANS: Transform terrain to specific type */ + // TRANS: Transform terrain to specific type QString(_("Cultivate to %1")) .arg(QString(get_tile_change_menu_text (unit_tile(punit), ACTIVITY_CULTIVATE))) @@ -2250,7 +2250,7 @@ void mr_menu::menus_sensitive() pterrain = tile_terrain(unit_tile(punit)); if (pterrain->plant_result != T_NONE) { i.value()->setText( - /* TRANS: Transform terrain to specific type */ + // TRANS: Transform terrain to specific type QString(_("Plant to %1")) .arg(QString(get_tile_change_menu_text (unit_tile(punit), ACTIVITY_PLANT))) @@ -2277,7 +2277,7 @@ void mr_menu::menus_sensitive() if (pterrain->transform_result != T_NONE && pterrain->transform_result != pterrain) { i.value()->setText( - /* TRANS: Transform terrain to specific type */ + // TRANS: Transform terrain to specific type QString(_("Transform to %1")) .arg(QString(get_tile_change_menu_text (unit_tile(punit), ACTIVITY_TRANSFORM))) @@ -2321,7 +2321,7 @@ void mr_menu::menus_sensitive() if (pextra != nullptr) { i.value()->setText( - /* TRANS: Build road of specific type */ + // TRANS: Build road of specific type QString(_("Build %1")) .arg(extra_name_translation(pextra)) .replace("&", "&&")); @@ -2864,7 +2864,7 @@ void mr_menu::slot_autocaravan() foreach(gilles, gui()->trade_gen.lines) { if ((gilles.t1 == home_tile || gilles.t2 == home_tile) && gilles.autocaravan == nullptr) { - /* send caravan */ + // Send caravan if (gilles.t1 == home_tile) { dest_tile = gilles.t2; } else { @@ -3264,7 +3264,6 @@ void mr_menu::zoom_scale_fonts() update_city_descriptions(); } - /**********************************************************************//** Action "RELOAD ZOOMED OUT TILESET" **************************************************************************/ @@ -3404,6 +3403,7 @@ void mr_menu::slot_wait() void mr_menu::slot_unit_filter() { unit_hud_selector *uhs; + uhs = new unit_hud_selector(gui()->central_wdg); uhs->show_me(); } @@ -3561,7 +3561,7 @@ void mr_menu::slot_build_base(int id) if (pextra->buildable && pextra->id == id && can_unit_do_activity_targeted(punit, ACTIVITY_BASE, pextra)) { - request_new_unit_activity_targeted(punit, ACTIVITY_BASE, pextra); + request_new_unit_activity_targeted(punit, ACTIVITY_BASE, pextra); } } extra_type_by_cause_iterate_end; } unit_list_iterate_end; diff --git a/client/gui-qt/menu.h b/client/gui-qt/menu.h index d0a60864d9..f70526d4eb 100644 --- a/client/gui-qt/menu.h +++ b/client/gui-qt/menu.h @@ -290,7 +290,7 @@ public: bool quick_airlifting; Unit_type_id airlift_type_id; private slots: - /* game menu */ + // game menu void local_options(); void shortcut_options(); void server_options(); @@ -305,10 +305,10 @@ private slots: bool confirm_disruptive_selection(); void quit_game(); - /* help menu */ + // help menu void slot_help(const QString &topic); - /*used by work menu*/ + // used by work menu void slot_build_path(int id); void slot_build_base(int id); void slot_build_city(); @@ -325,7 +325,7 @@ private slots: void slot_clean_pollution(); void slot_clean_fallout(); - /*used by unit menu */ + // used by unit menu void slot_unit_sentry(); void slot_unit_explore(); void slot_unit_goto(); @@ -341,14 +341,14 @@ private slots: void slot_convert(); void slot_disband(); - /*used by combat menu*/ + // used by combat menu void slot_unit_fortify(); void slot_unit_fortress(); void slot_unit_airbase(); void slot_pillage(); void slot_action(); - /*used by view menu*/ + // used by view menu void slot_center_view(); void slot_minimap_view(); void slot_show_new_turn_text(); @@ -372,7 +372,7 @@ private slots: void zoom_reset(); void zoom_out(); - /*used by select menu */ + // used by select menu void slot_select_one(); void slot_select_all_tile(); void slot_select_same_tile(); @@ -382,7 +382,7 @@ private slots: void slot_wait(); void slot_unit_filter(); - /* used by multiplayer menu */ + // used by multiplayer menu void slot_orders_clear(); void slot_execute_orders(); void slot_delayed_goto(); @@ -397,7 +397,7 @@ private slots: void slot_action_vs_unit(); void slot_action_vs_city(); - /*used by civilization menu */ + // used by civilization menu void slot_show_map(); void calc_trade_routes(); void slot_popup_tax_rates(); @@ -423,4 +423,4 @@ private: QString *ret); }; -#endif /* FC__MENU_H */ +#endif // FC__MENU_H diff --git a/client/gui-qt/messagedlg.cpp b/client/gui-qt/messagedlg.cpp index bd85a54002..222846ed74 100644 --- a/client/gui-qt/messagedlg.cpp +++ b/client/gui-qt/messagedlg.cpp @@ -32,6 +32,7 @@ #include "messagedlg.h" extern QApplication *qapp; + /**********************************************************************//** Message widget constructor **************************************************************************/ @@ -139,8 +140,9 @@ void message_dlg::apply_changes() int i, j; QTableWidgetItem *item; Qt::CheckState state; + for (i = 0; i <= event_type_max(); i++) { - /* Include possible undefined messages. */ + // Include possible undefined messages. messages_where[i] = 0; } i = 0; diff --git a/client/gui-qt/messagedlg.h b/client/gui-qt/messagedlg.h index 598d4261cf..919061cec1 100644 --- a/client/gui-qt/messagedlg.h +++ b/client/gui-qt/messagedlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2003 - The Freeciv Project 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 @@ -17,7 +17,7 @@ extern "C" { #include "messagedlg_g.h" } -//Qt +// Qt #include class QTableWidget; @@ -42,4 +42,4 @@ private slots: void popup_messageopt_dialog(void); -#endif /* FC__MESSAGEDLG_H */ +#endif // FC__MESSAGEDLG_H diff --git a/client/gui-qt/messagewin.cpp b/client/gui-qt/messagewin.cpp index f2ede73ab4..049f805e03 100644 --- a/client/gui-qt/messagewin.cpp +++ b/client/gui-qt/messagewin.cpp @@ -202,7 +202,7 @@ messagewdg::messagewdg(QWidget *parent): QWidget(parent) layout->setContentsMargins(0, 0, 3, 3); setLayout(layout); - /* dont highlight show current cell - set the same colors*/ + // Dont highlight show current cell - set the same colors palette.setColor(QPalette::Highlight, QColor(0, 0, 0, 0)); palette.setColor(QPalette::HighlightedText, QColor(205, 206, 173)); palette.setColor(QPalette::Text, QColor(205, 206, 173)); @@ -361,7 +361,7 @@ void messagewdg::resizeEvent(QResizeEvent* event) ***************************************************************************/ void meswin_dialog_popup(bool raise) { - /* PORTME */ + // PORTME } /***********************************************************************//** @@ -369,7 +369,7 @@ void meswin_dialog_popup(bool raise) ***************************************************************************/ bool meswin_dialog_is_open(void) { - /* PORTME */ + // PORTME return true; } @@ -378,7 +378,7 @@ bool meswin_dialog_is_open(void) ***************************************************************************/ void real_meswin_dialog_update(void *unused) { - int i, num; + int i, num; const struct message *pmsg; if (gui()->infotab == NULL) { diff --git a/client/gui-qt/messagewin.h b/client/gui-qt/messagewin.h index dc6a8d5d46..450e9e0840 100644 --- a/client/gui-qt/messagewin.h +++ b/client/gui-qt/messagewin.h @@ -22,10 +22,10 @@ extern "C" { #include "messagewin_g.h" } -//Qt +// Qt #include -//qt-client +// gui-qt #include "chatline.h" #include "mapview.h" @@ -97,4 +97,4 @@ protected: int& e_pos(); }; -#endif /* FC__MESSAGEWIN_H */ +#endif // FC__MESSAGEWIN_H diff --git a/client/gui-qt/optiondlg.cpp b/client/gui-qt/optiondlg.cpp index 9b5305d9ab..cf9af45121 100644 --- a/client/gui-qt/optiondlg.cpp +++ b/client/gui-qt/optiondlg.cpp @@ -52,7 +52,7 @@ enum { RESPONSE_SAVE }; -/* global value to store pointers to opened config dialogs */ +// Global value to store pointers to opened config dialogs QMap dialog_list; /************************************************************************//** @@ -105,7 +105,7 @@ QString cut_helptext(QString text) QStringList sl; QString ret_str; - /* Remove all lines from help which has '*' in first 3 chars */ + // Remove all lines from help which has '*' in first 3 chars sl = text.split('\n'); foreach (const QString & s, sl) { if (s.count() > 2) { @@ -688,7 +688,7 @@ void option_dialog::add_option(struct option *poption) combo = new QComboBox(); for (i = 0; (str = option_enum_int_to_str(poption, i)); i++) { - /* we store enum value in QVariant */ + // We store enum value in QVariant combo->addItem(_(str), i); } widget = combo; diff --git a/client/gui-qt/optiondlg.h b/client/gui-qt/optiondlg.h index c9f89b2112..63233ff3be 100644 --- a/client/gui-qt/optiondlg.h +++ b/client/gui-qt/optiondlg.h @@ -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 @@ -34,6 +34,7 @@ class QString; QString split_text(QString text, bool cut); QString cut_helptext(QString text); + /**************************************************************************** Dialog for client/server options ****************************************************************************/ @@ -81,4 +82,4 @@ private slots: void set_font(); }; -#endif /* FC__OPTIONDLG_H */ +#endif // FC__OPTIONDLG_H diff --git a/client/gui-qt/pages.cpp b/client/gui-qt/pages.cpp index bbbcca3252..bc3a3fbdc5 100644 --- a/client/gui-qt/pages.cpp +++ b/client/gui-qt/pages.cpp @@ -157,7 +157,7 @@ void fc_client::create_main_page(void) rev_ver = fc_git_revision(); if (rev_ver == NULL) { - /* TRANS: "version 3.1.0, Qt5 client" */ + // TRANS: "version 3.1.0, Qt5 client" #ifdef FC_QT5_MODE fc_snprintf(msgbuf, sizeof(msgbuf), _("%s%s, Qt5 client"), word_version(), VERSION_STRING); @@ -172,7 +172,7 @@ void fc_client::create_main_page(void) main_graphics.height() - fm.descent() - fm.height() * 2, msgbuf); - /* TRANS: "commit: [modified] " */ + // TRANS: "commit: [modified] " fc_snprintf(msgbuf, sizeof(msgbuf), _("commit: %s"), rev_ver); painter.drawText(10, main_graphics.height() - fm.descent() - fm.height(), @@ -955,7 +955,7 @@ void fc_client::update_server_list(enum server_scan_type sstype, row++; } server_list_iterate_end; - /* Remove unneeded rows, if there are any */ + // Remove unneeded rows, if there are any while (old_row_count - row > 0) { sel->removeRow(old_row_count - 1); old_row_count--; @@ -1087,7 +1087,7 @@ void fc_client::slot_meta_scan() void fc_client::start_new_game() { if (is_server_running() || client_start_server()) { - /* saved settings are sent in client/options.c load_settable_options() */ + // Saved settings are sent in client/options.c load_settable_options() } } @@ -1268,13 +1268,13 @@ void fc_client::slot_selection_changed(const QItemSelection &selected, } } } - /* Break case (and return) if no human player found */ + // Break case (and return) if no human player found if (pl_str == nullptr) { load_save_text->setText(final_str); break; } - /* Information about human player */ + // Information about human player pl_bytes = pl_str.toLocal8Bit(); if ((sf = secfile_load_section(fn_bytes.data(), pl_bytes.data(), true))) { @@ -1314,17 +1314,18 @@ void fc_client::slot_selection_changed(const QItemSelection &selected, str_pixmap = str_pixmap + line; } - /* Reset terrain information */ + // Reset terrain information terrain_type_iterate(pterr) { pterr->identifier_load = '\0'; } terrain_type_iterate_end; - /* Load possible terrains and their identifiers (chars) */ + // Load possible terrains and their identifiers (chars) if ((sf = secfile_load_section(fn_bytes.data(), - "savefile", true))) + "savefile", true))) { while ((terr_name = secfile_lookup_str_default(sf, NULL, "savefile.terrident%d.name", ii)) != NULL) { struct terrain *pterr = terrain_by_rule_name(terr_name); + if (pterr != NULL) { const char *iptr = secfile_lookup_str_default(sf, NULL, "savefile.terrident%d.identifier", ii); @@ -1332,8 +1333,9 @@ void fc_client::slot_selection_changed(const QItemSelection &selected, } ii++; } + } - /* Create image */ + // Create image QImage img(nat_x, nat_y, QImage::Format_ARGB32_Premultiplied); img.fill(Qt::black); @@ -1363,10 +1365,10 @@ void fc_client::slot_selection_changed(const QItemSelection &selected, load_pix->setFixedSize(pm.width(), pm.height()); -#else /* FC_QT5_MODE */ +#else // FC_QT5_MODE load_pix->setFixedSize(load_pix->pixmap()->width(), load_pix->pixmap()->height()); -#endif /* FC_QT5_MODE */ +#endif // FC_QT5_MODE if ((sf = secfile_load_section(fn_bytes.data(), "research", TRUE))) { @@ -1495,7 +1497,7 @@ void fc_client::update_scenarios_page(void) version = QString("%1.%2").arg(maj).arg(min); } } else { - /* TRANS: Unknown scenario format */ + // TRANS: Unknown scenario format version = QString(_("pre-2.6")); } @@ -1555,7 +1557,6 @@ void fc_client::update_scenarios_page(void) scenarios_load->update(); } - /**********************************************************************//** Configure the dialog depending on what type of authentication request the server is making. @@ -1690,9 +1691,7 @@ void fc_client::update_start_page() i++; } players_iterate_end; gui()->pr_options->set_aifill(i); - /** - * Inserts playing players, observing custom players, and AI) - */ + // Inserts playing players, observing custom players, and AI) players_iterate(pplayer) { host = ""; @@ -1800,9 +1799,7 @@ void fc_client::update_start_page() } } - /** - * find any custom observers - */ + // Find any custom observers recursed_items.clear(); conn_list_iterate(pplayer->connections, pconn) { if (pconn->id == conn_id) { @@ -1822,9 +1819,7 @@ void fc_client::update_start_page() player_item->addChildren(items); start_players_tree->insertTopLevelItem(0, player_item); - /** - * Insert global observers - */ + // Insert global observers items.clear(); global_item = new QTreeWidgetItem(); global_item->setText(0, _("Global observers")); @@ -1858,9 +1853,7 @@ void fc_client::update_start_page() start_players_tree->insertTopLevelItem(1, global_item); items.clear(); - /** - * Insert detached - */ + // Insert detached detach_item = new QTreeWidgetItem(); detach_item->setText(0, _("Detached")); qvar2 = 0; @@ -1891,14 +1884,14 @@ void fc_client::update_buttons() bool sensitive; QString text; - /* Observe button */ + // Observe button if (client_is_observer() || client_is_global_observer()) { obs_button->setText(_("Don't Observe")); } else { obs_button->setText(_("Observe")); } - /* Ready button */ + // Ready button if (can_client_control()) { sensitive = true; if (client_player()->is_ready) { @@ -1939,7 +1932,7 @@ void fc_client::update_buttons() start_button->setEnabled(sensitive); start_button->setText(text); - /* Nation button */ + // Nation button sensitive = game.info.is_new_game && can_client_control(); nation_button->setEnabled(sensitive); @@ -2025,7 +2018,7 @@ void fc_client::start_page_menu(QPoint pos) if (can_conn_edit_players_nation(&client.conn, pplayer)) { str = QString(_("Pick nation")); action = new QAction(str, start_players_tree); - str = "PICK:" + QString(player_name(pplayer)); /* PICK is a key */ + str = "PICK:" + QString(player_name(pplayer)); // PICK is a key QObject::connect(action, &QAction::triggered, [this,str]() { send_fake_chat_message(str); }); @@ -2033,9 +2026,7 @@ void fc_client::start_page_menu(QPoint pos) } if (is_ai(pplayer)) { - /** - * Set AI difficulty submenu - */ + // Set AI difficulty submenu if (ALLOW_CTRL <= client.conn.access_level) { submenu_AI->setTitle(_("Set difficulty")); menu->addMenu(submenu_AI); @@ -2055,9 +2046,7 @@ void fc_client::start_page_menu(QPoint pos) } } - /** - * Put to Team X submenu - */ + // Put to Team X submenu if (pplayer && game.info.is_new_game) { menu->addMenu(submenu_team); submenu_team->setTitle(_("Put on team")); diff --git a/client/gui-qt/pages.h b/client/gui-qt/pages.h index a8fcd9f04d..9365d88f20 100644 --- a/client/gui-qt/pages.h +++ b/client/gui-qt/pages.h @@ -27,4 +27,4 @@ struct server_scan; void create_conn_menu(player*, connection*); void server_scan_error(server_scan*, const char*); -#endif /* FC__PAGES_H */ +#endif // FC__PAGES_H diff --git a/client/gui-qt/plrdlg.cpp b/client/gui-qt/plrdlg.cpp index c74cf1f0cb..6824abf878 100644 --- a/client/gui-qt/plrdlg.cpp +++ b/client/gui-qt/plrdlg.cpp @@ -518,9 +518,9 @@ void plr_widget::nation_selected(const QItemSelection &sl, egold = _("(Unknown)"); egov = _("(Unknown)"); } - /** Formatting rich text */ + // Formatting rich text intel_str = - /* TRANS: this and similar literal strings interpreted as (Qt) HTML */ + // TRANS: this and similar literal strings interpreted as (Qt) HTML QString("
") + _("Nation") + QString("") + QString(nation_adjective_for_player(pplayer)).toHtmlEscaped() + QString("
") + _("Ruler:") + QString("") @@ -874,7 +874,7 @@ void plr_report::update_report(bool update_selection) plr_wdg->get_model()->populate(); } - /* Force updating selected player information */ + // Force updating selected player information if (update_selection) { qmi = plr_wdg->currentIndex(); if (qmi.isValid()) { diff --git a/client/gui-qt/plrdlg.h b/client/gui-qt/plrdlg.h index e62f894b93..38028e9d8e 100644 --- a/client/gui-qt/plrdlg.h +++ b/client/gui-qt/plrdlg.h @@ -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 @@ -174,5 +174,4 @@ private slots: void popup_players_dialog(bool raise); void popdown_players_report(void); - -#endif /* FC__PLRDLG_H */ +#endif // FC__PLRDLG_H diff --git a/client/gui-qt/qtg_cxxside.h b/client/gui-qt/qtg_cxxside.h index c18982356e..5a0cc2b953 100644 --- a/client/gui-qt/qtg_cxxside.h +++ b/client/gui-qt/qtg_cxxside.h @@ -150,4 +150,4 @@ void qtg_recv_create_clause(struct Treaty *ptreaty, struct player *they); void qtg_recv_remove_clause(struct Treaty *ptreaty, struct player *they); void qtg_recv_accept_treaty(struct Treaty *ptreaty, struct player *they); -#endif /* FC__QTG_CXXSIDE_H */ +#endif // FC__QTG_CXXSIDE_H diff --git a/client/gui-qt/ratesdlg.cpp b/client/gui-qt/ratesdlg.cpp index f6b2221ca5..90cd168ae8 100644 --- a/client/gui-qt/ratesdlg.cpp +++ b/client/gui-qt/ratesdlg.cpp @@ -62,7 +62,7 @@ tax_rates_dialog::tax_rates_dialog(QWidget *parent) max = 100; } - /* Trans: Government - max rate (of taxes) x% */ + // Trans: Government - max rate (of taxes) x% str = QString(_("%1 - max rate: %2%")). arg(government_name_for_player(client.conn.playing), QString::number(max)); @@ -270,7 +270,7 @@ void popup_rates_dialog(void) **************************************************************************/ void real_multipliers_dialog_update(void *unused) { - /* PORTME */ + // PORTME } /**********************************************************************//** diff --git a/client/gui-qt/ratesdlg.h b/client/gui-qt/ratesdlg.h index 8686ccb12a..5365980545 100644 --- a/client/gui-qt/ratesdlg.h +++ b/client/gui-qt/ratesdlg.h @@ -113,4 +113,4 @@ private slots: void popup_multiplier_dialog(void); -#endif /* FC__RATESDLG_H */ +#endif // FC__RATESDLG_H diff --git a/client/gui-qt/repodlgs.cpp b/client/gui-qt/repodlgs.cpp index 9f0088f2e2..e9793b867a 100644 --- a/client/gui-qt/repodlgs.cpp +++ b/client/gui-qt/repodlgs.cpp @@ -435,7 +435,7 @@ void units_reports::update_units(bool show) clear_layout(); memset(unit_array, '\0', sizeof(unit_array)); memset(&unit_totals, '\0', sizeof(unit_totals)); - /* Count units. */ + // Count units. players_iterate(pplayer) { if (client_has_player() && pplayer != client_player()) { continue; @@ -453,9 +453,9 @@ void units_reports::update_units(bool show) if (VUT_UTYPE == pcity->production.kind) { int num_units; info = unit_array + utype_index(pcity->production.value.utype); - /* Account for build slots in city */ + // Account for build slots in city (void) city_production_build_units(pcity, true, &num_units); - /* Unit is in progress even if it won't be done this turn */ + // Unit is in progress even if it won't be done this turn num_units = MAX(num_units, 1); info->building_count += num_units; } @@ -468,7 +468,7 @@ void units_reports::update_units(bool show) upgradable = client_has_player() && nullptr != can_upgrade_unittype(client_player(), utype); if (0 == info->active_count && 0 == info->building_count) { - continue; /* We don't need a row for this type. */ + continue; // We don't need a row for this type. } ui = new unittype_item(this, utype); ui->label_info_active.setText("⚔:" + QString::number(info->active_count)); @@ -1003,7 +1003,7 @@ void science_report::update_report() progress->setValue(done); } - /** Collect all techs which are reachable in the next step. */ + // Collect all techs which are reachable in the next step. advance_index_iterate(A_FIRST, i) { if (TECH_PREREQS_KNOWN == research->inventions[i].state) { item.tech_str @@ -1015,7 +1015,7 @@ void science_report::update_report() } advance_index_iterate_end; - /** Collect all techs which are reachable in next 10 steps. */ + // Collect all techs which are reachable in next 10 steps. advance_index_iterate(A_FIRST, i) { if (research_invention_reachable(research, i) && TECH_KNOWN != research->inventions[i].state @@ -1028,11 +1028,11 @@ void science_report::update_report() } } advance_index_iterate_end; - /** sort both lists */ + // Sort both lists std::sort(goal_list->begin(), goal_list->end(), comp_less_than); std::sort(curr_list->begin(), curr_list->end(), comp_less_than); - /** fill combo boxes */ + // Fill combo boxes researching_combo->blockSignals(true); goal_combo->blockSignals(true); @@ -1060,7 +1060,7 @@ void science_report::update_report() goal_combo->insertItem(i, ic, goal_list->at(i).tech_str, qvar); } - /** set current tech and goal */ + // Set current tech and goal qres = research->researching; if (qres == A_UNSET || is_future_tech(research->researching)) { researching_combo->insertItem(0, research_advance_name_translation( diff --git a/client/gui-qt/repodlgs.h b/client/gui-qt/repodlgs.h index a25fb709fd..c94efd79da 100644 --- a/client/gui-qt/repodlgs.h +++ b/client/gui-qt/repodlgs.h @@ -132,6 +132,7 @@ public: struct impr_type *timpr; struct government *tgov; }; + /**************************************************************************** Custom widget representing research diagram in science_report ****************************************************************************/ @@ -264,4 +265,4 @@ void popdown_endgame_report(); void popup_endgame_report(); void toggle_units_report(bool); -#endif /* FC__REPODLGS_H */ +#endif // FC__REPODLGS_H diff --git a/client/gui-qt/shortcuts.cpp b/client/gui-qt/shortcuts.cpp index f558a41be7..80a118f435 100644 --- a/client/gui-qt/shortcuts.cpp +++ b/client/gui-qt/shortcuts.cpp @@ -554,14 +554,14 @@ void fc_sc_button::popup_error() QList fsb_list; QString title; - /* wait until shortcut popup is destroyed */ + // Wait until shortcut popup is destroyed fsb_list = findChildren(); if (fsb_list.count() > 0) { QTimer::singleShot(20, this, SLOT(popup_error())); return; } - /* TRANS: Given shortcut(%1) is already assigned */ + // TRANS: Given shortcut(%1) is already assigned title = QString(_("%1 is already assigned to")) .arg(shortcut_to_string(sc)); scinfo = new hud_message_box(gui()->central_wdg); diff --git a/client/gui-qt/shortcuts.h b/client/gui-qt/shortcuts.h index b2a26b37c2..a02d085af8 100644 --- a/client/gui-qt/shortcuts.h +++ b/client/gui-qt/shortcuts.h @@ -29,7 +29,7 @@ void write_shortcuts(); bool read_shortcuts(); void shortcutreset(); -/* Assing numbers for casting */ +// Assing numbers for casting enum shortcut_id { SC_NONE = 0, SC_SCROLL_MAP = 1, @@ -203,4 +203,4 @@ private slots: void edit_shortcut(); }; -#endif /* FC__SHORTCUSDLG_H */ +#endif // FC__SHORTCUSDLG_H diff --git a/client/gui-qt/sidebar.cpp b/client/gui-qt/sidebar.cpp index 0148d4ed27..5596df09d9 100644 --- a/client/gui-qt/sidebar.cpp +++ b/client/gui-qt/sidebar.cpp @@ -561,7 +561,7 @@ void fc_sidebar::resize_me(int hght, bool force) non_std = 0; non_std_count = 0; - /* resize all non standard sidewidgets first*/ + // Resize all non standard sidewidgets first foreach (fc_sidewidget * sw, objects) { if (sw->standard != SW_STD) { sw->resize_pixmap(w, 0); @@ -574,7 +574,7 @@ void fc_sidebar::resize_me(int hght, bool force) h = h - non_std; h = h / (objects.count() - non_std_count) - 2; - /* resize all standard sidewidgets */ + // Resize all standard sidewidgets foreach (fc_sidewidget * sw, objects) { if (sw->standard == SW_STD) { sw->resize_pixmap(w, h); @@ -584,7 +584,6 @@ void fc_sidebar::resize_me(int hght, bool force) } } - /***********************************************************************//** Callback to show map ***************************************************************************/ diff --git a/client/gui-qt/sidebar.h b/client/gui-qt/sidebar.h index acb275bc3f..a2c9ee4562 100644 --- a/client/gui-qt/sidebar.h +++ b/client/gui-qt/sidebar.h @@ -41,6 +41,7 @@ void side_right_click_diplomacy(); void side_right_click_science(); void side_left_click_science(bool nothing); void side_show_map(bool nothing); + /*************************************************************************** Class representing single widget(icon) on sidebar ***************************************************************************/ @@ -121,6 +122,4 @@ private: QVBoxLayout *layout; }; - -#endif /* FC__SIDEBAR_H */ - +#endif // FC__SIDEBAR_H diff --git a/client/gui-qt/spaceshipdlg.cpp b/client/gui-qt/spaceshipdlg.cpp index 6ac23e1827..0b1cae794e 100644 --- a/client/gui-qt/spaceshipdlg.cpp +++ b/client/gui-qt/spaceshipdlg.cpp @@ -144,7 +144,7 @@ void popup_spaceship_dialog(struct player *pplayer) ****************************************************************************/ void popdown_spaceship_dialog(struct player *pplayer) { - /* PORTME */ + // PORTME } /************************************************************************//** @@ -188,4 +188,3 @@ void popdown_all_spaceships_dialogs() ss_rep->deleteLater(); } } - diff --git a/client/gui-qt/spaceshipdlg.h b/client/gui-qt/spaceshipdlg.h index 0bb9fc8e97..92ce6e934d 100644 --- a/client/gui-qt/spaceshipdlg.h +++ b/client/gui-qt/spaceshipdlg.h @@ -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 @@ -22,12 +22,12 @@ extern "C" { #include "spaceshipdlg_g.h" } -/* client */ -#include "text.h" - // Qt #include +// client +#include "text.h" + class QLabel; class QPixmap; class QPushButton; @@ -59,4 +59,4 @@ private: void popup_spaceship_dialog(struct player *pplayer); void popdown_all_spaceships_dialogs(); -#endif /* FC__SPACESHIPDLG_H */ +#endif // FC__SPACESHIPDLG_H diff --git a/client/gui-qt/sprite.cpp b/client/gui-qt/sprite.cpp index f010e9a72e..89df676a29 100644 --- a/client/gui-qt/sprite.cpp +++ b/client/gui-qt/sprite.cpp @@ -198,7 +198,7 @@ struct sprite *qtg_load_gfxnumber(int num) QString ns; int w, h; QPixmap *pm; - /* FIXME: This should not depend on city_productions font setting */ + // FIXME: This should not depend on city_productions font setting QFont *qf = fc_font::instance()->get_font(fonts::city_productions); if (gui()->map_scale != 1.0f && gui()->map_font_scale) { diff --git a/client/gui-qt/sprite.h b/client/gui-qt/sprite.h index 871cb6456d..3c31ac8706 100644 --- a/client/gui-qt/sprite.h +++ b/client/gui-qt/sprite.h @@ -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 @@ -25,4 +25,4 @@ struct sprite QPixmap *pm; }; -#endif /* FC__SPRITE_H */ +#endif // FC__SPRITE_H diff --git a/client/gui-qt/themes.cpp b/client/gui-qt/themes.cpp index 3daa72b771..bb39b3e5cf 100644 --- a/client/gui-qt/themes.cpp +++ b/client/gui-qt/themes.cpp @@ -21,13 +21,13 @@ #include #include -/* utility */ +// utility #include "mem.h" -/* client */ +// client #include "themes_common.h" -/* client/include */ +// client/include #include "themes_g.h" // gui-qt @@ -69,7 +69,7 @@ void qtg_gui_load_theme(const char *directory, const char *theme_name) } return; } - /* Stylesheet uses UNIX separators */ + // Stylesheet uses UNIX separators fake_dir = data_dir; fake_dir.replace(QString(DIR_SEPARATOR), "/"); QTextStream in(&f); @@ -105,7 +105,7 @@ void qtg_gui_load_theme(const char *directory, const char *theme_name) void qtg_gui_clear_theme() { if (!load_theme(FC_QT_DEFAULT_THEME_NAME)) { - /* TRANS: No full stop after the URL, could cause confusion. */ + // TRANS: No full stop after the URL, could cause confusion. log_fatal(_("No Qt-client theme was found. For instructions on how to " "get one, please visit %s"), HOMEPAGE_URL); exit(EXIT_FAILURE); @@ -168,7 +168,7 @@ char **qtg_get_useable_themes_in_directory(const char *directory, int *count) } qtheme_name = gui_options.gui_qt_default_theme_name; - /* move current theme on first position */ + // Move current theme on first position if (theme_list.contains(qtheme_name)) { theme_list.removeAll(qtheme_name); theme_list.prepend(qtheme_name); diff --git a/client/gui-qt/voteinfo_bar.cpp b/client/gui-qt/voteinfo_bar.cpp index bbfb2df65f..b533299f56 100644 --- a/client/gui-qt/voteinfo_bar.cpp +++ b/client/gui-qt/voteinfo_bar.cpp @@ -119,15 +119,15 @@ void pregamevote::update_vote() vote_count = voteinfo_queue_size(); vi = voteinfo_queue_get_current(&index); if (vi != NULL && vi->resolved && vi->passed) { - /* TRANS: Describing a vote that passed. */ + // TRANS: Describing a vote that passed. fc_snprintf(status, sizeof(status), _("[passed]")); sz_strlcpy(color, "green"); } else if (vi != NULL && vi->resolved && !vi->passed) { - /* TRANS: Describing a vote that failed. */ + // TRANS: Describing a vote that failed. fc_snprintf(status, sizeof(status), _("[failed]")); sz_strlcpy(color, "red"); } else if (vi != NULL && vi->remove_time > 0) { - /* TRANS: Describing a vote that was removed. */ + // TRANS: Describing a vote that was removed. fc_snprintf(status, sizeof(status), _("[removed]")); sz_strlcpy(color, "grey"); } else { diff --git a/client/gui-qt/voteinfo_bar.h b/client/gui-qt/voteinfo_bar.h index 957f764d4a..11b3b84185 100644 --- a/client/gui-qt/voteinfo_bar.h +++ b/client/gui-qt/voteinfo_bar.h @@ -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 @@ -63,4 +63,4 @@ protected: void paintEvent(QPaintEvent *event); }; -#endif /* FC__VOTEBAR_H */ +#endif // FC__VOTEBAR_H diff --git a/client/gui-qt/wldlg.cpp b/client/gui-qt/wldlg.cpp index fc4dbfa8e8..d56f2aae5b 100644 --- a/client/gui-qt/wldlg.cpp +++ b/client/gui-qt/wldlg.cpp @@ -23,5 +23,5 @@ **************************************************************************/ void update_worklist_report_dialog(void) { - /* PORTME */ + // PORTME } diff --git a/client/gui-qt/wldlg.h b/client/gui-qt/wldlg.h index 5dd2bbae3a..8d42a0a727 100644 --- a/client/gui-qt/wldlg.h +++ b/client/gui-qt/wldlg.h @@ -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 @@ -18,4 +18,4 @@ extern "C" { #include "wldlg_g.h" } -#endif /* FC__WLDLG_H */ +#endif // FC__WLDLG_H diff --git a/tools/fcmp/mpgui_qt.cpp b/tools/fcmp/mpgui_qt.cpp index 57bb0c6bcb..79a8032e5a 100644 --- a/tools/fcmp/mpgui_qt.cpp +++ b/tools/fcmp/mpgui_qt.cpp @@ -86,7 +86,7 @@ int main(int argc, char **argv) fcmp_init(); - /* This modifies argv! */ + // This modifies argv! ui_options = fcmp_parse_cmdline(argc, argv); if (ui_options != -1) { @@ -98,7 +98,7 @@ int main(int argc, char **argv) _("This modpack installer accepts the standard Qt command-line options\n" "after '--'. See the Qt documentation.\n\n")); - /* TRANS: No full stop after the URL, could cause confusion. */ + // TRANS: No full stop after the URL, could cause confusion. fc_fprintf(stderr, _("Report bugs at %s\n"), BUG_URL); ui_options = -1; @@ -391,14 +391,14 @@ void mpgui::setup_list(const char *name, const char *URL, if (modpack_type_is_valid(type)) { type_str = _(modpack_type_name(type)); } else { - /* TRANS: Unknown modpack type */ + // TRANS: Unknown modpack type type_str = _("?"); } if (license != nullptr) { lic_str = license; } else { - /* TRANS: License of modpack is not known */ + // TRANS: License of modpack is not known lic_str = Q_("?license:Unknown"); } diff --git a/tools/ruledit/effect_edit.h b/tools/ruledit/effect_edit.h index 7c0937e2b7..ab3d6ed73d 100644 --- a/tools/ruledit/effect_edit.h +++ b/tools/ruledit/effect_edit.h @@ -31,8 +31,8 @@ class QSpinBox; class ruledit_gui; enum effect_filter_main_class { EFMC_NORMAL, - EFMC_NONE, /* No requirements */ - EFMC_ALL /* Any requirements */ + EFMC_NONE, // No requirements + EFMC_ALL // Any requirements }; struct effect_list_fill_data diff --git a/tools/ruledit/req_edit.cpp b/tools/ruledit/req_edit.cpp index 844c671f11..1149fc0c7b 100644 --- a/tools/ruledit/req_edit.cpp +++ b/tools/ruledit/req_edit.cpp @@ -452,7 +452,7 @@ void req_edit::delete_now() void req_edit::incoming_req_vec_change(const requirement_vector *vec) { if (req_vector == vec) { - /* The selected requirement may be gone */ + // The selected requirement may be gone selected = nullptr; requirement_vector_iterate(req_vector, preq) { @@ -463,7 +463,7 @@ void req_edit::incoming_req_vec_change(const requirement_vector *vec) } requirement_vector_iterate_end; if (selected == nullptr) { - /* The currently selected requirement was deleted. */ + // The currently selected requirement was deleted. clear_selected(); } diff --git a/tools/ruledit/req_vec_fix.cpp b/tools/ruledit/req_vec_fix.cpp index 98196a33bb..79fae48dd5 100644 --- a/tools/ruledit/req_vec_fix.cpp +++ b/tools/ruledit/req_vec_fix.cpp @@ -11,7 +11,7 @@ GNU General Public License for more details. ***********************************************************************/ -/* Qt */ +// Qt #include #include #include @@ -22,7 +22,7 @@ #include #include -/* ruledit */ +// ruledit #include "ruledit_qt.h" @@ -37,6 +37,7 @@ void mark_item(QListWidgetItem *item, enum req_vec_problem_seriousness problem_level) { QWidget *in = item->listWidget(); + switch (problem_level) { case RVPS_NO_PROBLEM: item->setIcon(QIcon()); @@ -65,14 +66,14 @@ req_vec_fix_problem::req_vec_fix_problem( QVBoxLayout *layout_main = new QVBoxLayout(); - /* Sanity check. */ + // Sanity check. fc_assert_ret(item_info); description = new QLabel(); layout_main->addWidget(description); if (problem == nullptr) { - /* Everything is OK. */ + // Everything is OK. /* TRANS: Trying to fix a requirement vector problem but can't find * any. */ @@ -82,7 +83,7 @@ req_vec_fix_problem::req_vec_fix_problem( } if (problem->num_suggested_solutions == 0) { - /* Didn't get any suggestions about how to solve this. */ + // Didn't get any suggestions about how to solve this. char buf[MAX_LEN_NAME * 3]; @@ -97,13 +98,13 @@ req_vec_fix_problem::req_vec_fix_problem( return; } - /* A problem with at least one solution exists. */ + // A problem with at least one solution exists. fc_assert_ret(problem && problem->num_suggested_solutions > 0); - /* Display the problem text */ + // Display the problem text description->setText(QString::fromUtf8(problem->description_translated)); - /* Display each solution */ + // Display each solution solutions = new QButtonGroup(this); for (i = 0; i < problem->num_suggested_solutions; i++) { QRadioButton *solution = new QRadioButton( @@ -116,7 +117,7 @@ req_vec_fix_problem::req_vec_fix_problem( layout_main->addWidget(solution); } - /* TRANS: Apply the selected requirement vector problem fix. */ + // TRANS: Apply the selected requirement vector problem fix. accept = new QPushButton(R__("Accept selected solution")); connect(accept, SIGNAL(pressed()), this, SLOT(accept_solution())); layout_main->addWidget(accept); @@ -158,7 +159,7 @@ req_vec_fix::req_vec_fix(ruledit_gui *ui_in, this->setWindowTitle(R__("Requirement problem")); this->setAttribute(Qt::WA_DeleteOnClose); - /* Set up the area for viewing problems */ + // Set up the area for viewing problems this->current_problem_viewer = nullptr; this->current_problem_area = new QStackedLayout(); layout_main->addLayout(current_problem_area); @@ -231,10 +232,10 @@ bool req_vec_fix::refresh() req_vec_problem_free(current_problem); } - /* Update the current problem. */ + // Update the current problem. this->current_problem = item_info->find_next_problem(); - /* Display the new problem */ + // Display the new problem if (current_problem_viewer != nullptr) { current_problem_viewer->hide(); current_problem_viewer->deleteLater(); @@ -246,11 +247,11 @@ bool req_vec_fix::refresh() current_problem_area->addWidget(current_problem_viewer); current_problem_area->setCurrentWidget(current_problem_viewer); - /* Only shown when there is something to do */ + // Only shown when there is something to do apply_changes->setVisible(did_apply_a_solution); abort->setVisible(did_apply_a_solution); - /* Only shown when no work will be lost */ + // Only shown when no work will be lost close->setVisible(!did_apply_a_solution); return current_problem != nullptr; @@ -278,7 +279,7 @@ void req_vec_fix::apply_solution(int selected_solution) box->setWindowTitle(R__("Unable to apply solution")); box->setText( - /* TRANS: requirement vector fix failed to apply */ + // TRANS: requirement vector fix failed to apply QString(R__("Failed to apply solution %1 for %2 to %3.")) .arg(req_vec_change_translation(solution, item_info->vector_namer()), @@ -286,7 +287,7 @@ void req_vec_fix::apply_solution(int selected_solution) box->setStandardButtons(QMessageBox::Ok); box->exec(); } else { - /* A solution has been applied */ + // A solution has been applied this->did_apply_a_solution = true; } @@ -302,10 +303,10 @@ void req_vec_fix::accept_applied_solutions() this->item_info->apply_accepted_changes(); - /* All is accepted */ + // All is accepted this->did_apply_a_solution = false; - /* New check point. */ + // New check point. this->refresh(); for (i = 0; i < item_info->num_vectors(); i++) { @@ -321,10 +322,10 @@ void req_vec_fix::reject_applied_solutions() { this->item_info->undo_accepted_changes(); - /* All is gone */ + // All is gone this->did_apply_a_solution = false; - /* Back to the start again. */ + // Back to the start again. this->refresh(); } @@ -335,7 +336,7 @@ void req_vec_fix::reject_applied_solutions() void req_vec_fix::incoming_req_vec_change(const requirement_vector *vec) { if (this->item_info->vector_in_item(vec)) { - /* Can't trust the changes done against a previous version. */ + // Can't trust the changes done against a previous version. reject_applied_solutions(); } } diff --git a/tools/ruledit/req_vec_fix.h b/tools/ruledit/req_vec_fix.h index 462def7469..fc18b1fe21 100644 --- a/tools/ruledit/req_vec_fix.h +++ b/tools/ruledit/req_vec_fix.h @@ -18,10 +18,10 @@ #include #endif -/* Qt */ +// Qt #include -/* common */ +// common #include "requirements.h" class QButtonGroup; @@ -31,7 +31,7 @@ class QStackedLayout; class ruledit_gui; -/* How serious a req_vec_problem is considered */ +// How serious a req_vec_problem is considered enum req_vec_problem_seriousness { RVPS_NO_PROBLEM, RVPS_IMPROVE, @@ -192,4 +192,4 @@ private slots: void incoming_req_vec_change(const requirement_vector *vec); }; -#endif /* FC__REQ_VEC_FIX_H */ +#endif // FC__REQ_VEC_FIX_H diff --git a/tools/ruledit/ruledit.cpp b/tools/ruledit/ruledit.cpp index f29e64ba7d..680fe945c9 100644 --- a/tools/ruledit/ruledit.cpp +++ b/tools/ruledit/ruledit.cpp @@ -17,7 +17,7 @@ #include "fc_prehdrs.h" -/* ANSI */ +// ANSI #include #include @@ -26,26 +26,26 @@ #include #endif -/* utility */ +// utility #include "fc_cmdline.h" #include "fciconv.h" #include "fcintl.h" #include "log.h" #include "registry.h" -/* common */ +// common #include "fc_cmdhelp.h" #include "fc_interface.h" #include "version.h" -/* server */ +// server #include "sernet.h" #include "settings.h" -/* tools/shared */ +// tools/shared #include "tools_fc_interface.h" -/* ruledit */ +// ruledit #include "comments.h" #include "ruledit_qt.h" @@ -72,10 +72,10 @@ int main(int argc, char **argv) if (LoadLibrary("exchndl.dll") == NULL) { # ifdef FREECIV_DEBUG fprintf(stderr, "exchndl.dll could not be loaded, no crash debugger\n"); -# endif /* FREECIV_DEBUG */ +# endif // FREECIV_DEBUG } -# endif /* FREECIV_NDEBUG */ -#endif /* FREECIV_MSWINDOWS */ +# endif // FREECIV_NDEBUG +#endif // FREECIV_MSWINDOWS init_nls(); @@ -92,7 +92,7 @@ int main(int argc, char **argv) log_init(NULL, loglevel, NULL, NULL, fatal_assertions); - /* Initialize command line arguments. */ + // Initialize command line arguments. reargs.ruleset = NULL; ui_options = re_parse_cmdline(argc, argv); @@ -102,13 +102,13 @@ int main(int argc, char **argv) settings_init(FALSE); - /* Reset aifill to zero */ + // Reset aifill to zero game.info.aifill = 0; game_init(FALSE); i_am_tool(); - /* Initialize the fc_interface functions needed to understand rules. */ + // Initialize the fc_interface functions needed to understand rules. fc_interface_init_tool(); if (comments_load()) { @@ -129,7 +129,7 @@ int main(int argc, char **argv) free_libfreeciv(); free_nls(); - /* Clean up command line arguments. */ + // Clean up command line arguments. cmdline_option_values_free(); return exit_status; @@ -158,15 +158,15 @@ static int re_parse_cmdline(int argc, char *argv[]) cmdhelp_add(help, "v", "version", R__("Print the version number")); cmdhelp_add(help, "r", - /* TRANS: argument (don't translate) VALUE (translate) */ + // TRANS: argument (don't translate) VALUE (translate) R__("ruleset RULESET"), R__("Ruleset to use as the starting point.")); #ifndef FREECIV_NDEBUG cmdhelp_add(help, "F", - /* TRANS: "Fatal" is exactly what user must type, do not translate. */ + // TRANS: "Fatal" is exactly what user must type, do not translate. R__("Fatal [SIGNAL]"), R__("Raise a signal on failed assertion")); -#endif /* FREECIV_NDEBUG */ +#endif // FREECIV_NDEBUG /* The function below prints a header and footer for the options. * Furthermore, the options are sorted. */ cmdhelp_display(help, TRUE, TRUE, TRUE); @@ -195,7 +195,7 @@ static int re_parse_cmdline(int argc, char *argv[]) fc_fprintf(stderr, R__("Try using --help.\n")); exit(EXIT_FAILURE); } -#endif /* FREECIV_NDEBUG */ +#endif // FREECIV_NDEBUG } else if (is_option("--", argv[i])) { ui_separator = TRUE; } else { diff --git a/tools/ruledit/ruledit.h b/tools/ruledit/ruledit.h index 47cb79da15..06f4cdcb46 100644 --- a/tools/ruledit/ruledit.h +++ b/tools/ruledit/ruledit.h @@ -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 @@ -16,10 +16,10 @@ void show_experimental(QWidget *wdg); struct ruledit_arguments { - /* Ruleset name. Is NULL if not specified. */ + // Ruleset name. Is NULL if not specified. char *ruleset; }; extern struct ruledit_arguments reargs; -#endif /* FC__RULEDIT_H */ +#endif // FC__RULEDIT_H diff --git a/tools/ruledit/ruledit_qt.cpp b/tools/ruledit/ruledit_qt.cpp index e9780a4d3f..94019b38a4 100644 --- a/tools/ruledit/ruledit_qt.cpp +++ b/tools/ruledit/ruledit_qt.cpp @@ -232,7 +232,7 @@ void ruledit_gui::launch_now() if (load_rulesets(NULL, NULL, TRUE, conversion_log_cb, FALSE, TRUE, TRUE)) { display_msg(R__("Ruleset loaded")); - /* Make freeable copy */ + // Make freeable copy if (game.server.ruledit.nationlist != NULL) { data.nationlist = fc_strdup(game.server.ruledit.nationlist); } else { @@ -351,7 +351,7 @@ void ruledit_gui::open_req_vec_fix(req_vec_fix_item *item_info) if (old_fixer->item() == item_info->item()) { item_info->close(); - /* Already open */ + // Already open return; } } req_vec_fix_list_iterate_end; diff --git a/tools/ruledit/ruledit_qt.h b/tools/ruledit/ruledit_qt.h index 38ec8e1c0c..464d443083 100644 --- a/tools/ruledit/ruledit_qt.h +++ b/tools/ruledit/ruledit_qt.h @@ -64,7 +64,7 @@ protected: void closeEvent(QCloseEvent *cevent); }; -/* get 'struct req_edit_list' and related functions: */ +// get 'struct req_edit_list' and related functions: #define SPECLIST_TAG req_edit #define SPECLIST_TYPE class req_edit #include "speclist.h" @@ -73,7 +73,7 @@ protected: TYPED_LIST_ITERATE(class req_edit, reqeditlist, preqedit) #define req_edit_list_iterate_end LIST_ITERATE_END -/* get 'struct effect_edit_list' and related functions: */ +// get 'struct effect_edit_list' and related functions: #define SPECLIST_TAG effect_edit #define SPECLIST_TYPE class effect_edit #include "speclist.h" @@ -82,7 +82,7 @@ protected: TYPED_LIST_ITERATE(class effect_edit, effecteditlist, peffectedit) #define effect_edit_list_iterate_end LIST_ITERATE_END -/* get 'struct req_vec_fix_list' and related functions: */ +// get 'struct req_vec_fix_list' and related functions: #define SPECLIST_TAG req_vec_fix #define SPECLIST_TYPE class req_vec_fix #include "speclist.h" diff --git a/tools/ruledit/tab_enablers.cpp b/tools/ruledit/tab_enablers.cpp index c396ea2c45..f5d7b99bbc 100644 --- a/tools/ruledit/tab_enablers.cpp +++ b/tools/ruledit/tab_enablers.cpp @@ -222,15 +222,15 @@ void tab_enabler::update_enabler_info(struct action_enabler *enabler) switch (enabler_problem_level(selected)) { case RVPS_REPAIR: - /* Offer to repair the enabler if it has a problem. */ - /* TRANS: Fix an error in an action enabler. */ + // Offer to repair the enabler if it has a problem. + // TRANS: Fix an error in an action enabler. repair_button->setText(QString::fromUtf8(R__("Repair Enabler"))); repair_button->setEnabled(TRUE); break; case RVPS_IMPROVE: - /* TRANS: Fix a non error issue in an action enabler. */ - repair_button->setText(QString::fromUtf8(R__("Improve Enabler"))); - repair_button->setEnabled(true); + // TRANS: Fix a non error issue in an action enabler. + repair_button->setText(QString::fromUtf8(R__("Improve Enabler"))); + repair_button->setEnabled(true); break; case RVPS_NO_PROBLEM: repair_button->setText(QString::fromUtf8(R__("Enabler Issues"))); @@ -250,7 +250,7 @@ void tab_enabler::update_enabler_info(struct action_enabler *enabler) delete_button->setEnabled(false); } - /* The enabler may have gotten (rid of) a problem. */ + // The enabler may have gotten (rid of) a problem. action_enablers_iterate(other_enabler) { QListWidgetItem *item = enabler_list->item(i++); @@ -337,7 +337,7 @@ void tab_enabler::add_now() void tab_enabler::repair_now() { if (selected == nullptr) { - /* Nothing to repair */ + // Nothing to repair return; } @@ -369,12 +369,12 @@ void tab_enabler::edit_type(QAction *action) paction = action_by_rule_name(an_bytes.data()); if (selected != nullptr && paction != nullptr) { - /* Must remove and add back because enablers are stored by action. */ + // Must remove and add back because enablers are stored by action. action_enabler_remove(selected); selected->action = paction->id; action_enabler_add(selected); - /* Show the changes. */ + // Show the changes. update_enabler_info(selected); refresh(); } @@ -418,11 +418,11 @@ fix_enabler_item::fix_enabler_item(struct action_enabler *enabler) fc_snprintf(buf, sizeof(buf), R__("action enabler for %s"), action_rule_name(paction)); - /* Don't modify the original until the user accepts */ + // Don't modify the original until the user accepts local_copy = action_enabler_copy(enabler); current_enabler = enabler; - /* As precise a title as possible */ + // As precise a title as possible my_name = QString(buf); } @@ -496,7 +496,7 @@ struct req_vec_problem *fix_enabler_item::find_next_problem(void) **************************************************************************/ void fix_enabler_item::apply_accepted_changes() { - /* The user has approved the solution */ + // The user has approved the solution current_enabler->action = local_copy->action; requirement_vector_copy(¤t_enabler->actor_reqs, &local_copy->actor_reqs); @@ -511,7 +511,7 @@ void fix_enabler_item::apply_accepted_changes() **************************************************************************/ void fix_enabler_item::undo_accepted_changes() { - /* The user has rejected all solutions */ + // The user has rejected all solutions local_copy->action = current_enabler->action; requirement_vector_copy(&local_copy->actor_reqs, ¤t_enabler->actor_reqs); diff --git a/tools/ruledit/tab_enablers.h b/tools/ruledit/tab_enablers.h index 53b09304a1..04f26ac37b 100644 --- a/tools/ruledit/tab_enablers.h +++ b/tools/ruledit/tab_enablers.h @@ -21,7 +21,7 @@ // Qt #include -/* ruledit */ +// ruledit #include "req_vec_fix.h" class QPushButton; -- 2.35.1