plugins: use nullptr instead of 0 and NULL
Change-Id: I7f3e56db1d0db178d8a7d9eb91c09e03cae89f6b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
42e48b4706
commit
d3f748c340
@ -27,7 +27,8 @@ QObject* QEvdevKeyboardPlugin::create(const QString &key,
|
||||
{
|
||||
if (!key.compare(QLatin1String("EvdevKeyboard"), Qt::CaseInsensitive))
|
||||
return new QEvdevKeyboardManager(key, specification);
|
||||
return 0;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -27,7 +27,8 @@ QObject* QEvdevMousePlugin::create(const QString &key,
|
||||
{
|
||||
if (!key.compare(QLatin1String("EvdevMouse"), Qt::CaseInsensitive))
|
||||
return new QEvdevMouseManager(key, specification);
|
||||
return 0;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -27,7 +27,7 @@ QObject* QEvdevTabletPlugin::create(const QString &key,
|
||||
if (!key.compare(QLatin1String("EvdevTablet"), Qt::CaseInsensitive))
|
||||
return new QEvdevTabletManager(key, spec);
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -27,7 +27,7 @@ QObject* QEvdevTouchScreenPlugin::create(const QString &key,
|
||||
if (!key.compare(QLatin1String("EvdevTouch"), Qt::CaseInsensitive))
|
||||
return new QEvdevTouchManager(key, spec);
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -20,7 +20,7 @@ QObject *QLibInputPlugin::create(const QString &key, const QString &specificatio
|
||||
if (!key.compare(QLatin1String("libinput"), Qt::CaseInsensitive))
|
||||
return new QLibInputHandler(key, specification);
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -22,7 +22,7 @@ QObject* QTsLibPlugin::create(const QString &key,
|
||||
|| !key.compare(QLatin1String("TslibRaw"), Qt::CaseInsensitive))
|
||||
return new QTsLibMouseHandler(key, specification);
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -30,7 +30,7 @@ QObject* QTuioTouchPlugin::create(const QString &key,
|
||||
if (!key.compare(QLatin1String("TuioTouch"), Qt::CaseInsensitive))
|
||||
return new QTuioHandler(spec);
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -161,7 +161,7 @@ class PropertiesDBusInterface : public QDBusAbstractInterface
|
||||
{
|
||||
public:
|
||||
PropertiesDBusInterface(const QString &service, const QString &path, const QString &interface,
|
||||
const QDBusConnection &connection, QObject *parent = 0)
|
||||
const QDBusConnection &connection, QObject *parent = nullptr)
|
||||
: QDBusAbstractInterface(service, path, interface.toLatin1().data(), connection, parent)
|
||||
{
|
||||
}
|
||||
|
@ -30,7 +30,8 @@ QIBusPlatformInputContext *QIbusPlatformInputContextPlugin::create(const QString
|
||||
qDBusRegisterMetaType<QIBusText>();
|
||||
return new QIBusPlatformInputContext;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -468,7 +468,7 @@ void QIBusPlatformInputContext::filterEventFinished(QDBusPendingCallWatcher *cal
|
||||
if (!filtered) {
|
||||
#ifndef QT_NO_CONTEXTMENU
|
||||
if (type == QEvent::KeyPress && qtcode == Qt::Key_Menu
|
||||
&& window != NULL) {
|
||||
&& window != nullptr) {
|
||||
const QPoint globalPos = window->screen()->handle()->cursor()->pos();
|
||||
const QPoint pos = window->mapFromGlobal(globalPos);
|
||||
QWindowSystemInterfacePrivate::ContextMenuEvent contextMenuEvent(window, false, pos,
|
||||
@ -581,10 +581,10 @@ static bool shouldConnectIbusPortal()
|
||||
}
|
||||
|
||||
QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate()
|
||||
: connection(0),
|
||||
bus(0),
|
||||
portalBus(0),
|
||||
context(0),
|
||||
: connection(nullptr),
|
||||
bus(nullptr),
|
||||
portalBus(nullptr),
|
||||
context(nullptr),
|
||||
usePortal(shouldConnectIbusPortal()),
|
||||
valid(false),
|
||||
busConnected(false),
|
||||
@ -721,7 +721,7 @@ QDBusConnection *QIBusPlatformInputContextPrivate::createConnection()
|
||||
QFile file(getSocketPath());
|
||||
|
||||
if (!file.open(QFile::ReadOnly))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
QByteArray address;
|
||||
int pid = -1;
|
||||
@ -740,7 +740,7 @@ QDBusConnection *QIBusPlatformInputContextPrivate::createConnection()
|
||||
if (debug)
|
||||
qDebug() << "IBUS_ADDRESS=" << address << "PID=" << pid;
|
||||
if (address.isEmpty() || pid < 0 || kill(pid, 0) != 0)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
return new QDBusConnection(QDBusConnection::connectToBus(QString::fromLatin1(address), "QIBusProxy"_L1));
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ QPlatformIntegration* QLinuxFbIntegrationPlugin::create(const QString& system, c
|
||||
if (!system.compare("linuxfb"_L1, Qt::CaseInsensitive))
|
||||
return new QLinuxFbIntegration(paramList);
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -243,7 +243,7 @@ bool QLinuxFbDevice::createFramebuffer(QLinuxFbDevice::Output *output, int buffe
|
||||
qErrnoWarning(errno, "Failed to map dumb buffer");
|
||||
return false;
|
||||
}
|
||||
fb.p = mmap(0, fb.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd(), mreq.offset);
|
||||
fb.p = mmap(nullptr, fb.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd(), mreq.offset);
|
||||
if (fb.p == MAP_FAILED) {
|
||||
qErrnoWarning(errno, "Failed to mmap dumb buffer");
|
||||
return false;
|
||||
|
@ -42,7 +42,7 @@ QLinuxFbIntegration::QLinuxFbIntegration(const QStringList ¶mList)
|
||||
: m_primaryScreen(nullptr),
|
||||
m_fontDb(new QGenericUnixFontDatabase),
|
||||
m_services(new QGenericUnixServices),
|
||||
m_kbdMgr(0)
|
||||
m_kbdMgr(nullptr)
|
||||
{
|
||||
#if QT_CONFIG(kms)
|
||||
if (qEnvironmentVariableIntValue("QT_QPA_FB_DRM") != 0)
|
||||
@ -147,7 +147,7 @@ QPlatformNativeInterface *QLinuxFbIntegration::nativeInterface() const
|
||||
QFunctionPointer QLinuxFbIntegration::platformFunction(const QByteArray &function) const
|
||||
{
|
||||
Q_UNUSED(function);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#if QT_CONFIG(evdev)
|
||||
|
@ -213,7 +213,7 @@ static QImage::Format determineFormat(const fb_var_screeninfo &info, int depth)
|
||||
|
||||
static int openTtyDevice(const QString &device)
|
||||
{
|
||||
const char *const devs[] = { "/dev/tty0", "/dev/tty", "/dev/console", 0 };
|
||||
const char *const devs[] = { "/dev/tty0", "/dev/tty", "/dev/console", nullptr };
|
||||
|
||||
int fd = -1;
|
||||
if (device.isEmpty()) {
|
||||
@ -253,9 +253,9 @@ static void blankScreen(int fd, bool on)
|
||||
}
|
||||
|
||||
QLinuxFbScreen::QLinuxFbScreen(const QStringList &args)
|
||||
: mArgs(args), mFbFd(-1), mTtyFd(-1), mBlitter(0)
|
||||
: mArgs(args), mFbFd(-1), mTtyFd(-1), mBlitter(nullptr)
|
||||
{
|
||||
mMmap.data = 0;
|
||||
mMmap.data = nullptr;
|
||||
}
|
||||
|
||||
QLinuxFbScreen::~QLinuxFbScreen()
|
||||
@ -344,7 +344,7 @@ bool QLinuxFbScreen::initialize()
|
||||
|
||||
// mmap the framebuffer
|
||||
mMmap.size = finfo.smem_len;
|
||||
uchar *data = (unsigned char *)mmap(0, mMmap.size, PROT_READ | PROT_WRITE, MAP_SHARED, mFbFd, 0);
|
||||
uchar *data = (unsigned char *)mmap(nullptr, mMmap.size, PROT_READ | PROT_WRITE, MAP_SHARED, mFbFd, 0);
|
||||
if ((long)data == -1) {
|
||||
qErrnoWarning(errno, "Failed to mmap framebuffer");
|
||||
return false;
|
||||
|
@ -22,7 +22,7 @@ QPlatformIntegration *QMinimalIntegrationPlugin::create(const QString& system, c
|
||||
if (!system.compare("minimal"_L1, Qt::CaseInsensitive))
|
||||
return new QMinimalIntegration(paramList);
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -58,7 +58,7 @@ static inline unsigned parseOptions(const QStringList ¶mList)
|
||||
}
|
||||
|
||||
QMinimalIntegration::QMinimalIntegration(const QStringList ¶meters)
|
||||
: m_fontDatabase(0)
|
||||
: m_fontDatabase(nullptr)
|
||||
, m_options(parseOptions(parameters))
|
||||
{
|
||||
if (qEnvironmentVariableIsSet(debugBackingStoreEnvironmentVariable)
|
||||
|
@ -22,7 +22,7 @@ QPlatformIntegration* QMinimalEglIntegrationPlugin::create(const QString& system
|
||||
if (!system.compare("minimalegl"_L1, Qt::CaseInsensitive))
|
||||
return new QMinimalEglIntegration;
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -11,7 +11,7 @@ QT_BEGIN_NAMESPACE
|
||||
QMinimalEglBackingStore::QMinimalEglBackingStore(QWindow *window)
|
||||
: QPlatformBackingStore(window)
|
||||
, m_context(new QOpenGLContext)
|
||||
, m_device(0)
|
||||
, m_device(nullptr)
|
||||
{
|
||||
m_context->setFormat(window->requestedFormat());
|
||||
m_context->setScreen(window->screen());
|
||||
|
@ -41,8 +41,8 @@ public:
|
||||
QMinimalEglScreen::QMinimalEglScreen(EGLNativeDisplayType display)
|
||||
: m_depth(32)
|
||||
, m_format(QImage::Format_Invalid)
|
||||
, m_platformContext(0)
|
||||
, m_surface(0)
|
||||
, m_platformContext(nullptr)
|
||||
, m_surface(nullptr)
|
||||
{
|
||||
#ifdef QEGL_EXTRA_DEBUG
|
||||
qWarning("QEglScreen %p\n", this);
|
||||
@ -123,7 +123,7 @@ void QMinimalEglScreen::createAndSetPlatformContext()
|
||||
q_printEglConfig(m_dpy, config);
|
||||
#endif
|
||||
|
||||
m_surface = eglCreateWindowSurface(m_dpy, config, eglWindow, NULL);
|
||||
m_surface = eglCreateWindowSurface(m_dpy, config, eglWindow, nullptr);
|
||||
if (Q_UNLIKELY(m_surface == EGL_NO_SURFACE)) {
|
||||
qWarning("Could not create the egl surface: error = 0x%x\n", eglGetError());
|
||||
eglTerminate(m_dpy);
|
||||
@ -132,7 +132,7 @@ void QMinimalEglScreen::createAndSetPlatformContext()
|
||||
// qWarning("Created surface %dx%d\n", w, h);
|
||||
|
||||
#ifndef QT_NO_OPENGL
|
||||
QEGLPlatformContext *platformContext = new QMinimalEglContext(platformFormat, 0, m_dpy);
|
||||
QEGLPlatformContext *platformContext = new QMinimalEglContext(platformFormat, nullptr, m_dpy);
|
||||
m_platformContext = platformContext;
|
||||
#endif
|
||||
EGLint w,h; // screen size detection
|
||||
|
@ -189,7 +189,7 @@ QPixmap QOffscreenBackingStore::grabWindow(WId window, const QRect &rect) const
|
||||
|
||||
QOffscreenBackingStore *QOffscreenBackingStore::backingStoreForWinId(WId id)
|
||||
{
|
||||
return m_backingStoreForWinIdHash.value(id, 0);
|
||||
return m_backingStoreForWinIdHash.value(id, nullptr);
|
||||
}
|
||||
|
||||
void QOffscreenBackingStore::clearHash()
|
||||
|
@ -165,7 +165,7 @@ void QOffscreenWindow::setWindowState(Qt::WindowStates state)
|
||||
|
||||
QOffscreenWindow *QOffscreenWindow::windowForWinId(WId id)
|
||||
{
|
||||
return m_windowForWinIdHash.value(id, 0);
|
||||
return m_windowForWinIdHash.value(id, nullptr);
|
||||
}
|
||||
|
||||
Q_CONSTINIT QHash<WId, QOffscreenWindow *> QOffscreenWindow::m_windowForWinIdHash;
|
||||
|
@ -21,7 +21,7 @@ QPlatformIntegration *QVkKhrDisplayIntegrationPlugin::create(const QString &syst
|
||||
if (!system.compare("vkkhrdisplay"_L1, Qt::CaseInsensitive))
|
||||
return new QVkKhrDisplayIntegration(paramList);
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -141,12 +141,12 @@ void QXcbConnection::removeWindowEventListener(xcb_window_t id)
|
||||
|
||||
QXcbWindowEventListener *QXcbConnection::windowEventListenerFromId(xcb_window_t id)
|
||||
{
|
||||
return m_mapper.value(id, 0);
|
||||
return m_mapper.value(id, nullptr);
|
||||
}
|
||||
|
||||
QXcbWindow *QXcbConnection::platformWindowFromId(xcb_window_t id)
|
||||
{
|
||||
QXcbWindowEventListener *listener = m_mapper.value(id, 0);
|
||||
QXcbWindowEventListener *listener = m_mapper.value(id, nullptr);
|
||||
if (listener)
|
||||
return listener->toWindow();
|
||||
return nullptr;
|
||||
|
@ -158,7 +158,7 @@ void QSQLiteResultPrivate::finalize()
|
||||
return;
|
||||
|
||||
sqlite3_finalize(stmt);
|
||||
stmt = 0;
|
||||
stmt = nullptr;
|
||||
}
|
||||
|
||||
void QSQLiteResultPrivate::initColumns(bool emptyResultset)
|
||||
@ -765,7 +765,7 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
|
||||
|
||||
if (d->access) {
|
||||
sqlite3_close(d->access);
|
||||
d->access = 0;
|
||||
d->access = nullptr;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -788,7 +788,7 @@ void QSQLiteDriver::close()
|
||||
|
||||
if (res != SQLITE_OK)
|
||||
setLastError(qMakeError(d->access, tr("Error closing database"), QSqlError::ConnectionError, res));
|
||||
d->access = 0;
|
||||
d->access = nullptr;
|
||||
setOpen(false);
|
||||
setOpenError(false);
|
||||
}
|
||||
|
@ -31,7 +31,8 @@ QSqlDriver* QSQLiteDriverPlugin::create(const QString &name)
|
||||
QSQLiteDriver* driver = new QSQLiteDriver();
|
||||
return driver;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
Loading…
x
Reference in New Issue
Block a user