Commit 442e09bb authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use nullptr

parent 13b36eb1
......@@ -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;
}
}
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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:
......
......@@ -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);
......
......@@ -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);
......
......@@ -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:
......
......@@ -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;
......
......@@ -70,7 +70,7 @@ public:
static KSldApp* self();
KSldApp(QObject * parent = 0);
KSldApp(QObject * parent = nullptr);
virtual ~KSldApp();
LockState lockState() const {
......
......@@ -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,
......
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