fix memory leak
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
0768623e1e
commit
26f9850462
2 changed files with 5 additions and 4 deletions
|
@ -50,7 +50,7 @@ AppearanceWidget::AppearanceWidget(bool themesOnly, QWidget* parent)
|
||||||
|
|
||||||
m_ui->catPreview->setGraphicsEffect(new QGraphicsOpacityEffect(this));
|
m_ui->catPreview->setGraphicsEffect(new QGraphicsOpacityEffect(this));
|
||||||
|
|
||||||
m_defaultFormat = new QTextCharFormat(m_ui->consolePreview->currentCharFormat());
|
m_defaultFormat = QTextCharFormat(m_ui->consolePreview->currentCharFormat());
|
||||||
|
|
||||||
if (themesOnly) {
|
if (themesOnly) {
|
||||||
m_ui->catPackLabel->hide();
|
m_ui->catPackLabel->hide();
|
||||||
|
@ -224,10 +224,10 @@ void AppearanceWidget::updateConsolePreview()
|
||||||
int fontSize = m_ui->fontSizeBox->value();
|
int fontSize = m_ui->fontSizeBox->value();
|
||||||
QString fontFamily = m_ui->consoleFont->currentFont().family();
|
QString fontFamily = m_ui->consoleFont->currentFont().family();
|
||||||
m_ui->consolePreview->clear();
|
m_ui->consolePreview->clear();
|
||||||
m_defaultFormat->setFont(QFont(fontFamily, fontSize));
|
m_defaultFormat.setFont(QFont(fontFamily, fontSize));
|
||||||
|
|
||||||
auto print = [this, colors](const QString& message, MessageLevel::Enum level) {
|
auto print = [this, colors](const QString& message, MessageLevel::Enum level) {
|
||||||
QTextCharFormat format(*m_defaultFormat);
|
QTextCharFormat format(m_defaultFormat);
|
||||||
|
|
||||||
QColor bg = colors.background.value(level);
|
QColor bg = colors.background.value(level);
|
||||||
QColor fg = colors.foreground.value(level);
|
QColor fg = colors.foreground.value(level);
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <translations/TranslationsModel.h>
|
#include <translations/TranslationsModel.h>
|
||||||
|
#include <QTextCursor>
|
||||||
#include "java/JavaChecker.h"
|
#include "java/JavaChecker.h"
|
||||||
#include "ui/pages/BasePage.h"
|
#include "ui/pages/BasePage.h"
|
||||||
|
|
||||||
|
@ -56,6 +57,6 @@ class AppearanceWidget : public QWidget {
|
||||||
void updateCatPreview();
|
void updateCatPreview();
|
||||||
|
|
||||||
Ui::AppearanceWidget* m_ui;
|
Ui::AppearanceWidget* m_ui;
|
||||||
QTextCharFormat* m_defaultFormat;
|
QTextCharFormat m_defaultFormat;
|
||||||
bool m_themesOnly;
|
bool m_themesOnly;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue