Commit 4a44d8a1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use std::unique_ptr

parent bbda184a
Pipeline #87487 passed with stage
in 8 minutes and 2 seconds
......@@ -83,7 +83,6 @@ RichTextComposer::RichTextComposer(QWidget *parent)
RichTextComposer::~RichTextComposer()
{
disconnect(d->mRichTextChangedConnection);
delete d;
}
KPIMTextEdit::RichTextExternalComposer *RichTextComposer::externalComposer() const
......
......@@ -136,6 +136,6 @@ private:
void evaluateListSupport(QKeyEvent *event);
void evaluateReturnKeySupport(QKeyEvent *event);
class RichTextComposerPrivate;
RichTextComposerPrivate *const d;
std::unique_ptr<RichTextComposerPrivate> const d;
};
}
......@@ -83,10 +83,7 @@ RichTextComposerActions::RichTextComposerActions(KPIMTextEdit::RichTextComposerC
{
}
RichTextComposerActions::~RichTextComposerActions()
{
delete d;
}
RichTextComposerActions::~RichTextComposerActions() = default;
QVector<QAction *> RichTextComposerActions::richTextActionList() const
{
......
......@@ -45,7 +45,7 @@ private:
void setHeadingLevel(int level);
void setListStyle(int _styleindex);
class RichTextComposerActionsPrivate;
RichTextComposerActionsPrivate *const d;
std::unique_ptr<RichTextComposerActionsPrivate> const d;
};
}
......@@ -137,10 +137,7 @@ RichTextComposerControler::RichTextComposerControler(RichTextComposer *richtextC
{
}
RichTextComposerControler::~RichTextComposerControler()
{
delete d;
}
RichTextComposerControler::~RichTextComposerControler() = default;
bool RichTextComposerControler::painterActive() const
{
......
......@@ -9,6 +9,7 @@
#include "kpimtextedit_export.h"
#include "richtextcomposer.h"
#include <QObject>
#include <memory>
namespace KPIMTextEdit
{
class RichTextComposer;
......@@ -94,6 +95,6 @@ public Q_SLOTS:
private:
class RichTextComposerControlerPrivate;
RichTextComposerControlerPrivate *const d;
std::unique_ptr<RichTextComposerControlerPrivate> const d;
};
}
......@@ -25,10 +25,7 @@ RichTextComposerEmailQuoteDecorator::RichTextComposerEmailQuoteDecorator(RichTex
{
}
RichTextComposerEmailQuoteDecorator::~RichTextComposerEmailQuoteDecorator()
{
delete d;
}
RichTextComposerEmailQuoteDecorator::~RichTextComposerEmailQuoteDecorator() = default;
bool RichTextComposerEmailQuoteDecorator::isSpellCheckingEnabledForBlock(const QString &blockText) const
{
......
......@@ -7,8 +7,8 @@
#pragma once
#include "kpimtextedit_export.h"
#include <memory>
#include <sonnet/spellcheckdecorator.h>
namespace KPIMTextEdit
{
class RichTextComposer;
......@@ -28,7 +28,7 @@ protected:
private:
class RichTextComposerEmailQuoteDecoratorPrivate;
RichTextComposerEmailQuoteDecoratorPrivate *const d;
std::unique_ptr<RichTextComposerEmailQuoteDecoratorPrivate> const d;
};
}
......@@ -44,10 +44,7 @@ RichTextComposerEmailQuoteHighlighter::RichTextComposerEmailQuoteHighlighter(Ric
d->parent = textEdit;
}
RichTextComposerEmailQuoteHighlighter::~RichTextComposerEmailQuoteHighlighter()
{
delete d;
}
RichTextComposerEmailQuoteHighlighter::~RichTextComposerEmailQuoteHighlighter() = default;
void RichTextComposerEmailQuoteHighlighter::setQuoteColor(const QColor &normalColor,
const QColor &quoteDepth1,
......
......@@ -7,6 +7,7 @@
#pragma once
#include "kpimtextedit_export.h"
#include <memory>
#include <sonnet/highlighter.h>
namespace KPIMTextEdit
{
......@@ -80,7 +81,7 @@ protected:
private:
class RichTextComposerEmailQuoteHighlighterPrivate;
RichTextComposerEmailQuoteHighlighterPrivate *const d;
std::unique_ptr<RichTextComposerEmailQuoteHighlighterPrivate> const d;
};
}
......@@ -41,10 +41,7 @@ RichTextComposerImages::RichTextComposerImages(RichTextComposer *composer, QObje
{
}
RichTextComposerImages::~RichTextComposerImages()
{
delete d;
}
RichTextComposerImages::~RichTextComposerImages() = default;
void RichTextComposerImages::addImage(const QUrl &url, int width, int height)
{
......
......@@ -102,7 +102,7 @@ public:
private:
class RichTextComposerImagesPrivate;
RichTextComposerImagesPrivate *const d;
std::unique_ptr<RichTextComposerImagesPrivate> const d;
};
}
......@@ -33,10 +33,7 @@ RichTextComposerWidget::RichTextComposerWidget(QWidget *parent)
layout->addWidget(editorWidget);
}
RichTextComposerWidget::~RichTextComposerWidget()
{
delete d;
}
RichTextComposerWidget::~RichTextComposerWidget() = default;
KPIMTextEdit::RichTextComposer *RichTextComposerWidget::richTextComposer() const
{
......
......@@ -27,7 +27,7 @@ public:
Q_REQUIRED_RESULT KPIMTextEdit::RichTextComposer *richTextComposer() const;
private:
RichTextComposerWidgetPrivate *const d;
std::unique_ptr<RichTextComposerWidgetPrivate> const d;
};
}
......@@ -38,10 +38,7 @@ RichTextExternalComposer::RichTextExternalComposer(RichTextComposer *composer, Q
{
}
RichTextExternalComposer::~RichTextExternalComposer()
{
delete d;
}
RichTextExternalComposer::~RichTextExternalComposer() = default;
bool RichTextExternalComposer::useExternalEditor() const
{
......
......@@ -9,6 +9,7 @@
#include "kpimtextedit_export.h"
#include <QObject>
#include <QProcess>
#include <memory>
namespace KPIMTextEdit
{
......@@ -43,7 +44,7 @@ Q_SIGNALS:
private:
void slotEditorFinished(int codeError, QProcess::ExitStatus exitStatus);
class RichTextExternalComposerPrivate;
RichTextExternalComposerPrivate *const d;
std::unique_ptr<RichTextExternalComposerPrivate> const d;
};
}
......@@ -48,7 +48,4 @@ EmoticonTextEditAction::EmoticonTextEditAction(QObject *parent)
connect(d->selector, &EmoticonTextEditSelector::itemSelected, this, &EmoticonTextEditAction::emoticonActivated);
}
EmoticonTextEditAction::~EmoticonTextEditAction()
{
delete d;
}
EmoticonTextEditAction::~EmoticonTextEditAction() = default;
......@@ -25,7 +25,7 @@ Q_SIGNALS:
private:
class EmoticonTextEditActionPrivate;
EmoticonTextEditActionPrivate *const d;
std::unique_ptr<EmoticonTextEditActionPrivate> const d;
};
}
......@@ -76,7 +76,6 @@ InsertHtmlDialog::InsertHtmlDialog(QWidget *parent)
InsertHtmlDialog::~InsertHtmlDialog()
{
writeConfig();
delete d;
}
void InsertHtmlDialog::setSelectedText(const QString &str)
......
......@@ -26,7 +26,7 @@ public:
private:
friend class InsertHtmlDialogPrivate;
InsertHtmlDialogPrivate *const d;
std::unique_ptr<InsertHtmlDialogPrivate> const d;
void readConfig();
void writeConfig();
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment