diff options
Diffstat (limited to 'src/courtroom.cpp')
| -rw-r--r-- | src/courtroom.cpp | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 486cb1c2..ff78cea5 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1253,7 +1253,7 @@ void Courtroom::set_size_and_pos(QWidget *p_widget, QString p_identifier, QStrin ao_app->get_element_dimensions(p_identifier, filename, p_misc); if (design_ini_result.width < 0 || design_ini_result.height < 0) { - qWarning() << "could not find \"" << p_identifier << "\" in " << filename; + qWarning() << "could not find" << p_identifier << "in" << filename; p_widget->hide(); } else { @@ -1265,8 +1265,7 @@ void Courtroom::set_size_and_pos(QWidget *p_widget, QString p_identifier, QStrin void Courtroom::set_taken(int n_char, bool p_taken) { if (n_char >= char_list.size()) { - qDebug() - << "W: set_taken attempted to set an index bigger than char_list size"; + qWarning() << "set_taken attempted to set an index bigger than char_list size"; return; } @@ -1287,7 +1286,7 @@ QPoint Courtroom::get_theme_pos(QString p_identifier) ao_app->get_element_dimensions(p_identifier, filename); if (design_ini_result.width < 0 || design_ini_result.height < 0) { - qWarning() << "could not find \"" << p_identifier << "\" in " << filename; + qWarning() << "could not find" << p_identifier << "in" << filename; return QPoint(0, 0); } else { @@ -3149,7 +3148,7 @@ void Courtroom::append_ic_text(QString p_text, QString p_name, QString p_action, ui_ic_chatlog->textCursor().insertText( "[" + timestamp.toString(log_timestamp_format) + "] ", normal); } else { - qDebug() << "could not insert invalid timestamp"; + qCritical() << "could not insert invalid timestamp" << timestamp; } } @@ -3265,7 +3264,7 @@ void Courtroom::play_preanim(bool immediate) else anim_state = 1; preanim_done(); - qWarning() << "could not find " + anim_to_find; + qWarning() << "could not find preanim" << f_preanim << "for character" << f_char; return; } ui_vp_player_char->set_static_duration(preanim_duration); @@ -5504,7 +5503,7 @@ void Courtroom::truncate_label_text(QWidget *p_widget, QString p_identifier) if (p_checkbox == nullptr && p_label == nullptr) { // i.e. the given p_widget isn't a QLabel or a QCheckBox - qWarning() << "W: Tried to truncate an unsupported widget:" << p_identifier; + qWarning() << "Tried to truncate an unsupported widget:" << p_identifier; return; } // translate the text for the widget we're working with so we truncate the right string @@ -5525,14 +5524,12 @@ void Courtroom::truncate_label_text(QWidget *p_widget, QString p_identifier) p_widget->fontMetrics().boundingRect(label_text_tr).width(); // pixel width of our translated text if (!p_widget->toolTip().startsWith(label_text_tr)) // don't want to append this multiple times p_widget->setToolTip(label_text_tr + "\n" + p_widget->toolTip()); - // qInfo() << "I: Width of label text: " << label_px_width << "px. Theme's - // width: " << label_theme_width << "px."; // we can't do much with a 0-width widget, and there's no need to truncate if // the theme gives us enough space if (label_theme_width <= 0 || label_px_width < label_theme_width) { - qInfo() << "I: Truncation aborted for label text " << label_text_tr - << ", either theme width <= 0 or label width < theme width."; + qDebug().nospace() << "Truncation aborted for label text " << label_text_tr + << ", either theme width <= 0 or label width < theme width."; return; } @@ -5541,8 +5538,6 @@ void Courtroom::truncate_label_text(QWidget *p_widget, QString p_identifier) while (truncated_px_width > label_theme_width && truncated_label != "…") { truncated_label.chop(2); truncated_label.append("…"); - // qInfo() << "I: Attempted to truncate label to string: " << - // truncated_label; truncated_px_width = p_widget->fontMetrics().boundingRect(truncated_label).width(); } @@ -5550,7 +5545,7 @@ void Courtroom::truncate_label_text(QWidget *p_widget, QString p_identifier) // Safeguard against edge case where label text is shorter in px than '…', // causing an infinite loop. Additionally, having just an ellipse for a // label looks strange, so we don't set the new label. - qWarning() << "W: Potential infinite loop prevented: Label text " + qWarning() << "Potential infinite loop prevented: Label text " << label_text_tr << "truncated to '…', so truncation was aborted."; return; @@ -5559,9 +5554,9 @@ void Courtroom::truncate_label_text(QWidget *p_widget, QString p_identifier) p_label->setText(truncated_label); else if (p_checkbox != nullptr) p_checkbox->setText(truncated_label); - qInfo() << "I: Truncated label text from " << label_text_tr << " (" - << label_px_width << "px ) to " << truncated_label << " (" - << truncated_px_width << "px )"; + qDebug().nospace() << "Truncated label text from " << label_text_tr << " (" + << label_px_width << "px) to " << truncated_label << " (" + << truncated_px_width << "px)"; } Courtroom::~Courtroom() |
