Commit 227fdb31 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use std::uniqueprt

parent b65da108
Pipeline #87193 passed with stage
in 10 minutes and 6 seconds
......@@ -35,10 +35,7 @@ LineEditWithAutoCorrection::LineEditWithAutoCorrection(QWidget *parent, const QS
{
}
LineEditWithAutoCorrection::~LineEditWithAutoCorrection()
{
delete d;
}
LineEditWithAutoCorrection::~LineEditWithAutoCorrection() = default;
AutoCorrection *LineEditWithAutoCorrection::autocorrection() const
{
......
......@@ -34,7 +34,7 @@ protected:
void keyPressEvent(QKeyEvent *e) override;
private:
LineEditWithAutoCorrectionPrivate *const d;
std::unique_ptr<LineEditWithAutoCorrectionPrivate> const d;
};
}
......@@ -36,10 +36,7 @@ RichTextEditWithAutoCorrection::RichTextEditWithAutoCorrection(QWidget *parent)
{
}
RichTextEditWithAutoCorrection::~RichTextEditWithAutoCorrection()
{
delete d;
}
RichTextEditWithAutoCorrection::~RichTextEditWithAutoCorrection() = default;
void RichTextEditWithAutoCorrection::setAutocorrection(PimCommon::AutoCorrection *autocorrect)
{
......
......@@ -34,7 +34,7 @@ protected:
void keyPressEvent(QKeyEvent *e) override;
private:
RichTextEditWithAutoCorrectionPrivate *const d;
std::unique_ptr<RichTextEditWithAutoCorrectionPrivate> const d;
};
}
......@@ -114,10 +114,7 @@ ShareServiceUrlManager::ShareServiceUrlManager(QObject *parent)
d->initializeMenu();
}
ShareServiceUrlManager::~ShareServiceUrlManager()
{
delete d;
}
ShareServiceUrlManager::~ShareServiceUrlManager() = default;
KActionMenu *ShareServiceUrlManager::menu() const
{
......
......@@ -9,6 +9,7 @@
#include "pimcommon_export.h"
#include <QObject>
#include <QUrl>
#include <memory>
class KActionMenu;
class QAction;
......@@ -40,7 +41,7 @@ Q_SIGNALS:
void serviceUrlSelected(PimCommon::ShareServiceUrlManager::ServiceType type);
private:
ShareServiceUrlManagerPrivate *const d;
std::unique_ptr<ShareServiceUrlManagerPrivate> const d;
};
}
Q_DECLARE_METATYPE(PimCommon::ShareServiceUrlManager::ServiceType)
......@@ -25,10 +25,10 @@
using namespace PimCommon;
class AclEntryDialog::Private
class AclEntryDialog::AclEntryDialogPrivate
{
public:
Private(AclEntryDialog *qq)
AclEntryDialogPrivate(AclEntryDialog *qq)
: q(qq)
{
}
......@@ -44,12 +44,12 @@ public:
QPushButton *mOkButton = nullptr;
};
void AclEntryDialog::Private::slotChanged()
void AclEntryDialog::AclEntryDialogPrivate::slotChanged()
{
mOkButton->setEnabled(!mUserIdLineEdit->text().trimmed().isEmpty() && mButtonGroup->checkedButton() != nullptr);
}
void AclEntryDialog::Private::slotSelectAddresses()
void AclEntryDialog::AclEntryDialogPrivate::slotSelectAddresses()
{
Akonadi::EmailAddressSelectionDialog dlg;
......@@ -64,7 +64,7 @@ void AclEntryDialog::Private::slotSelectAddresses()
AclEntryDialog::AclEntryDialog(QWidget *parent)
: QDialog(parent)
, d(new Private(this))
, d(new AclEntryDialogPrivate(this))
{
auto mainLayout = new QVBoxLayout(this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
......@@ -130,10 +130,7 @@ AclEntryDialog::AclEntryDialog(QWidget *parent)
d->mUserIdLineEdit->setFocus();
}
AclEntryDialog::~AclEntryDialog()
{
delete d;
}
AclEntryDialog::~AclEntryDialog() = default;
void AclEntryDialog::setUserId(const QString &userId)
{
......
......@@ -55,8 +55,8 @@ public:
private:
//@cond PRIVATE
class Private;
Private *const d;
class AclEntryDialogPrivate;
std::unique_ptr<AclEntryDialogPrivate> const d;
//@endcond
};
......
......@@ -146,10 +146,10 @@ private:
QVector<QPair<QByteArray, KIMAP::Acl::Rights>> mRights;
};
class Q_DECL_HIDDEN PimCommon::AclManager::Private
class Q_DECL_HIDDEN PimCommon::AclManager::AclManagerPrivate
{
public:
Private(AclManager *qq)
AclManagerPrivate(AclManager *qq)
: q(qq)
{
mAddAction = new QAction(i18n("Add Entry..."), q);
......@@ -177,7 +177,7 @@ public:
});
}
~Private()
~AclManagerPrivate()
{
}
......@@ -358,14 +358,11 @@ public:
AclManager::AclManager(QObject *parent)
: QObject(parent)
, d(new Private(this))
, d(new AclManagerPrivate(this))
{
}
AclManager::~AclManager()
{
delete d;
}
AclManager::~AclManager() = default;
void AclManager::setCollection(const Akonadi::Collection &collection)
{
......
......@@ -97,8 +97,8 @@ Q_SIGNALS:
private:
//@cond PRIVATE
class Private;
Private *const d;
class AclManagerPrivate;
std::unique_ptr<AclManagerPrivate> const d;
//@endcond
};
}
......
......@@ -35,10 +35,7 @@ CollectionAclPage::CollectionAclPage(QWidget *parent)
init();
}
CollectionAclPage::~CollectionAclPage()
{
delete d;
}
CollectionAclPage::~CollectionAclPage() = default;
void CollectionAclPage::init()
{
......
......@@ -34,7 +34,7 @@ protected:
void init();
private:
CollectionAclPagePrivate *const d;
std::unique_ptr<CollectionAclPagePrivate> const d;
};
AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionAclPageFactory, CollectionAclPage)
}
......
......@@ -41,10 +41,7 @@ ImapAclAttribute::ImapAclAttribute(const QMap<QByteArray, KIMAP::Acl::Rights> &r
d->mOldRights = oldRights;
}
ImapAclAttribute::~ImapAclAttribute()
{
delete d;
}
ImapAclAttribute::~ImapAclAttribute() = default;
void ImapAclAttribute::setRights(const QMap<QByteArray, KIMAP::Acl::Rights> &rights)
{
......
......@@ -20,6 +20,7 @@
#include <QMap>
#include <memory>
namespace PimCommon
{
class ImapAclAttributePrivate;
......@@ -45,7 +46,7 @@ public:
bool operator==(const ImapAclAttribute &other) const;
private:
ImapAclAttributePrivate *const d;
std::unique_ptr<ImapAclAttributePrivate> const d;
QMap<QByteArray, KIMAP::Acl::Rights> mRights;
QMap<QByteArray, KIMAP::Acl::Rights> mOldRights;
KIMAP::Acl::Rights mMyRights;
......
......@@ -74,7 +74,6 @@ CompletionConfigureDialog::CompletionConfigureDialog(QWidget *parent)
CompletionConfigureDialog::~CompletionConfigureDialog()
{
writeConfig();
delete d;
}
void CompletionConfigureDialog::readConfig()
......
......@@ -40,7 +40,7 @@ private:
void slotSave();
void readConfig();
void writeConfig();
CompletionConfigureDialogPrivate *const d;
std::unique_ptr<CompletionConfigureDialogPrivate> const d;
};
}
......@@ -65,7 +65,6 @@ CompletionOrderEditor::CompletionOrderEditor(KLDAP::LdapClientSearch *ldapSearch
CompletionOrderEditor::~CompletionOrderEditor()
{
writeConfig();
delete d;
}
void CompletionOrderEditor::readConfig()
......
......@@ -36,7 +36,7 @@ private Q_SLOTS:
private:
void readConfig();
void writeConfig();
CompletionOrderEditorPrivate *const d;
std::unique_ptr<CompletionOrderEditorPrivate> const d;
};
} // namespace
......@@ -110,10 +110,7 @@ AddressessLineEditPluginManager::AddressessLineEditPluginManager(QObject *parent
{
}
AddressessLineEditPluginManager::~AddressessLineEditPluginManager()
{
delete d;
}
AddressessLineEditPluginManager::~AddressessLineEditPluginManager() = default;
AddressessLineEditPluginManager *AddressessLineEditPluginManager::self()
{
......
......@@ -8,6 +8,7 @@
#include "pimcommonakonadi_export.h"
#include <QObject>
#include <memory>
namespace PimCommon
{
......@@ -30,7 +31,7 @@ public:
QVector<PimCommon::AddressessLineEditAbstractPlugin *> pluginsList() const;
private:
AddressessLineEditPluginManagerPrivate *const d;
std::unique_ptr<AddressessLineEditPluginManagerPrivate> const d;
};
}
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