Commit f35ca0d4 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Consistently use std::unique_ptr to life-manage the PIMPL d object

GIT_SILENT
parent fc5d3a6c
......@@ -67,10 +67,7 @@ KMahjonggBackground::KMahjonggBackground()
_inited = true;
}
KMahjonggBackground::~KMahjonggBackground()
{
delete d;
}
KMahjonggBackground::~KMahjonggBackground() = default;
bool KMahjonggBackground::loadDefault()
{
......
......@@ -10,6 +10,8 @@
// Qt
#include <QBrush>
// Std
#include <memory>
// LibKMahjongg
#include "libkmahjongg_export.h"
......@@ -36,8 +38,7 @@ class LIBKMAHJONGG_EXPORT KMahjonggBackground
QString authorProperty(const QString &key) const;
private:
friend class KMahjonggBackgroundPrivate;
KMahjonggBackgroundPrivate *const d;
std::unique_ptr<KMahjonggBackgroundPrivate> const d;
Q_DISABLE_COPY(KMahjonggBackground)
};
......
......@@ -34,10 +34,7 @@ KMahjonggConfigDialog::KMahjonggConfigDialog(QWidget * parent, const QString & n
d->m_config = config;
}
KMahjonggConfigDialog::~KMahjonggConfigDialog()
{
delete d;
}
KMahjonggConfigDialog::~KMahjonggConfigDialog() = default;
void KMahjonggConfigDialog::addTilesetPage()
{
......
......@@ -36,7 +36,7 @@ Q_OBJECT
private:
friend class KMahjonggConfigDialogPrivate;
KMahjonggConfigDialogPrivate *const d;
std::unique_ptr<KMahjonggConfigDialogPrivate> const d;
Q_DISABLE_COPY(KMahjonggConfigDialog)
};
......
......@@ -86,10 +86,7 @@ KMahjonggTileset::KMahjonggTileset()
// ---------------------------------------------------------
KMahjonggTileset::~KMahjonggTileset()
{
delete d;
}
KMahjonggTileset::~KMahjonggTileset() = default;
void KMahjonggTileset::updateScaleInfo(short tilew, short tileh)
{
......
......@@ -55,7 +55,7 @@ protected:
private:
friend class KMahjonggTilesetPrivate;
KMahjonggTilesetPrivate *const d;
std::unique_ptr<KMahjonggTilesetPrivate> const d;
Q_DISABLE_COPY(KMahjonggTileset)
};
......
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