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

List:       kde-commits
Subject:    [kscreenlocker] /: Use nullptr
From:       Friedrich W. H. Kossebau <null () kde ! org>
Date:       2018-02-06 22:25:23
Message-ID: E1ejBg3-0006LX-38 () code ! kde ! org
[Download RAW message or body]

Git commit 442e09bb8aff34ce68b2baf582acd505805ab346 by Friedrich W. H. Kossebau.
Committed on 06/02/2018 at 20:41.
Pushed by kossebau into branch 'master'.

Use nullptr

M  +3    -3    greeter/authenticator.cpp
M  +1    -1    greeter/autotests/seccomp_test.cpp
M  +6    -6    greeter/greeterapp.cpp
M  +2    -2    greeter/kwinglplatform.cpp
M  +1    -1    greeter/lnf_integration.cpp
M  +1    -1    greeter/wallpaper_integration.cpp
M  +1    -1    interface.h
M  +4    -4    ksldapp.cpp
M  +1    -1    ksldapp.h
M  +2    -2    x11locker.cpp

https://commits.kde.org/kscreenlocker/442e09bb8aff34ce68b2baf582acd505805ab346

diff --git a/greeter/authenticator.cpp b/greeter/authenticator.cpp
index 8c9391b..3951513 100644
--- a/greeter/authenticator.cpp
+++ b/greeter/authenticator.cpp
@@ -140,7 +140,7 @@ void KCheckPass::start()
                "kcheckpass",
                "-m", "classic",
                "-S", fdbuf,
-               (char *)0);
+               (char *)nullptr);
         _exit(20);
     }
     ::close(sfd[1]);
@@ -211,7 +211,7 @@ bool KCheckPass::GRecvArr(char **ret)
     if (!GRecvInt(&len))
         return false;
     if (!len) {
-        *ret = 0;
+        *ret = nullptr;
         return true;
     }
     if (!(buf = (char *)::malloc (len)))
@@ -221,7 +221,7 @@ bool KCheckPass::GRecvArr(char **ret)
         return true;
     } else {
         ::free(buf);
-        *ret = 0;
+        *ret = nullptr;
         return false;
     }
 }
diff --git a/greeter/autotests/seccomp_test.cpp b/greeter/autotests/seccomp_test.cpp
index 0c745ca..ea0c508 100644
--- a/greeter/autotests/seccomp_test.cpp
+++ b/greeter/autotests/seccomp_test.cpp
@@ -240,7 +240,7 @@ void SeccompTest::testStartProcess()
     // using glibc fork succeeds as it uses clone
     // we don't forbid clone as it's needed to start a new thread
     // so only test that exec fails
-    QCOMPARE(execl(existingFileChar, "fakekcheckpass", (char*)0), -1);
+    QCOMPARE(execl(existingFileChar, "fakekcheckpass", (char*)nullptr), -1);
     QCOMPARE(errno, EPERM);
 }
 
diff --git a/greeter/greeterapp.cpp b/greeter/greeterapp.cpp
index f0163a9..e3ac691 100644
--- a/greeter/greeterapp.cpp
+++ b/greeter/greeterapp.cpp
@@ -104,7 +104,7 @@ public:
 UnlockApp::UnlockApp(int &argc, char **argv)
     : QGuiApplication(argc, argv)
     , m_resetRequestIgnoreTimer(new QTimer(this))
-    , m_delayedLockTimer(0)
+    , m_delayedLockTimer(nullptr)
     , m_testing(false)
     , m_ignoreRequests(false)
     , m_immediateLock(false)
@@ -395,7 +395,7 @@ void UnlockApp::desktopResized()
 
 void UnlockApp::markViewsAsVisible(KQuickAddons::QuickViewSharedEngine *view)
 {
-    disconnect(view, &QQuickWindow::frameSwapped, this, 0);
+    disconnect(view, &QQuickWindow::frameSwapped, this, nullptr);
     QQmlProperty showProperty(view->rootObject(), QStringLiteral("viewVisible"));
     showProperty.write(true);
     // random state update, actually rather required on init only
@@ -409,7 +409,7 @@ void UnlockApp::getFocus()
     if (m_views.isEmpty()) {
         return;
     }
-    QWindow *w = 0;
+    QWindow *w = nullptr;
     // this loop is required to make the qml/graphicsscene properly handle the \
shared keyboard input  // ie. "type something into the box of every greeter"
     foreach (KQuickAddons::QuickViewSharedEngine *view, m_views) {
@@ -449,7 +449,7 @@ void UnlockApp::getFocus()
 void UnlockApp::setLockedPropertyOnViews()
 {
     delete m_delayedLockTimer;
-    m_delayedLockTimer = 0;
+    m_delayedLockTimer = nullptr;
 
     foreach (KQuickAddons::QuickViewSharedEngine *view, m_views) {
         QQmlProperty lockProperty(view->rootObject(), QStringLiteral("locked"));
@@ -532,7 +532,7 @@ void UnlockApp::lockImmediately()
 bool UnlockApp::eventFilter(QObject *obj, QEvent *event)
 {
     if (obj != this && event->type() == QEvent::Show) {
-        KQuickAddons::QuickViewSharedEngine *view(0);
+        KQuickAddons::QuickViewSharedEngine *view = nullptr;
         foreach (KQuickAddons::QuickViewSharedEngine *v, m_views) {
             if (v == obj) {
                 view = v;
@@ -542,7 +542,7 @@ bool UnlockApp::eventFilter(QObject *obj, QEvent *event)
         if (view && view->winId() && QX11Info::isPlatformX11()) {
             // showing greeter view window, set property
             static Atom tag = XInternAtom(QX11Info::display(), "_KDE_SCREEN_LOCKER", \
                False);
-            XChangeProperty(QX11Info::display(), view->winId(), tag, tag, 32, \
PropModeReplace, 0, 0); +            XChangeProperty(QX11Info::display(), \
view->winId(), tag, tag, 32, PropModeReplace, nullptr, 0);  }
         // no further processing
         return false;
diff --git a/greeter/kwinglplatform.cpp b/greeter/kwinglplatform.cpp
index 86c5f9d..ca7f17c 100644
--- a/greeter/kwinglplatform.cpp
+++ b/greeter/kwinglplatform.cpp
@@ -35,7 +35,7 @@ along with this program.  If not, see \
<http://www.gnu.org/licenses/>.  namespace KWin
 {
 
-GLPlatform *GLPlatform::s_platform = 0;
+GLPlatform *GLPlatform::s_platform = nullptr;
 
 static qint64 parseVersionString(const QByteArray &version)
 {
@@ -231,7 +231,7 @@ static ChipClass detectNVidiaClass(const QString &chipset)
 {
     QString name = extract(chipset, QStringLiteral("\\bNV[0-9,A-F]{2}\\b")); // NV \
followed by two hexadecimal digits  if (!name.isEmpty()) {
-        const int id = chipset.midRef(2, -1).toInt(0, 16); // Strip the 'NV' from \
the id +        const int id = chipset.midRef(2, -1).toInt(nullptr, 16); // Strip the \
'NV' from the id  
         switch(id & 0xf0) {
         case 0x00:
diff --git a/greeter/lnf_integration.cpp b/greeter/lnf_integration.cpp
index a6b9cde..6e626eb 100644
--- a/greeter/lnf_integration.cpp
+++ b/greeter/lnf_integration.cpp
@@ -62,7 +62,7 @@ KConfigLoader *LnFIntegration::configScheme()
         const KConfigGroup cfg = m_config->group("Greeter").group("LnF");
 
         if (xmlPath.isEmpty()) {
-            m_configLoader = new KConfigLoader(cfg, 0, this);
+            m_configLoader = new KConfigLoader(cfg, nullptr, this);
         } else {
             QFile file(xmlPath);
             m_configLoader = new KConfigLoader(cfg, &file, this);
diff --git a/greeter/wallpaper_integration.cpp b/greeter/wallpaper_integration.cpp
index 726528f..6c5c5e8 100644
--- a/greeter/wallpaper_integration.cpp
+++ b/greeter/wallpaper_integration.cpp
@@ -70,7 +70,7 @@ KConfigLoader *WallpaperIntegration::configScheme()
         const KConfigGroup cfg = \
m_config->group("Greeter").group("Wallpaper").group(m_pluginName);  
         if (xmlPath.isEmpty()) {
-            m_configLoader = new KConfigLoader(cfg, 0, this);
+            m_configLoader = new KConfigLoader(cfg, nullptr, this);
         } else {
             QFile file(xmlPath);
             m_configLoader = new KConfigLoader(cfg, &file, this);
diff --git a/interface.h b/interface.h
index 3866f33..4ae9fe4 100644
--- a/interface.h
+++ b/interface.h
@@ -44,7 +44,7 @@ class Interface : public QObject, protected QDBusContext
     Q_OBJECT
     Q_CLASSINFO("D-Bus Interface", "org.freedesktop.ScreenSaver")
 public:
-    explicit Interface(KSldApp *parent = 0);
+    explicit Interface(KSldApp *parent = nullptr);
     virtual ~Interface();
 
 public Q_SLOTS:
diff --git a/ksldapp.cpp b/ksldapp.cpp
index 5c16511..632d509 100644
--- a/ksldapp.cpp
+++ b/ksldapp.cpp
@@ -66,7 +66,7 @@ along with this program.  If not, see \
<http://www.gnu.org/licenses/>.  namespace ScreenLocker
 {
 
-static KSldApp * s_instance = 0;
+static KSldApp * s_instance = nullptr;
 
 KSldApp* KSldApp::self()
 {
@@ -80,8 +80,8 @@ KSldApp* KSldApp::self()
 KSldApp::KSldApp(QObject * parent)
     : QObject(parent)
     , m_lockState(Unlocked)
-    , m_lockProcess(NULL)
-    , m_lockWindow(NULL)
+    , m_lockProcess(nullptr)
+    , m_lockWindow(nullptr)
     , m_waylandServer(new WaylandServer(this))
     , m_waylandDisplay(nullptr)
     , m_lockedTimer(QElapsedTimer())
@@ -523,7 +523,7 @@ void KSldApp::doUnlock()
     hideLockWindow();
     // delete the window again, to get rid of event filter
     delete m_lockWindow;
-    m_lockWindow = NULL;
+    m_lockWindow = nullptr;
     m_lockState = Unlocked;
     m_lockedTimer.invalidate();
     m_greeterCrashedCounter = 0;
diff --git a/ksldapp.h b/ksldapp.h
index d692f34..ee58bb1 100644
--- a/ksldapp.h
+++ b/ksldapp.h
@@ -70,7 +70,7 @@ public:
 
     static KSldApp* self();
 
-    KSldApp(QObject * parent = 0);
+    KSldApp(QObject * parent = nullptr);
     virtual ~KSldApp();
 
     LockState lockState() const {
diff --git a/x11locker.cpp b/x11locker.cpp
index f405a34..344d491 100644
--- a/x11locker.cpp
+++ b/x11locker.cpp
@@ -82,7 +82,7 @@ void X11Locker::initialize()
     Window* real;
     unsigned nreal;
     if( XQueryTree( QX11Info::display(), QX11Info::appRootWindow(), &r, &p, &real, \
                &nreal )
-        && real != NULL ) {
+        && real != nullptr ) {
         for( unsigned i = 0; i < nreal; ++i ) {
             XWindowAttributes winAttr;
             if (XGetWindowAttributes(QX11Info::display(), real[ i ], &winAttr)) {
@@ -168,7 +168,7 @@ void X11Locker::saveVRoot()
       Atom actual_type;
       int actual_format;
       unsigned long nitems, bytesafter;
-      unsigned char *newRoot = 0;
+      unsigned char *newRoot = nullptr;
 
       if ((XGetWindowProperty(QX11Info::display(), children[i], gXA_VROOT, 0, 1,
           False, XA_WINDOW, &actual_type, &actual_format, &nitems, &bytesafter,


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

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