[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [wacomtablet] src: Replace most NULLs with nullptr
From:       Valeriy Malov <null () kde ! org>
Date:       2018-04-30 16:38:40
Message-ID: E1fDBp2-0003VO-23 () code ! kde ! org
[Download RAW message or body]

Git commit 4805e17fd4a5b0810ebeb8ebcdde9cd3b37e8ecb by Valeriy Malov.
Committed on 30/04/2018 at 16:38.
Pushed by valeriymalov into branch 'master'.

Replace most NULLs with nullptr

Use QPalette::WindowText color for crosshairs in calibration dialog to
make them visible in dark themes

M  +2    -2    src/common/buttonshortcut.cpp
M  +2    -2    src/common/configadaptor.h
M  +4    -4    src/common/deviceprofile.cpp
M  +2    -2    src/common/enum.h
M  +6    -7    src/common/propertyadaptor.cpp
M  +2    -2    src/common/propertyset.h
M  +2    -2    src/common/tabletinformation.cpp
M  +1    -1    src/common/tabletprofile.cpp
M  +1    -1    src/kcmodule/calibrationdialog.cpp
M  +2    -2    src/kcmodule/tabletareaselectioncontroller.cpp
M  +3    -3    src/kcmodule/tabletpagewidget.cpp
M  +6    -6    src/kded/dbustabletservice.cpp
M  +3    -3    src/kded/procsystemadaptor.cpp
M  +1    -1    src/kded/tabletdaemon.cpp
M  +5    -5    src/kded/tablethandler.cpp
M  +3    -3    src/kded/x11tabletfinder.cpp
M  +6    -6    src/kded/xinputadaptor.cpp
M  +8    -8    src/kded/xsetwacomadaptor.cpp

https://commits.kde.org/wacomtablet/4805e17fd4a5b0810ebeb8ebcdde9cd3b37e8ecb


diff --git a/src/common/buttonshortcut.cpp b/src/common/buttonshortcut.cpp
index 3ad03fe..114b01d 100644
--- a/src/common/buttonshortcut.cpp
+++ b/src/common/buttonshortcut.cpp
@@ -85,7 +85,7 @@ const char* ButtonShortcut::CONVERT_KEY_MAP_DATA[][2] = {
     {"super_r",      "meta"},
     {"super",        "meta"}, // "super" default
     {"underscore",   "_"},
-    {NULL, NULL}
+    {nullptr, nullptr}
 };
 
 namespace Wacom {
@@ -441,7 +441,7 @@ QMap< QString, QString > \
ButtonShortcut::initConversionMap(bool fromStorageMap)  QMap<QString, \
QString> map;  
     for (int i = 0 ; ; ++i) {
-        if (CONVERT_KEY_MAP_DATA[i][0] == NULL || \
CONVERT_KEY_MAP_DATA[i][1] == NULL) { +        if \
(CONVERT_KEY_MAP_DATA[i][0] == nullptr || CONVERT_KEY_MAP_DATA[i][1] == \
nullptr) {  return map;
         }
 
diff --git a/src/common/configadaptor.h b/src/common/configadaptor.h
index f7209ac..502b658 100644
--- a/src/common/configadaptor.h
+++ b/src/common/configadaptor.h
@@ -43,12 +43,12 @@ public:
       *
       * @param adaptee The property adapter where all properties are read \
                from (possibly NULL).
       */
-    explicit ConfigAdaptor(PropertyAdaptor* adaptee) : \
PropertyAdaptor(adaptee) {}; +    explicit ConfigAdaptor(PropertyAdaptor* \
adaptee) : PropertyAdaptor(adaptee) {}  
     /**
       * Default destructor
       */
-    virtual ~ConfigAdaptor() {};
+    virtual ~ConfigAdaptor() {}
 
     /**
      * Loads a config from the given config group. The default \
                implementation
diff --git a/src/common/deviceprofile.cpp b/src/common/deviceprofile.cpp
index 5603cd2..c98eef3 100644
--- a/src/common/deviceprofile.cpp
+++ b/src/common/deviceprofile.cpp
@@ -44,16 +44,16 @@ public:
 };
 }
 
-DeviceProfile::DeviceProfile() : PropertyAdaptor(NULL), d_ptr(new \
DeviceProfilePrivate) { } +DeviceProfile::DeviceProfile() : \
PropertyAdaptor(nullptr), d_ptr(new DeviceProfilePrivate) { }  
 DeviceProfile::DeviceProfile(const DeviceType& type)
-    : PropertyAdaptor(NULL), d_ptr(new DeviceProfilePrivate)
+    : PropertyAdaptor(nullptr), d_ptr(new DeviceProfilePrivate)
 {
     setDeviceType(type);
 }
 
 DeviceProfile::DeviceProfile(const DeviceProfile& profile)
-    : PropertyAdaptor(NULL), d_ptr(new DeviceProfilePrivate)
+    : PropertyAdaptor(nullptr), d_ptr(new DeviceProfilePrivate)
 {
     operator=(profile);
 }
@@ -250,6 +250,6 @@ bool DeviceProfile::setProperty(const Property& \
property, const QString& value)  
 bool DeviceProfile::supportsProperty(const Property& property) const
 {
-    return (DeviceProperty::map(property) != NULL);
+    return (DeviceProperty::map(property) != nullptr);
 }
 
diff --git a/src/common/enum.h b/src/common/enum.h
index 162b6e8..5666c3b 100644
--- a/src/common/enum.h
+++ b/src/common/enum.h
@@ -123,7 +123,7 @@ public:
      *
      * @param key The key of the instance to search.
      * 
-     * @return A constant pointer to the instance or NULL if not found.
+     * @return A constant pointer to the instance or nullptr if not found.
      */
     static const D* find(const K& key)
     {
@@ -133,7 +133,7 @@ public:
                 return &(*i);
             }
         }
-        return NULL;
+        return nullptr;
     }
 
 
diff --git a/src/common/propertyadaptor.cpp \
b/src/common/propertyadaptor.cpp index 8d7d0ad..3cd12c4 100644
--- a/src/common/propertyadaptor.cpp
+++ b/src/common/propertyadaptor.cpp
@@ -32,14 +32,13 @@ namespace Wacom {
       */
     class PropertyAdaptorPrivate {
         public:
-            PropertyAdaptor* adaptee;
+            PropertyAdaptor *adaptee = nullptr;
     };
 }
 
 PropertyAdaptor::PropertyAdaptor() : d_ptr(new PropertyAdaptorPrivate)
 {
-    Q_D( PropertyAdaptor );
-    d->adaptee = NULL;
+
 }
 
 
@@ -59,7 +58,7 @@ const QList<Property> PropertyAdaptor::getProperties() \
const  {
     Q_D( const PropertyAdaptor );
 
-    if (d->adaptee != NULL) {
+    if (d->adaptee) {
         return d->adaptee->getProperties();
     }
 
@@ -71,7 +70,7 @@ const QString PropertyAdaptor::getProperty ( const \
Property& property ) const  {
     Q_D( const PropertyAdaptor );
 
-    if (d->adaptee != NULL) {
+    if (d->adaptee) {
         return d->adaptee->getProperty(property);
     }
 
@@ -90,7 +89,7 @@ bool PropertyAdaptor::setProperty ( const Property& \
property, const QString& val  {
     Q_D( PropertyAdaptor );
 
-    if (d->adaptee != NULL) {
+    if (d->adaptee) {
         return d->adaptee->setProperty(property, value);
     }
 
@@ -102,7 +101,7 @@ bool PropertyAdaptor::supportsProperty ( const \
Property& property ) const  {
     Q_D( const PropertyAdaptor );
 
-    if (d->adaptee != NULL) {
+    if (d->adaptee) {
         return d->adaptee->supportsProperty(property);
     }
 
diff --git a/src/common/propertyset.h b/src/common/propertyset.h
index 3cbc62a..146fdc6 100644
--- a/src/common/propertyset.h
+++ b/src/common/propertyset.h
@@ -78,7 +78,7 @@ public:
      *
      * @param id The property id to search for.
      *
-     * @return A constant pointer to the property or NULL if the property \
is not supported by this set. +     * @return A constant pointer to the \
                property or nullptr if the property is not supported by \
                this set.
      */
     static const D* map (const Property& property)
     {
@@ -90,7 +90,7 @@ public:
             }
         }
 
-        return NULL;
+        return nullptr;
     }
 
     /**
diff --git a/src/common/tabletinformation.cpp \
b/src/common/tabletinformation.cpp index ccfb053..939afe8 100644
--- a/src/common/tabletinformation.cpp
+++ b/src/common/tabletinformation.cpp
@@ -213,7 +213,7 @@ const DeviceInformation* TabletInformation::getDevice \
                (const DeviceType& deviceT
     TabletInformationPrivate::DeviceInformationMap::ConstIterator iter = \
d->deviceMap.constFind(deviceType.key());  
     if (iter == d->deviceMap.constEnd()) {
-        return NULL;
+        return nullptr;
     }
 
     return &(iter.value());
@@ -290,7 +290,7 @@ bool TabletInformation::hasDevice(int deviceId) const
     foreach (const DeviceType& type, DeviceType::list()) {
         const DeviceInformation* device = getDevice(type);
 
-        if (device != NULL && device->getDeviceId() == deviceId) {
+        if (device && device->getDeviceId() == deviceId) {
             return true;
         }
     }
diff --git a/src/common/tabletprofile.cpp b/src/common/tabletprofile.cpp
index e301aa9..a549cbf 100644
--- a/src/common/tabletprofile.cpp
+++ b/src/common/tabletprofile.cpp
@@ -107,7 +107,7 @@ bool TabletProfile::hasDevice(const QString& device) \
const  {
     const DeviceType* deviceType = DeviceType::find(device);
 
-    if (deviceType == NULL) {
+    if (!deviceType) {
         return false;
     }
 
diff --git a/src/kcmodule/calibrationdialog.cpp \
b/src/kcmodule/calibrationdialog.cpp index 9eadb74..f598c48 100644
--- a/src/kcmodule/calibrationdialog.cpp
+++ b/src/kcmodule/calibrationdialog.cpp
@@ -69,7 +69,7 @@ void CalibrationDialog::paintEvent( QPaintEvent *event )
     Q_UNUSED( event );
 
     QPainter painter( this );
-    painter.setPen( Qt::black );
+    painter.setPen(palette().color(QPalette::WindowText));
 
     // vertical line
     painter.drawLine( m_shiftLeft + boxwidth / 2,
diff --git a/src/kcmodule/tabletareaselectioncontroller.cpp \
b/src/kcmodule/tabletareaselectioncontroller.cpp index c4d5acc..f7b5dd4 \
                100644
--- a/src/kcmodule/tabletareaselectioncontroller.cpp
+++ b/src/kcmodule/tabletareaselectioncontroller.cpp
@@ -102,7 +102,7 @@ void \
TabletAreaSelectionController::setView(TabletAreaSelectionView* view)  \
Q_D(TabletAreaSelectionController);  
     // cleanup signal/slot connections if we already have a view
-    if (d->view != NULL) {
+    if (d->view) {
         disconnect(d->view, SIGNAL(signalCalibrateClicked()),     this, \
                SLOT(onCalibrateClicked()));
         disconnect(d->view, SIGNAL(signalFullTabletSelection()),  this, \
                SLOT(onFullTabletSelected()));
         disconnect(d->view, SIGNAL(signalScreenToggle()),         this, \
SLOT(onScreenToggle())); @@ -113,7 +113,7 @@ void \
TabletAreaSelectionController::setView(TabletAreaSelectionView* view)  // \
save view and connect signals  d->view = view;
 
-    if (view != NULL) {
+    if (view) {
         connect(view, SIGNAL(signalCalibrateClicked()),     this, \
                SLOT(onCalibrateClicked()));
         connect(view, SIGNAL(signalFullTabletSelection()),  this, \
                SLOT(onFullTabletSelected()));
         connect(view, SIGNAL(signalScreenToggle()),         this, \
                SLOT(onScreenToggle()));
diff --git a/src/kcmodule/tabletpagewidget.cpp \
b/src/kcmodule/tabletpagewidget.cpp index 0ef02df..d5899c2 100644
--- a/src/kcmodule/tabletpagewidget.cpp
+++ b/src/kcmodule/tabletpagewidget.cpp
@@ -174,7 +174,7 @@ void TabletPageWidget::onTabletMappingClicked()
     // get current rotation settings
     // we need to invert it as our rotation settings in this widget have a \
                canvas viewpoint
     const ScreenRotation* lookupRotation = \
                ScreenRotation::find(getRotation());
-    ScreenRotation        rotation       = (lookupRotation != NULL) ? \
lookupRotation->invert() : ScreenRotation::NONE; +    ScreenRotation        \
rotation       = lookupRotation ? lookupRotation->invert() : \
ScreenRotation::NONE;  
     TabletAreaSelectionDialog selectionDialog;
     selectionDialog.setupWidget( getScreenMap(), d->deviceNameStylus, \
rotation); @@ -197,7 +197,7 @@ void TabletPageWidget::onRotationChanged()
 
     // we need to invert it as our rotation settings in this widget have a \
canvas viewpoint  // and our private member variable has a tablet viewpoint
-    d->tabletRotation = (lookupRotation != NULL) ? \
lookupRotation->invert() : ScreenRotation::NONE; +    d->tabletRotation = \
lookupRotation ? lookupRotation->invert() : ScreenRotation::NONE;  
     emit rotationChanged(d->tabletRotation);
 }
@@ -336,7 +336,7 @@ void TabletPageWidget::setRotation(const QString& \
value)  Q_D (TabletPageWidget);
 
     const ScreenRotation* lookup        = ScreenRotation::find(value);
-    ScreenRotation        rotation      = (lookup != NULL) ? *lookup : \
ScreenRotation::NONE; +    ScreenRotation        rotation      = lookup ? \
*lookup : ScreenRotation::NONE;  QString               rotationValue = \
rotation.key();  
     if (rotation == ScreenRotation::AUTO) {
diff --git a/src/kded/dbustabletservice.cpp \
b/src/kded/dbustabletservice.cpp index 8ccff9c..5cce716 100644
--- a/src/kded/dbustabletservice.cpp
+++ b/src/kded/dbustabletservice.cpp
@@ -92,7 +92,7 @@ QString DBusTabletService::getDeviceName(const QString \
&tabletId, const QString&  
     const DeviceType *type = DeviceType::find(device);
 
-    if (type == NULL) {
+    if (!type) {
         errWacom << QString::fromLatin1("Unsupported device type \
'%1'!").arg(device);  return unknown;
     }
@@ -110,7 +110,7 @@ QString DBusTabletService::getInformation(const QString \
&tabletId,const QString&  
     const TabletInfo* devinfo = TabletInfo::find(info);
 
-    if (devinfo == NULL) {
+    if (!devinfo) {
         errWacom << QString::fromLatin1("Can not get unsupported tablet \
information '%1'!").arg(info);  return unknown;
     }
@@ -134,14 +134,14 @@ QString DBusTabletService::getProperty(const QString \
&tabletId, const QString& d  
     const DeviceType* type = DeviceType::find(deviceType);
 
-    if (type == NULL) {
+    if (!type) {
         errWacom << QString::fromLatin1("Can not get property '%1' from \
invalid device '%2'!").arg(property).arg(deviceType);  return QString();
     }
 
     const Property* prop = Property::find(property);
 
-    if (prop == NULL) {
+    if (!prop) {
         errWacom << QString::fromLatin1("Can not get invalid property '%1' \
from device '%2'!").arg(property).arg(deviceType);  return QString();
     }
@@ -189,14 +189,14 @@ void DBusTabletService::setProperty(const QString \
&tabletId, const QString& devi  
     const DeviceType* type = DeviceType::find(deviceType);
 
-    if (type == NULL) {
+    if (!type) {
         errWacom << QString::fromLatin1("Can not set property '%1' on \
invalid device '%2' to '%3'!").arg(property).arg(deviceType).arg(value);  \
return;  }
 
     const Property* prop = Property::find(property);
 
-    if (prop == NULL) {
+    if (!prop) {
         errWacom << QString::fromLatin1("Can not set invalid property '%1' \
on device '%2' to '%3'!").arg(property).arg(deviceType).arg(value);  \
return;  }
diff --git a/src/kded/procsystemadaptor.cpp \
b/src/kded/procsystemadaptor.cpp index fe9f0ba..bc268f2 100644
--- a/src/kded/procsystemadaptor.cpp
+++ b/src/kded/procsystemadaptor.cpp
@@ -36,9 +36,9 @@ class ProcSystemAdaptorPrivate
 
 
 ProcSystemAdaptor::ProcSystemAdaptor(const QString& deviceName)
-    : PropertyAdaptor(NULL), d_ptr(new ProcSystemAdaptorPrivate)
+    : PropertyAdaptor(nullptr), d_ptr(new ProcSystemAdaptorPrivate)
 {
-    Q_D( ProcSystemAdaptor );
+    Q_D(ProcSystemAdaptor);
     d->deviceName = deviceName;
 }
 
@@ -104,6 +104,6 @@ bool ProcSystemAdaptor::setProperty(const Property& \
property, const QString& val  
 bool ProcSystemAdaptor::supportsProperty(const Property& property) const
 {
-    return (ProcSystemProperty::map(property) != NULL);
+    return (ProcSystemProperty::map(property));
 }
 
diff --git a/src/kded/tabletdaemon.cpp b/src/kded/tabletdaemon.cpp
index 5181a81..62385c5 100644
--- a/src/kded/tabletdaemon.cpp
+++ b/src/kded/tabletdaemon.cpp
@@ -132,7 +132,7 @@ void TabletDaemon::setupActions()
     //if someone adds another action also add it to \
kcmodule/generalwidget.cpp  
     // This method is called multiple times - make sure the action \
                collection is only created once.
-    if (d->actionCollection.get() == NULL) {
+    if (!d->actionCollection) {
         d->actionCollection = std::shared_ptr<GlobalActions>(new \
GlobalActions(false, this));  d->actionCollection->setConfigGlobal(true);
     }
diff --git a/src/kded/tablethandler.cpp b/src/kded/tablethandler.cpp
index dfc4dd2..7159173 100644
--- a/src/kded/tablethandler.cpp
+++ b/src/kded/tablethandler.cpp
@@ -62,7 +62,7 @@ namespace Wacom
 using namespace Wacom;
 
 TabletHandler::TabletHandler()
-    : TabletHandlerInterface(NULL), d_ptr(new TabletHandlerPrivate)
+    : TabletHandlerInterface(nullptr), d_ptr(new TabletHandlerPrivate)
 {
     Q_D( TabletHandler );
 
@@ -72,7 +72,7 @@ TabletHandler::TabletHandler()
 
 
 TabletHandler::TabletHandler(const QString& profileFile, const QString \
                configFile)
-    : TabletHandlerInterface(NULL), d_ptr(new TabletHandlerPrivate)
+    : TabletHandlerInterface(nullptr), d_ptr(new TabletHandlerPrivate)
 {
     Q_D( TabletHandler );
 
@@ -94,7 +94,7 @@ QString TabletHandler::getProperty(const QString \
&tabletId, const DeviceType& de  {
     Q_D( const TabletHandler );
 
-    if( !d->tabletBackendList.contains(tabletId) || \
d->tabletBackendList.value(tabletId) == NULL) { +    if( \
!d->tabletBackendList.contains(tabletId) || \
d->tabletBackendList.value(tabletId) == nullptr) {  errWacom << \
QString::fromLatin1("Unable to get property '%1' from device '%2' as no \
device is currently available!").arg(property.key()).arg(deviceType.key()); \
return QString();  }
@@ -127,7 +127,7 @@ void TabletHandler::onTabletAdded( const \
TabletInformation& info )  // create tablet backend
     TabletBackendInterface *tbi = \
TabletBackendFactory::createBackend(info);  
-    if (tbi == NULL) {
+    if (!tbi) {
         errWacom << "Could not create tablet backend interface. Ignoring \
Tablet";  return; // no valid backend found
     }
@@ -606,7 +606,7 @@ bool TabletHandler::hasTablet(const QString &tabletId) \
const  Q_D( const TabletHandler );
 
     return (d->tabletBackendList.contains(tabletId) &&
-            d->tabletBackendList.value(tabletId) != NULL);
+            d->tabletBackendList.value(tabletId) != nullptr);
 }
 
 
diff --git a/src/kded/x11tabletfinder.cpp b/src/kded/x11tabletfinder.cpp
index 81addc2..ea2e3ce 100644
--- a/src/kded/x11tabletfinder.cpp
+++ b/src/kded/x11tabletfinder.cpp
@@ -202,7 +202,7 @@ const DeviceType* X11TabletFinder::getDeviceType (const \
QString& toolType) const  return &(DeviceType::Stylus);
     }
 
-    return NULL;
+    return nullptr;
 }
 
 
@@ -272,7 +272,7 @@ const QString X11TabletFinder::getToolType \
(X11InputDevice& device) const  
 #if defined(HAVE_XCB_XINPUT)
         xcb_get_atom_name_cookie_t cookie = \
                xcb_get_atom_name(QX11Info::connection(), \
                toolTypeAtoms.at(0));
-        xcb_get_atom_name_reply_t* reply = \
xcb_get_atom_name_reply(QX11Info::connection(), cookie, NULL); +        \
xcb_get_atom_name_reply_t* reply = \
xcb_get_atom_name_reply(QX11Info::connection(), cookie, nullptr);  if \
                (reply) {
             toolTypeName = \
QString::fromLatin1(QByteArray(xcb_get_atom_name_name(reply), \
xcb_get_atom_name_name_length(reply)));  free(reply);
@@ -280,7 +280,7 @@ const QString X11TabletFinder::getToolType \
(X11InputDevice& device) const  
 #else  // HAVE_XCB_XINPUT
         char *type_name = XGetAtomName (device.getDisplay(), \
                (Atom)toolTypeAtoms.at(0));
-        if (type_name != NULL) {
+        if (type_name != nullptr) {
             toolTypeName = QLatin1String(type_name);
             XFree( type_name );
         } else {
diff --git a/src/kded/xinputadaptor.cpp b/src/kded/xinputadaptor.cpp
index fd626d9..6528350 100644
--- a/src/kded/xinputadaptor.cpp
+++ b/src/kded/xinputadaptor.cpp
@@ -47,7 +47,7 @@ class XinputAdaptorPrivate
 
 
 XinputAdaptor::XinputAdaptor(const QString& deviceName)
-    : PropertyAdaptor(NULL), d_ptr(new XinputAdaptorPrivate)
+    : PropertyAdaptor(nullptr), d_ptr(new XinputAdaptorPrivate)
 {
     Q_D( XinputAdaptor );
     d->deviceName = deviceName;
@@ -72,9 +72,9 @@ const QString XinputAdaptor::getProperty(const Property& \
property) const  {
     Q_D(const XinputAdaptor);
 
-    const XinputProperty* xinputproperty = XinputProperty::map(property);
+    const XinputProperty *xinputproperty = XinputProperty::map(property);
 
-    if (xinputproperty == NULL) {
+    if (!xinputproperty) {
         errWacom << QString::fromLatin1("Can not get unsupported property \
'%1' from device '%2' using \
xinput!").arg(property.key()).arg(d->deviceName);  return QString();
     }
@@ -94,9 +94,9 @@ bool XinputAdaptor::setProperty(const Property& property, \
const QString& value)  
     dbgWacom << QString::fromLatin1("Setting property '%1' to \
'%2'.").arg(property.key()).arg(value);  
-    const XinputProperty* xinputproperty = XinputProperty::map(property);
+    const XinputProperty *xinputproperty = XinputProperty::map(property);
 
-    if (xinputproperty == NULL) {
+    if (!xinputproperty) {
         errWacom << QString::fromLatin1("Can not set unsupported property \
'%1' to '%2' on device '%3' using \
xinput!").arg(property.key()).arg(value).arg(d->deviceName);  return false;
     }
@@ -112,7 +112,7 @@ bool XinputAdaptor::setProperty(const Property& \
property, const QString& value)  
 bool XinputAdaptor::supportsProperty(const Property& property) const
 {
-    return (XinputProperty::map(property) != NULL);
+    return (XinputProperty::map(property) != nullptr);
 }
 
 
diff --git a/src/kded/xsetwacomadaptor.cpp b/src/kded/xsetwacomadaptor.cpp
index ed6280b..256f325 100644
--- a/src/kded/xsetwacomadaptor.cpp
+++ b/src/kded/xsetwacomadaptor.cpp
@@ -41,7 +41,7 @@ class XsetwacomAdaptorPrivate
 
 
 XsetwacomAdaptor::XsetwacomAdaptor(const QString& deviceName)
-    : PropertyAdaptor(NULL), d_ptr(new XsetwacomAdaptorPrivate)
+    : PropertyAdaptor(nullptr), d_ptr(new XsetwacomAdaptorPrivate)
 {
     Q_D( XsetwacomAdaptor );
     d->device = deviceName;
@@ -49,7 +49,7 @@ XsetwacomAdaptor::XsetwacomAdaptor(const QString& \
deviceName)  
 
 XsetwacomAdaptor::XsetwacomAdaptor(const QString& deviceName, const QMap< \
                QString, QString >& buttonMap)
-    : PropertyAdaptor(NULL), d_ptr(new XsetwacomAdaptorPrivate)
+    : PropertyAdaptor(nullptr), d_ptr(new XsetwacomAdaptorPrivate)
 {
     Q_D( XsetwacomAdaptor );
 
@@ -73,9 +73,9 @@ const QString XsetwacomAdaptor::getProperty(const \
Property& property) const  {
     Q_D( const XsetwacomAdaptor );
 
-    const XsetwacomProperty* xsetproperty = \
XsetwacomProperty::map(property); +    const XsetwacomProperty \
*xsetproperty = XsetwacomProperty::map(property);  
-    if (xsetproperty == NULL) {
+    if (!xsetproperty) {
         errWacom << QString::fromLatin1("Can not get unsupported property \
'%1' using xsetwacom!").arg(property.key());  return QString();
     }
@@ -100,9 +100,9 @@ bool XsetwacomAdaptor::setProperty(const Property& \
property, const QString& valu  
     dbgWacom << QString::fromLatin1("Setting property '%1' to '%2' on \
device '%3'.").arg(property.key()).arg(value).arg(d->device);  
-    const XsetwacomProperty* xsetproperty = \
XsetwacomProperty::map(property); +    const XsetwacomProperty \
*xsetproperty = XsetwacomProperty::map(property);  
-    if (xsetproperty == NULL) {
+    if (!xsetproperty) {
         errWacom << QString::fromLatin1("Can not set unsupported property \
'%1' to '%2' on device '%3' using \
xsetwacom!").arg(property.key()).arg(value).arg(d->device);  return false;
     }
@@ -129,7 +129,7 @@ bool XsetwacomAdaptor::setProperty(const Property& \
property, const QString& valu  
 bool XsetwacomAdaptor::supportsProperty(const Property& property) const
 {
-    return (XsetwacomProperty::map(property) != NULL);
+    return (XsetwacomProperty::map(property) != nullptr);
 }
 
 
@@ -228,7 +228,7 @@ bool XsetwacomAdaptor::setRotation(const QString& \
value)  Q_D( const XsetwacomAdaptor );
 
     const ScreenRotation* lookup   = ScreenRotation::find(value);
-    ScreenRotation        rotation = (lookup != NULL) ? *lookup : \
ScreenRotation::NONE; +    ScreenRotation        rotation = lookup ? \
*lookup : ScreenRotation::NONE;  
     // only accept real rotations
     if (rotation == ScreenRotation::NONE || rotation == ScreenRotation::CW \
||


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic