Commit a7b40ce1 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

modernize: use nullptr

Summary:
The old null pointer constants(NULL, 0, etc) are converted to the
the new C++11 nullptr keyword with clang-tidy.

Reviewers: #breeze, mart

Reviewed By: mart

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D11635
parent 98cfe1d1
......@@ -105,7 +105,7 @@ namespace Breeze
if( className.isEmpty() )
{
// retrieve class name
KWindowInfo info( client->windowId(), 0, NET::WM2WindowClass );
KWindowInfo info( client->windowId(), nullptr, NET::WM2WindowClass );
QString window_className( QString::fromUtf8(info.windowClassName()) );
QString window_class( QString::fromUtf8(info.windowClassClass()) );
className = window_className + QStringLiteral(" ") + window_class;
......
......@@ -227,7 +227,7 @@ namespace Breeze
*/
QPoint rootPosition( position );
xcb_get_geometry_cookie_t cookie( xcb_get_geometry( connection, winId() ) );
ScopedPointer<xcb_get_geometry_reply_t> reply( xcb_get_geometry_reply( connection, cookie, 0x0 ) );
ScopedPointer<xcb_get_geometry_reply_t> reply( xcb_get_geometry_reply( connection, cookie, nullptr ) );
if( reply )
{
......@@ -237,7 +237,7 @@ namespace Breeze
-reply.data()->border_width,
-reply.data()->border_width ) );
ScopedPointer< xcb_translate_coordinates_reply_t> coordReply( xcb_translate_coordinates_reply( connection, coordCookie, 0x0 ) );
ScopedPointer< xcb_translate_coordinates_reply_t> coordReply( xcb_translate_coordinates_reply( connection, coordCookie, nullptr ) );
if( coordReply )
{
......@@ -254,7 +254,7 @@ namespace Breeze
// create atom if not found
const QString atomName( "_NET_WM_MOVERESIZE" );
xcb_intern_atom_cookie_t cookie( xcb_intern_atom( connection, false, atomName.size(), qPrintable( atomName ) ) );
ScopedPointer<xcb_intern_atom_reply_t> reply( xcb_intern_atom_reply( connection, cookie, 0x0 ) );
ScopedPointer<xcb_intern_atom_reply_t> reply( xcb_intern_atom_reply( connection, cookie, nullptr ) );
m_moveResizeAtom = reply ? reply->atom:0;
}
......
......@@ -110,7 +110,7 @@ namespace Breeze
// use a dialog, so that all user input is blocked
// use WX11BypassWM and moving away so that it's not actually visible
// grab only mouse, so that keyboard can be used e.g. for switching windows
m_grabber = new QDialog( 0, Qt::X11BypassWindowManagerHint );
m_grabber = new QDialog( nullptr, Qt::X11BypassWindowManagerHint );
m_grabber->move( -1000, -1000 );
m_grabber->setModal( true );
m_grabber->show();
......@@ -134,7 +134,7 @@ namespace Breeze
// delete old m_grabber
delete m_grabber;
m_grabber = 0;
m_grabber = nullptr;
// check button
if( static_cast< QMouseEvent* >( e )->button() != Qt::LeftButton ) return true;
......
......@@ -177,7 +177,7 @@ namespace Breeze
}
delete m_detectDialog;
m_detectDialog = 0;
m_detectDialog = nullptr;
}
......
......@@ -41,7 +41,7 @@ namespace Breeze
public:
//* constructor
explicit ExceptionListWidget( QWidget* = 0 );
explicit ExceptionListWidget( QWidget* = nullptr );
//* set exceptions
void setExceptions( const InternalSettingsList& );
......
......@@ -38,7 +38,7 @@ namespace Breeze
public:
//* constructor
explicit ItemModel(QObject *parent = 0);
explicit ItemModel(QObject *parent = nullptr);
//* destructor
virtual ~ItemModel()
......
......@@ -58,7 +58,7 @@ namespace Breeze
// typedef QSet<ValueType> Set;
//! constructor
ListModel(QObject *parent = 0):
ListModel(QObject *parent = nullptr):
ItemModel( parent )
{}
......@@ -72,7 +72,7 @@ namespace Breeze
//! flags
Qt::ItemFlags flags(const QModelIndex &index) const override
{
if (!index.isValid()) return 0;
if (!index.isValid()) return nullptr;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
......
......@@ -212,7 +212,7 @@ namespace Breeze
if( widget->autoFillBackground() )
{ widgets.append( widget ); }
QWidget *parent(0);
QWidget *parent(nullptr);
// get highest level parent
for( parent = widget->parentWidget(); parent; parent = parent->parentWidget() )
......@@ -262,7 +262,7 @@ namespace Breeze
for( int i = widgets.size() - 1; i>=0; i-- )
{
QWidget* w = widgets.at(i);
w->render( &p, -widget->mapTo( w, rect.topLeft() ), rect, 0 );
w->render( &p, -widget->mapTo( w, rect.topLeft() ), rect, nullptr );
}
// end
......
......@@ -150,7 +150,7 @@ namespace Breeze
//@}
//* grap pixmap
QPixmap grab( QWidget* = 0, QRect = QRect() );
QPixmap grab( QWidget* = nullptr, QRect = QRect() );
//* true if animated
virtual bool isAnimated() const
......
......@@ -140,7 +140,7 @@ namespace Breeze
if( FrameShadow* shadow = qobject_cast<FrameShadow*>(child) )
{
shadow->hide();
shadow->setParent(0);
shadow->setParent(nullptr);
shadow->deleteLater();
}
}
......@@ -202,7 +202,7 @@ namespace Breeze
//____________________________________________________________________________________
void FrameShadowFactory::installShadow( QWidget* widget, Helper& helper, Side area ) const
{
FrameShadow *shadow(0);
FrameShadow *shadow(nullptr);
shadow = new FrameShadow( area, helper );
shadow->setParent(widget);
shadow->hide();
......
......@@ -48,7 +48,7 @@ namespace Breeze
//____________________________________________________________________
#if BREEZE_USE_KDE4
Helper::Helper( const QByteArray& name ):
_componentData( name, 0, KComponentData::SkipMainComponentRegistration ),
_componentData( name, nullptr, KComponentData::SkipMainComponentRegistration ),
_config( _componentData.config() )
{ init(); }
#endif
......
......@@ -409,7 +409,7 @@ namespace Breeze
if( !_gc )
{
_gc = xcb_generate_id( Helper::connection() );
xcb_create_gc( Helper::connection(), _gc, pixmap, 0, 0x0 );
xcb_create_gc( Helper::connection(), _gc, pixmap, 0, nullptr );
}
// create image from QPixmap and assign to pixmap
......
......@@ -1088,7 +1088,7 @@ namespace Breeze
QMouseEvent* mouseEvent( static_cast<QMouseEvent*>( event ) );
// get frame framewidth
const int frameWidth( pixelMetric( PM_DefaultFrameWidth, 0, widget ) );
const int frameWidth( pixelMetric( PM_DefaultFrameWidth, nullptr, widget ) );
// find list of scrollbars
QList<QScrollBar*> scrollBars;
......@@ -3609,7 +3609,7 @@ namespace Breeze
{
// need to adjust clipRect in order not to render outside of frame
const int frameWidth( pixelMetric( PM_DefaultFrameWidth, 0, scrollArea ) );
const int frameWidth( pixelMetric( PM_DefaultFrameWidth, nullptr, scrollArea ) );
painter->setClipRect( insideMargin( scrollArea->rect(), frameWidth ) );
painter->setBrush( scrollArea->viewport()->palette().color( scrollArea->viewport()->backgroundRole() ) );
painter->setPen( Qt::NoPen );
......@@ -4701,7 +4701,7 @@ namespace Breeze
const auto color = _helper->focusColor( palette );
const auto outlineColor = _helper->focusOutlineColor( palette );
Sides sides = 0;
Sides sides = nullptr;
if( !menuItemOption->menuRect.isNull() )
{
if( rect.top() <= menuItemOption->menuRect.top() ) sides |= SideTop;
......
......@@ -37,7 +37,7 @@ namespace Breeze
public:
//* constructor
explicit StylePlugin(QObject *parent = 0):
explicit StylePlugin(QObject *parent = nullptr):
QStylePlugin(parent)
{}
......
......@@ -97,7 +97,7 @@ namespace Breeze
Kdelibs4Migration migration;
const QString kde4ConfigDirPath = migration.saveLocation("config");
QScopedPointer<KConfig> kde4Config(StyleConfigData::self()->config()->copyTo(kde4ConfigDirPath+"/breezerc", 0));
QScopedPointer<KConfig> kde4Config(StyleConfigData::self()->config()->copyTo(kde4ConfigDirPath+"/breezerc", nullptr));
kde4Config->sync();
#endif
......
Supports Markdown
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