r21430 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Sat Aug 20 12:18:31 UTC 2016
Author: jghali
Date: Sat Aug 20 12:18:31 2016
New Revision: 21430
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21430
Log:
fix a few gcc 6 warnings related to auto_ptr deprecation in c++11 by replacing it with QScopedPointer
Modified:
trunk/Scribus/scribus/sclistboxpixmap.h
trunk/Scribus/scribus/ui/colorlistbox.cpp
trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
Modified: trunk/Scribus/scribus/sclistboxpixmap.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21430&path=/trunk/Scribus/scribus/sclistboxpixmap.h
==============================================================================
--- trunk/Scribus/scribus/sclistboxpixmap.h (original)
+++ trunk/Scribus/scribus/sclistboxpixmap.h Sat Aug 20 12:18:31 2016
@@ -13,6 +13,7 @@
#include <QDebug>
#include <QPainter>
#include <QPixmap>
+#include <QScopedPointer>
#include <QVariant>
#include "scguardedptr.h"
@@ -30,19 +31,19 @@
virtual QSize sizeHint (const QStyleOptionViewItem & option, const QModelIndex & index ) const;
virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
protected:
- static std::auto_ptr<QPixmap> pmap;
+ static QScopedPointer<QPixmap> pmap;
// The drawPixmap function must not modify pixmap size
virtual void redraw(const QVariant&) const = 0;
};
template<unsigned int pixWidth, unsigned int pixHeight>
-std::auto_ptr<QPixmap> ScListBoxPixmap<pixWidth, pixHeight>::pmap;
+QScopedPointer<QPixmap> ScListBoxPixmap<pixWidth, pixHeight>::pmap;
template<unsigned int pixWidth, unsigned int pixHeight>
ScListBoxPixmap<pixWidth, pixHeight>::ScListBoxPixmap(void) : QAbstractItemDelegate()
{
- if (!pmap.get())
+ if (pmap.isNull())
{
pmap.reset( new QPixmap(pixWidth, pixHeight) );
}
Modified: trunk/Scribus/scribus/ui/colorlistbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21430&path=/trunk/Scribus/scribus/ui/colorlistbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorlistbox.cpp (original)
+++ trunk/Scribus/scribus/ui/colorlistbox.cpp Sat Aug 20 12:18:31 2016
@@ -83,7 +83,7 @@
void ColorSmallItemDelegate::redraw(const QVariant& data) const
{
- QPixmap* pPixmap = ScListBoxPixmap<15,15>::pmap.get();
+ QPixmap* pPixmap = ScListBoxPixmap<15,15>::pmap.data();
pPixmap->fill(Qt::transparent);
if (data.canConvert<ColorPixmapValue>())
{
@@ -101,7 +101,7 @@
void ColorWideItemDelegate::redraw(const QVariant& data) const
{
- QPixmap* pPixmap = ScListBoxPixmap<30,15>::pmap.get();
+ QPixmap* pPixmap = ScListBoxPixmap<30,15>::pmap.data();
pPixmap->fill(Qt::transparent);
if (data.canConvert<ColorPixmapValue>())
{
@@ -134,7 +134,7 @@
iconsInitialized = true;
}
- QPixmap* pPixmap = ScListBoxPixmap<60,15>::pmap.get();
+ QPixmap* pPixmap = ScListBoxPixmap<60,15>::pmap.data();
pPixmap->fill(Qt::transparent);
if (data.canConvert<ColorPixmapValue>())
Modified: trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21430&path=/trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_utils.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_utils.cpp Sat Aug 20 12:18:31 2016
@@ -66,7 +66,7 @@
QColor tmpf;
pmap->fill(Qt::white);
QPainter p;
- p.begin(pmap.get());
+ p.begin(pmap.data());
for (int its = item.m_Line.size()-1; its > -1; its--)
{
const ScColor& col = item.m_doc->PageColors[item.m_Line[its].Color];
More information about the scribus-commit
mailing list