Commit 5eae5f88 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use std::unique_ptr

parent a59d0af5
Pipeline #87574 canceled with stage
......@@ -24,10 +24,7 @@ PluginEditor::PluginEditor(QObject *parent)
{
}
PluginEditor::~PluginEditor()
{
delete d;
}
PluginEditor::~PluginEditor() = default;
void PluginEditor::setOrder(int order)
{
......
......@@ -8,6 +8,7 @@
#include "messagecomposer_export.h"
#include <PimCommon/AbstractGenericPlugin>
#include <QObject>
#include <memory>
namespace MessageComposer
{
class PluginEditorPrivate;
......@@ -27,6 +28,6 @@ public:
virtual Q_REQUIRED_RESULT bool canProcessKeyEvent() const;
private:
PluginEditorPrivate *const d;
std::unique_ptr<PluginEditorPrivate> const d;
};
}
......@@ -147,10 +147,7 @@ PluginEditorConvertTextManager::PluginEditorConvertTextManager(QObject *parent)
{
}
PluginEditorConvertTextManager::~PluginEditorConvertTextManager()
{
delete d;
}
PluginEditorConvertTextManager::~PluginEditorConvertTextManager() = default;
PluginEditorConvertTextManager *PluginEditorConvertTextManager::self()
{
......
......@@ -34,6 +34,6 @@ public:
Q_REQUIRED_RESULT PluginEditorConvertText *pluginFromIdentifier(const QString &id);
private:
PluginEditorConvertTextManagerPrivate *const d;
std::unique_ptr<PluginEditorConvertTextManagerPrivate> const d;
};
}
......@@ -20,10 +20,7 @@ PluginEditorGrammarCustomToolsViewInterface::PluginEditorGrammarCustomToolsViewI
{
}
PluginEditorGrammarCustomToolsViewInterface::~PluginEditorGrammarCustomToolsViewInterface()
{
delete d;
}
PluginEditorGrammarCustomToolsViewInterface::~PluginEditorGrammarCustomToolsViewInterface() = default;
void PluginEditorGrammarCustomToolsViewInterface::setParentWidget(QWidget *parent)
{
......
......@@ -74,7 +74,7 @@ Q_SIGNALS:
void replaceText(const MessageComposer::PluginGrammarAction &act);
private:
PluginEditorGrammarCustomToolsViewInterfacePrivate *d = nullptr;
std::unique_ptr<PluginEditorGrammarCustomToolsViewInterfacePrivate> const d;
};
}
Q_DECLARE_METATYPE(MessageComposer::PluginGrammarAction)
......
......@@ -149,10 +149,7 @@ PluginEditorGrammarManager::PluginEditorGrammarManager(QObject *parent)
qRegisterMetaType<MessageComposer::PluginGrammarAction>();
}
PluginEditorGrammarManager::~PluginEditorGrammarManager()
{
delete d;
}
PluginEditorGrammarManager::~PluginEditorGrammarManager() = default;
PluginEditorGrammarManager *PluginEditorGrammarManager::self()
{
......
......@@ -9,6 +9,7 @@
#include "messagecomposer_export.h"
#include <PimCommon/PluginUtil>
#include <QObject>
#include <memory>
namespace PimCommon
{
class CustomToolsPlugin;
......@@ -37,6 +38,6 @@ public:
Q_REQUIRED_RESULT PimCommon::CustomToolsPlugin *pluginFromIdentifier(const QString &id);
private:
PluginEditorGrammarManagerPrivate *const d;
std::unique_ptr<PluginEditorGrammarManagerPrivate> const d;
};
}
......@@ -25,10 +25,7 @@ PluginEditorInitInterface::PluginEditorInitInterface(QObject *parent)
{
}
PluginEditorInitInterface::~PluginEditorInitInterface()
{
delete d;
}
PluginEditorInitInterface::~PluginEditorInitInterface() = default;
void PluginEditorInitInterface::setParentWidget(QWidget *parent)
{
......
......@@ -8,7 +8,7 @@
#include "messagecomposer_export.h"
#include <QObject>
#include <memory>
namespace KPIMTextEdit
{
class RichTextComposer;
......@@ -40,7 +40,7 @@ public Q_SLOTS:
virtual void reloadConfig();
private:
PluginEditorInitInterfacePrivate *const d;
std::unique_ptr<PluginEditorInitInterfacePrivate> const d;
};
}
......@@ -34,10 +34,7 @@ Recipient::Recipient(const QString &email, Recipient::Type type)
{
}
Recipient::~Recipient()
{
delete d;
}
Recipient::~Recipient() = default;
void Recipient::setType(Type type)
{
......
......@@ -60,7 +60,7 @@ public:
Q_REQUIRED_RESULT GpgME::Key key() const;
private:
RecipientPrivate *const d;
std::unique_ptr<RecipientPrivate> const d;
};
}
......@@ -95,10 +95,7 @@ RecipientsEditor::RecipientsEditor(RecipientLineFactory *lineFactory, QWidget *p
addData(); // one default line
}
RecipientsEditor::~RecipientsEditor()
{
delete d;
}
RecipientsEditor::~RecipientsEditor() = default;
bool RecipientsEditor::addRecipient(const QString &recipient, Recipient::Type type)
{
......
......@@ -95,7 +95,7 @@ Q_SIGNALS:
void focusInRecipientLineEdit();
private:
RecipientsEditorPrivate *const d;
std::unique_ptr<RecipientsEditorPrivate> const d;
};
}
......@@ -77,10 +77,7 @@ AkonadiSender::AkonadiSender(QObject *parent)
{
}
AkonadiSender::~AkonadiSender()
{
delete d;
}
AkonadiSender::~AkonadiSender() = default;
bool AkonadiSender::doSend(const KMime::Message::Ptr &aMsg, short sendNow)
{
......
......@@ -59,6 +59,6 @@ private Q_SLOTS:
void queueJobResult(KJob *job);
private:
AkonadiSenderPrivate *const d;
std::unique_ptr<AkonadiSenderPrivate> const d;
};
}
......@@ -22,10 +22,7 @@ AttachmentLoadJob::AttachmentLoadJob(QObject *parent)
{
}
AttachmentLoadJob::~AttachmentLoadJob()
{
delete d;
}
AttachmentLoadJob::~AttachmentLoadJob() = default;
void AttachmentLoadJob::start()
{
......
......@@ -58,7 +58,7 @@ protected Q_SLOTS:
private:
//@cond PRIVATE
class Private;
Private *const d;
std::unique_ptr<Private> const d;
//@endcond
};
}
......
......@@ -123,10 +123,7 @@ MessageList::StorageModel::StorageModel(QAbstractItemModel *model, QItemSelectio
});
}
MessageList::StorageModel::~StorageModel()
{
delete d;
}
MessageList::StorageModel::~StorageModel() = default;
Collection::List MessageList::StorageModel::displayedCollections() const
{
......
......@@ -75,7 +75,7 @@ public:
private:
class Private;
Private *const d;
std::unique_ptr<Private> const d;
};
} // namespace MessageList
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