Commit fbbada84 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use std::unique_ptr

parent 51825bde
Pipeline #87488 passed with stage
in 3 minutes and 41 seconds
......@@ -51,10 +51,7 @@ KTNEFAttach::KTNEFAttach()
d->index_ = -1;
}
KTNEFAttach::~KTNEFAttach()
{
delete d;
}
KTNEFAttach::~KTNEFAttach() = default;
void KTNEFAttach::setTitleParsed()
{
......
......@@ -21,6 +21,7 @@
#include "ktnef_export.h"
#include "ktnefpropertyset.h"
#include <memory>
namespace KTnef
{
......@@ -211,7 +212,7 @@ public:
private:
//@cond PRIVATE
class AttachPrivate;
AttachPrivate *const d;
std::unique_ptr<AttachPrivate> const d;
//@endcond
Q_DISABLE_COPY(KTNEFAttach)
......
......@@ -60,10 +60,7 @@ KTNEFMessage::KTNEFMessage()
{
}
KTNEFMessage::~KTNEFMessage()
{
delete d;
}
KTNEFMessage::~KTNEFMessage() = default;
const QList<KTNEFAttach *> &KTNEFMessage::attachmentList() const
{
......
......@@ -21,7 +21,7 @@
#include "ktnef_export.h"
#include "ktnefpropertyset.h"
#include <memory>
namespace KTnef
{
class KTNEFAttach;
......@@ -81,7 +81,7 @@ public:
private:
//@cond PRIVATE
class MessagePrivate;
MessagePrivate *const d;
std::unique_ptr<MessagePrivate> const d;
//@endcond
Q_DISABLE_COPY(KTNEFMessage)
......
......@@ -107,7 +107,6 @@ KTNEFParser::KTNEFParser()
KTNEFParser::~KTNEFParser()
{
d->deleteDevice();
delete d;
}
KTNEFMessage *KTNEFParser::message() const
......
......@@ -20,6 +20,7 @@
#include "ktnef_export.h"
#include <QIODevice>
#include <QString>
#include <memory>
namespace KTnef
{
......@@ -106,7 +107,7 @@ public:
private:
//@cond PRIVATE
class ParserPrivate;
ParserPrivate *const d;
std::unique_ptr<ParserPrivate> const d;
//@endcond
Q_DISABLE_COPY(KTNEFParser)
......
......@@ -51,10 +51,7 @@ KTNEFProperty::KTNEFProperty(const KTNEFProperty &p)
*d = *p.d;
}
KTNEFProperty::~KTNEFProperty()
{
delete d;
}
KTNEFProperty::~KTNEFProperty() = default;
KTNEFProperty &KTNEFProperty::operator=(const KTNEFProperty &other)
{
......
......@@ -17,11 +17,11 @@
#pragma once
#include "ktnef_export.h"
#include <QString>
#include <QVariant>
#include <memory>
class KTNEFPropertyPrivate;
#include "ktnef_export.h"
namespace KTnef
{
/**
......@@ -137,7 +137,7 @@ public:
private:
//@cond PRIVATE
KTNEFPropertyPrivate *const d;
std::unique_ptr<KTNEFPropertyPrivate> const d;
//@endcond
};
......
......@@ -39,8 +39,6 @@ KTNEFPropertySet::KTNEFPropertySet()
KTNEFPropertySet::~KTNEFPropertySet()
{
clear(true);
delete d;
}
void KTNEFPropertySet::addProperty(int key, int type, const QVariant &value, const QVariant &name, bool overwrite)
......
......@@ -17,11 +17,11 @@
#pragma once
#include "ktnef_export.h"
#include <QMap>
#include <QVariant>
#include <memory>
class KTNEFPropertySetPrivate;
#include "ktnef_export.h"
namespace KTnef
{
class KTNEFProperty;
......@@ -140,7 +140,7 @@ public:
private:
//@cond PRIVATE
KTNEFPropertySetPrivate *const d;
std::unique_ptr<KTNEFPropertySetPrivate> const d;
//@endcond
Q_DISABLE_COPY(KTNEFPropertySet)
......
......@@ -67,10 +67,7 @@ KTNEFWriter::KTNEFWriter()
addProperty(attOEMCODEPAGE, atpBYTE, list);
}
KTNEFWriter::~KTNEFWriter()
{
delete d;
}
KTNEFWriter::~KTNEFWriter() = default;
void KTNEFWriter::addProperty(int tag, int type, const QVariant &value)
{
......
......@@ -16,16 +16,17 @@
*/
#pragma once
#include <QStringList>
#include "ktnef_export.h"
#include <memory>
#include <qglobal.h>
class QString;
class QVariant;
class QIODevice;
class QDataStream;
class QDateTime;
#include <QStringList>
#include "ktnef_export.h"
#include <qglobal.h>
namespace KTnef
{
......@@ -273,7 +274,7 @@ public:
private:
//@cond PRIVATE
KTNEFWriterPrivateData *const d;
std::unique_ptr<KTNEFWriterPrivateData> const d;
//@endcond
Q_DISABLE_COPY(KTNEFWriter)
......
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