Commit fa6bf0ea authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Apply modernize-use-nullptr

parent ea9f0805
......@@ -94,7 +94,7 @@ MainWindow::MainWindow(QWidget* parent)
m_notifierItem = new KStatusNotifierItem(this);
m_firstRunDialog = NULL;
m_firstRunDialog = nullptr;
m_isFullscreen = false;
#if HAVE_X11
......@@ -105,8 +105,8 @@ MainWindow::MainWindow(QWidget* parent)
#endif
m_isWayland = KWindowSystem::isPlatformWayland();
#if HAVE_KWAYLAND
m_plasmaShell = Q_NULLPTR;
m_plasmaShellSurface = Q_NULLPTR;
m_plasmaShell = nullptr;
m_plasmaShellSurface = nullptr;
initWayland();
#endif
......@@ -651,13 +651,13 @@ void MainWindow::handleSwitchToAction()
void MainWindow::setupMenu()
{
m_menu->insertSection(0, xi18nc("@title:menu", "Help"));
m_menu->insertSection(nullptr, xi18nc("@title:menu", "Help"));
m_menu->addAction(actionCollection()->action(QLatin1String(KStandardAction::name(KStandardAction::WhatsThis))));
m_menu->addAction(actionCollection()->action(QLatin1String(KStandardAction::name(KStandardAction::ReportBug))));
m_menu->addAction(actionCollection()->action(QLatin1String(KStandardAction::name(KStandardAction::AboutApp))));
m_menu->addAction(actionCollection()->action(QLatin1String(KStandardAction::name(KStandardAction::AboutKDE))));
m_menu->insertSection(0, xi18nc("@title:menu", "Quick Options"));
m_menu->insertSection(nullptr, xi18nc("@title:menu", "Quick Options"));
m_menu->addAction(actionCollection()->action(QStringLiteral("view-full-screen")));
m_menu->addAction(actionCollection()->action(QStringLiteral("keep-open")));
......@@ -676,7 +676,7 @@ void MainWindow::setupMenu()
m_windowHeightMenu->setTitle(xi18nc("@title:menu", "Height"));
m_menu->addMenu(m_windowHeightMenu);
m_menu->insertSection(0, xi18nc("@title:menu", "Settings"));
m_menu->insertSection(nullptr, xi18nc("@title:menu", "Settings"));
m_menu->addAction(actionCollection()->action(QStringLiteral("manage-profiles")));
m_menu->addAction(actionCollection()->action(QLatin1String(KStandardAction::name(KStandardAction::KeyBindings))));
m_menu->addAction(actionCollection()->action(QLatin1String(KStandardAction::name(KStandardAction::ConfigureNotifications))));
......@@ -717,7 +717,7 @@ void MainWindow::updateWindowSizeMenus()
void MainWindow::updateWindowWidthMenu()
{
QAction* action = 0;
QAction* action = nullptr;
if (m_windowWidthMenu->isEmpty())
{
......@@ -744,7 +744,7 @@ void MainWindow::updateWindowWidthMenu()
void MainWindow::updateWindowHeightMenu()
{
QAction* action = 0;
QAction* action = nullptr;
if (m_windowHeightMenu->isEmpty())
{
......@@ -1072,7 +1072,7 @@ void MainWindow::wmActiveWindowChanged()
return;
}
KWindowInfo info(KWindowSystem::activeWindow(), 0, NET::WM2TransientFor);
KWindowInfo info(KWindowSystem::activeWindow(), {}, NET::WM2TransientFor);
if (info.valid() && info.transientFor() == winId()) {
return;
......@@ -1239,7 +1239,7 @@ void MainWindow::kwinAssistToggleWindowState(bool visible)
int count;
Atom* list = XListProperties(display, DefaultRootWindow(display), &count);
if (list != NULL)
if (list != nullptr)
{
gotEffect = (std::find(list, list + count, atom) != list + count);
......@@ -1420,7 +1420,7 @@ void MainWindow::sharedAfterHideWindow()
#if HAVE_KWAYLAND
delete m_plasmaShellSurface;
m_plasmaShellSurface = Q_NULLPTR;
m_plasmaShellSurface = nullptr;
#endif
emit windowClosed();
......
......@@ -415,7 +415,7 @@ void Session::cleanup()
void Session::prepareShutdown()
{
m_baseSplitter = NULL;
m_baseSplitter = nullptr;
deleteLater();
}
......@@ -440,7 +440,7 @@ bool Session::hasTerminal(int terminalId)
Terminal* Session::getTerminal(int terminalId)
{
if (!m_terminals.contains(terminalId)) return 0;
if (!m_terminals.contains(terminalId)) return nullptr;
return m_terminals.value(terminalId);
}
......
......@@ -52,7 +52,7 @@ SessionStack::~SessionStack()
int SessionStack::addSessionImpl(Session::SessionType type)
{
Session* currentSession = m_sessions.value(activeSessionId());
Terminal* currentTerminal = currentSession ? currentSession->getTerminal(currentSession->activeTerminalId()) : NULL;
Terminal* currentTerminal = currentSession ? currentSession->getTerminal(currentSession->activeTerminalId()) : nullptr;
QString workingDir = currentTerminal ? currentTerminal->currentWorkingDirectory() : QString();
Session* session = new Session(workingDir, type, this);
......@@ -604,7 +604,7 @@ bool SessionStack::requiresVisualEventOverlay()
void SessionStack::handleTerminalHighlightRequest(int terminalId)
{
Terminal* terminal = 0;
Terminal* terminal = nullptr;
QHashIterator<int, Session*> it(m_sessions);
......
......@@ -61,7 +61,7 @@ TabBar::TabBar(MainWindow* mainWindow) : QWidget(mainWindow)
m_mousePressed = false;
m_mousePressedIndex = -1;
m_dropIndicator = 0;
m_dropIndicator = nullptr;
m_mainWindow = mainWindow;
......
......@@ -51,20 +51,20 @@ Terminal::Terminal(const QString& workingDir, QWidget* parent) : QObject(parent)
m_monitorActivityEnabled = false;
m_monitorSilenceEnabled = false;
m_part = NULL;
m_terminalInterface = NULL;
m_partWidget = NULL;
m_terminalWidget = NULL;
m_part = nullptr;
m_terminalInterface = nullptr;
m_partWidget = nullptr;
m_terminalWidget = nullptr;
m_parentSplitter = parent;
KPluginFactory* factory = 0;
KPluginFactory* factory = nullptr;
KService::Ptr service = KService::serviceByDesktopName(QStringLiteral("konsolepart"));
if( service )
{
factory = KPluginLoader(service->library()).factory();
}
m_part = factory ? (factory->create<KParts::Part>(parent)) : 0;
m_part = factory ? (factory->create<KParts::Part>(parent)) : nullptr;
if (m_part)
{
......@@ -196,7 +196,7 @@ void Terminal::disableOffendingPartActions()
if (actionCollection)
{
QAction* action = 0;
QAction* action = nullptr;
action = actionCollection->action(QStringLiteral("next-view"));
if (action) action->setEnabled(false);
......
Markdown is supported
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