Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
93380119
Commit
93380119
authored
Mar 05, 2021
by
Carlos Alves
Browse files
Pointer to smart pointer in ColorSchemeWallpaper
Using std::unique_ptr
parent
3bfe6125
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/colorscheme/ColorSchemeWallpaper.cpp
View file @
93380119
...
...
@@ -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
())
{
...
...
src/colorscheme/ColorSchemeWallpaper.h
View file @
93380119
...
...
@@ -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
;
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment