Commit 93380119 authored by Carlos Alves's avatar Carlos Alves
Browse files

Pointer to smart pointer in ColorSchemeWallpaper

Using std::unique_ptr
parent 3bfe6125
......@@ -25,7 +25,6 @@ ColorSchemeWallpaper::ColorSchemeWallpaper(const QString &path) :
ColorSchemeWallpaper::~ColorSchemeWallpaper()
{
delete _picture;
}
void ColorSchemeWallpaper::load()
......@@ -36,7 +35,7 @@ void ColorSchemeWallpaper::load()
// Create and load original pixmap
if (_picture == nullptr) {
_picture = new QPixmap();
_picture = std::make_unique<QPixmap>();
}
if (_picture->isNull()) {
......
......@@ -8,6 +8,8 @@
#ifndef COLORSCHEMEWALLPAPER_H
#define COLORSCHEMEWALLPAPER_H
// STD
#include <memory>
// Qt
#include <QMetaType>
......@@ -46,7 +48,7 @@ namespace Konsole
Q_DISABLE_COPY(ColorSchemeWallpaper)
QString _path;
QPixmap *_picture;
std::unique_ptr<QPixmap> _picture;
};
}
......
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