File indexing completed on 2024-12-22 05:05:31
0001 /* 0002 SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "logwidget.h" 0008 0009 #include <PimCommon/CustomLogWidget> 0010 0011 #include <QHBoxLayout> 0012 0013 LogWidget::LogWidget(QWidget *parent) 0014 : QWidget(parent) 0015 , mCustomLogWidget(new PimCommon::CustomLogWidget(this)) 0016 { 0017 auto layout = new QHBoxLayout(this); 0018 layout->setContentsMargins({}); 0019 layout->addWidget(mCustomLogWidget); 0020 } 0021 0022 LogWidget::~LogWidget() = default; 0023 0024 void LogWidget::clear() 0025 { 0026 mCustomLogWidget->clear(); 0027 } 0028 0029 void LogWidget::addInfoLogEntry(const QString &log) 0030 { 0031 mCustomLogWidget->addInfoLogEntry(log); 0032 } 0033 0034 void LogWidget::addErrorLogEntry(const QString &log) 0035 { 0036 mCustomLogWidget->addErrorLogEntry(log); 0037 } 0038 0039 void LogWidget::addTitleLogEntry(const QString &log) 0040 { 0041 mCustomLogWidget->addTitleLogEntry(log); 0042 } 0043 0044 QString LogWidget::toHtml() const 0045 { 0046 return mCustomLogWidget->toHtml(); 0047 } 0048 0049 QString LogWidget::toPlainText() const 0050 { 0051 return mCustomLogWidget->toPlainText(); 0052 } 0053 0054 bool LogWidget::isEmpty() const 0055 { 0056 return mCustomLogWidget->isEmpty(); 0057 } 0058 0059 void LogWidget::addEndLineLogEntry() 0060 { 0061 mCustomLogWidget->addEndLineLogEntry(); 0062 } 0063 0064 #include "moc_logwidget.cpp"