MailJD nbsp;·nbsp; Test Dashboard nbsp;·nbsp; Coverage
LCOV - code coverage report
Current view: top level - ui - PlainTextMessageBox.h (source / functions) Coverage Total Hit
Test: MailJD Coverage (Unit + E2E) Lines: 100.0 % 12 12
Test Date: 2026-07-27 17:53:44 Functions: 100.0 % 2 2
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
Branches: 56.2 % 16 9

             Branch data     Line data    Source code
       1                 :             : #pragma once
       2                 :             : 
       3                 :             : #include <QMessageBox>
       4                 :             : 
       5                 :             : // QMessageBox's convenience functions leave textFormat at Qt::AutoText.
       6                 :             : // Dynamic server- or DAV-controlled strings can therefore be interpreted as
       7                 :             : // rich text.  Keep every dynamic dialog on this small, explicit PlainText
       8                 :             : // path; callers still get the normal native QMessageBox behavior.
       9                 :             : namespace PlainTextMessageBox {
      10                 :             : 
      11                 :           4 : inline QMessageBox::StandardButton question(
      12                 :             :     QWidget *parent, const QString &title, const QString &text,
      13                 :             :     QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No,
      14                 :             :     QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) {
      15         [ +  - ]:           4 :   QMessageBox box(QMessageBox::Question, title, text, buttons, parent);
      16         [ +  - ]:           4 :   box.setTextFormat(Qt::PlainText);
      17         [ +  + ]:           4 :   if (defaultButton != QMessageBox::NoButton)
      18         [ +  - ]:           2 :     box.setDefaultButton(defaultButton);
      19         [ +  - ]:           8 :   return static_cast<QMessageBox::StandardButton>(box.exec());
      20                 :           4 : }
      21                 :             : 
      22                 :           2 : inline void warning(QWidget *parent, const QString &title,
      23                 :             :                     const QString &text) {
      24         [ +  - ]:           2 :   QMessageBox box(QMessageBox::Warning, title, text, QMessageBox::Ok, parent);
      25         [ +  - ]:           2 :   box.setTextFormat(Qt::PlainText);
      26         [ +  - ]:           2 :   box.exec();
      27                 :           2 : }
      28                 :             : 
      29                 :             : } // namespace PlainTextMessageBox
        

Generated by: LCOV version 2.0-1