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

Use std::unique_ptr

parent 30235d23
Pipeline #86878 passed with stage
in 10 minutes and 3 seconds
......@@ -38,7 +38,6 @@ public:
~AutoCorrectionWidgetPrivate()
{
delete ui;
}
AutoCorrection::TypographicQuotes m_singleQuotes;
......@@ -46,7 +45,7 @@ public:
QSet<QString> m_upperCaseExceptions;
QSet<QString> m_twoUpperLetterExceptions;
QHash<QString, QString> m_autocorrectEntries;
Ui::AutoCorrectionWidget *const ui;
std::unique_ptr<Ui::AutoCorrectionWidget> const ui;
AutoCorrection *mAutoCorrection = nullptr;
bool mWasChanged = false;
};
......@@ -128,10 +127,7 @@ AutoCorrectionWidget::AutoCorrectionWidget(QWidget *parent)
connect(d->ui->exportAutoCorrection, &QPushButton::clicked, this, &AutoCorrectionWidget::slotExportAutoCorrection);
}
AutoCorrectionWidget::~AutoCorrectionWidget()
{
delete d;
}
AutoCorrectionWidget::~AutoCorrectionWidget() = default;
void AutoCorrectionWidget::setAutoCorrection(AutoCorrection *autoCorrect)
{
......
......@@ -84,7 +84,7 @@ private:
void loadGlobalAutoCorrectionAndException();
void setLanguage(const QString &lang);
AutoCorrectionWidgetPrivate *const d;
std::unique_ptr<AutoCorrectionWidgetPrivate> const d;
};
}
......@@ -20,10 +20,7 @@ CustomToolsPlugin::CustomToolsPlugin(QObject *parent)
{
}
CustomToolsPlugin::~CustomToolsPlugin()
{
delete d;
}
CustomToolsPlugin::~CustomToolsPlugin() = default;
bool CustomToolsPlugin::hasConfigureDialog() const
{
......
......@@ -8,6 +8,7 @@
#include "pimcommon_export.h"
#include <QObject>
#include <memory>
class KActionCollection;
namespace PimCommon
{
......@@ -39,6 +40,6 @@ public:
Q_REQUIRED_RESULT bool isEnabled() const;
private:
CustomToolsPluginPrivate *const d;
std::unique_ptr<CustomToolsPluginPrivate> const d;
};
}
......@@ -113,10 +113,7 @@ CustomToolsPluginManager::CustomToolsPluginManager(QObject *parent)
d->initializePluginList();
}
CustomToolsPluginManager::~CustomToolsPluginManager()
{
delete d;
}
CustomToolsPluginManager::~CustomToolsPluginManager() = default;
QVector<PimCommon::CustomToolsPlugin *> CustomToolsPluginManager::pluginsList() const
{
......
......@@ -8,6 +8,7 @@
#include "pimcommon_export.h"
#include <QObject>
#include <memory>
namespace PimCommon
{
class CustomToolsPlugin;
......@@ -28,6 +29,6 @@ public:
Q_REQUIRED_RESULT QVector<PimCommon::CustomToolsPlugin *> pluginsList() const;
private:
CustomToolsPluginManagerPrivate *const d;
std::unique_ptr<CustomToolsPluginManagerPrivate> const d;
};
}
......@@ -38,10 +38,7 @@ CustomToolsWidgetNg::CustomToolsWidgetNg(QWidget *parent)
hide();
}
CustomToolsWidgetNg::~CustomToolsWidgetNg()
{
delete d;
}
CustomToolsWidgetNg::~CustomToolsWidgetNg() = default;
void CustomToolsWidgetNg::addCustomToolViewInterface(PimCommon::CustomToolsViewInterface *plugin)
{
......
......@@ -42,6 +42,6 @@ Q_SIGNALS:
void toolActivated();
private:
CustomToolsWidgetNgPrivate *const d;
std::unique_ptr<CustomToolsWidgetNgPrivate> const d;
};
}
......@@ -25,10 +25,7 @@ AbstractGenericPluginInterface::AbstractGenericPluginInterface(QObject *parent)
{
}
AbstractGenericPluginInterface::~AbstractGenericPluginInterface()
{
delete d;
}
AbstractGenericPluginInterface::~AbstractGenericPluginInterface() = default;
void AbstractGenericPluginInterface::setParentWidget(QWidget *parent)
{
......
......@@ -7,6 +7,7 @@
#pragma once
#include "pimcommon_export.h"
#include <QObject>
#include <memory>
class QAction;
class KActionCollection;
namespace PimCommon
......@@ -58,6 +59,6 @@ Q_SIGNALS:
void message(const QString &str);
private:
AbstractGenericPluginInterfacePrivate *const d;
std::unique_ptr<AbstractGenericPluginInterfacePrivate> const d;
};
}
......@@ -158,10 +158,7 @@ GenericPluginManager::GenericPluginManager(QObject *parent)
{
}
GenericPluginManager::~GenericPluginManager()
{
delete d;
}
GenericPluginManager::~GenericPluginManager() = default;
bool GenericPluginManager::initializePlugins()
{
......
......@@ -56,7 +56,7 @@ public:
Q_REQUIRED_RESULT GenericPlugin *pluginFromIdentifier(const QString &id);
private:
GenericPluginManagerPrivate *const d;
std::unique_ptr<GenericPluginManagerPrivate> const d;
};
}
......@@ -37,10 +37,7 @@ LogActivitiesManager::LogActivitiesManager(QObject *parent)
{
}
LogActivitiesManager::~LogActivitiesManager()
{
delete d;
}
LogActivitiesManager::~LogActivitiesManager() = default;
LogActivitiesManager *LogActivitiesManager::self()
{
......
......@@ -8,6 +8,7 @@
#include "pimcommon_export.h"
#include <QObject>
#include <memory>
namespace PimCommon
{
class LogActivitiesManagerPrivate;
......@@ -40,6 +41,6 @@ Q_SIGNALS:
void logEntryCleared();
private:
LogActivitiesManagerPrivate *const d;
std::unique_ptr<LogActivitiesManagerPrivate> const d;
};
}
......@@ -33,10 +33,7 @@ MigrateApplicationFiles::MigrateApplicationFiles(QObject *parent)
{
}
MigrateApplicationFiles::~MigrateApplicationFiles()
{
delete d;
}
MigrateApplicationFiles::~MigrateApplicationFiles() = default;
void MigrateApplicationFiles::finished()
{
......
......@@ -9,6 +9,7 @@
#include "migratefileinfo.h"
#include "pimcommon_export.h"
#include <QObject>
#include <memory>
namespace PimCommon
{
class MigrateApplicationFilesPrivate;
......@@ -49,6 +50,6 @@ private:
void migrateFolder(const MigrateFileInfo &info);
void migrateFile(const MigrateFileInfo &info);
bool migrateConfig();
MigrateApplicationFilesPrivate *const d;
std::unique_ptr<MigrateApplicationFilesPrivate> const d;
};
}
......@@ -299,10 +299,7 @@ TemplateListWidget::TemplateListWidget(const QString &configName, QWidget *paren
});
}
TemplateListWidget::~TemplateListWidget()
{
delete d;
}
TemplateListWidget::~TemplateListWidget() = default;
void TemplateListWidget::loadTemplates()
{
......
......@@ -56,7 +56,7 @@ Q_SIGNALS:
private:
friend class TemplateListWidgetPrivate;
TemplateListWidgetPrivate *const d;
std::unique_ptr<TemplateListWidgetPrivate> const d;
};
}
Q_DECLARE_TYPEINFO(PimCommon::defaultTemplate, Q_MOVABLE_TYPE);
......@@ -38,10 +38,7 @@ TemplateManager::TemplateManager(const QString &relativeTemplateDir, PimCommon::
loadTemplates(true);
}
TemplateManager::~TemplateManager()
{
delete d;
}
TemplateManager::~TemplateManager() = default;
void TemplateManager::slotDirectoryChanged()
{
......
......@@ -8,6 +8,7 @@
#include "pimcommon_export.h"
#include <QObject>
#include <memory>
namespace PimCommon
{
......@@ -40,7 +41,7 @@ private:
void initTemplatesDirectories(const QString &templatesRelativePath);
TemplateInfo loadTemplate(const QString &themePath, const QString &defaultDesktopFileName);
TemplateManagerPrivate *const d;
std::unique_ptr<TemplateManagerPrivate> 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