From 16ff2f5cbf0108b905cea42955664cac1fb2b500 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sun, 20 Sep 2026 15:35:46 -0300
Subject: Replace zero pointer constants with nullptr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 kshutdown/actions.cpp         |  8 ++++----
 kshutdown/appobserver.cpp     |  2 +-
 kshutdown/configuration.cpp   |  2 +-
 kshutdown/confirmation.cpp    |  2 +-
 kshutdown/extras.cpp          | 10 +++++-----
 kshutdown/extras.h            |  2 +-
 kshutdown/links.cpp           |  4 ++--
 kshutdown/main.cpp            | 42 +++++++++++++++++++++---------------------
 kshutdown/miscutils.cpp       |  4 ++--
 kshutdown/miscutils.h         |  2 +-
 kshutdown/mmainwindow.cpp     |  8 ++++----
 kshutdown/mmessagedialog.cpp  |  6 +++---
 kshutdown/msettingsdialog.cpp |  4 ++--
 kshutdown/msettingsdialog.h   |  4 ++--
 kshutdown/mstatstab.cpp       |  2 +-
 kshutdown/msystemtray.cpp     |  8 ++++----
 kshutdown/progressbar.cpp     |  4 ++--
 kshutdown/progressbar.h       |  2 +-
 kshutdownlockout/lockout.cpp  |  6 +++---
 kshutdownlockout/lockout.h    |  2 +-
 20 files changed, 62 insertions(+), 62 deletions(-)

diff --git a/kshutdown/actions.cpp b/kshutdown/actions.cpp
index b786f49..77f448c 100644
--- a/kshutdown/actions.cpp
+++ b/kshutdown/actions.cpp
@@ -36,7 +36,7 @@
 #include <tdelocale.h>
 #include <tdemessagebox.h>
 
-Action *Action::_instance = 0;
+Action *Action::_instance = nullptr;
 
 Action::~Action()
 {
@@ -80,7 +80,7 @@ bool Action::endSession(const TDEApplication::ShutdownType type, const Type acti
 	)
 	{
 		KMessageBox::error(
-			0,
+			nullptr,
 			i18n(
 				"Could not logout properly.\n" \
 				"The session manager cannot be contacted."
@@ -359,7 +359,7 @@ bool Action::isEnabled(const Type action)
 void Action::totalExec()
 {
 	if (!execCurrent())
-		KMessageBox::sorry(0, i18n("Action failed! (%1)").arg(_current));
+		KMessageBox::sorry(nullptr, i18n("Action failed! (%1)").arg(_current));
 }
 
 Action::Action()
@@ -403,7 +403,7 @@ bool Action::lockScreen() {
 			kdesktop.sprintf("kdesktop-screen-%d", kshutdown_screen_number);
 
 		if (!tdeApp->dcopClient()->send(kdesktop, "KScreensaverIface", "lock()", "")) {
-			KMessageBox::error(0, i18n("kdesktop: DCOP call failed!"));
+			KMessageBox::error(nullptr, i18n("kdesktop: DCOP call failed!"));
 
 			return false; // error
 		}
diff --git a/kshutdown/appobserver.cpp b/kshutdown/appobserver.cpp
index fa9252e..c924fbc 100644
--- a/kshutdown/appobserver.cpp
+++ b/kshutdown/appobserver.cpp
@@ -45,7 +45,7 @@
 AppObserver::AppObserver(TQWidget *parent)
 	: TQHBox(parent),
 	_processesMap(new TQMap<int, Process>()),
-	_process(0),
+	_process(nullptr),
 	_buf(TQString::null)
 {
 	setName("AppObserver");
diff --git a/kshutdown/configuration.cpp b/kshutdown/configuration.cpp
index e632d76..43307fa 100644
--- a/kshutdown/configuration.cpp
+++ b/kshutdown/configuration.cpp
@@ -22,7 +22,7 @@
 #include "mmainwindow.h"
 #include "msystemtray.h"
 
-Config *Config::_instance = 0;
+Config *Config::_instance = nullptr;
 
 // public
 
diff --git a/kshutdown/confirmation.cpp b/kshutdown/confirmation.cpp
index c7ffef1..8aa6952 100644
--- a/kshutdown/confirmation.cpp
+++ b/kshutdown/confirmation.cpp
@@ -41,7 +41,7 @@ bool Confirmation::confirm(const Action::Type action, const TQString &delay)
 	else if (MSystemTray::isInstance() && ks_tray->isVisible())
 		parent = ks_tray;
 	else
-		parent = 0;
+		parent = nullptr;
 
 	/*
 	TQWidget *background = new TQWidget(0, "TQWidget::background", TQt::WType_Popup);
diff --git a/kshutdown/extras.cpp b/kshutdown/extras.cpp
index 82448e8..ced7ee5 100644
--- a/kshutdown/extras.cpp
+++ b/kshutdown/extras.cpp
@@ -37,7 +37,7 @@
 #include <tdestandarddirs.h>
 #include <kstringhandler.h>
 
-Extras *Extras::_instance = 0;
+Extras *Extras::_instance = nullptr;
 
 // public
 
@@ -105,9 +105,9 @@ void Extras::setAction(const TQString &fileToExecute, const TQString &descriptio
 
 Extras::Extras()
 	: TQObject(ks_main, "Extras"),
-	_idToFileMap(0) // initialized in getIdToFileMap()
+	_idToFileMap(nullptr) // initialized in getIdToFileMap()
 {
-	_menu = new TDEPopupMenu(0, "TDEPopupMenu::_menu");
+	_menu = new TDEPopupMenu(nullptr, "TDEPopupMenu::_menu");
 	connect(_menu, TQ_SIGNAL(aboutToShow()), TQ_SLOT(slotShowMenu()));
 	connect(_menu, TQ_SIGNAL(activated(int)), TQ_SLOT(slotActivated(int)));
 }
@@ -254,7 +254,7 @@ TQMap<int, TQString> *Extras::getIdToFileMap()
 void Extras::slotModify()
 {
 	KMessageBox::information(
-		0,
+		nullptr,
 		MiscUtils::HTML(
 			i18n("Use context menu to add/edit/remove links.") +
 			"<ul>" +
@@ -280,7 +280,7 @@ void Extras::slotActivated(int id)
 	{
 		setAction(TQString::null, TQString::null);
 		KMessageBox::error(
-			0,
+			nullptr,
 			"Internal error!\nSelected menu item is broken.",
 			i18n("Extras")
 		);
diff --git a/kshutdown/extras.h b/kshutdown/extras.h
index 8ae8556..451bbb5 100644
--- a/kshutdown/extras.h
+++ b/kshutdown/extras.h
@@ -77,7 +77,7 @@ public:
 		return _instance;
 	}
 	
-	void setAction(const TQString &fileToExecute, const TQString &description, TQIconSet *icon = 0);
+	void setAction(const TQString &fileToExecute, const TQString &description, TQIconSet *icon = nullptr);
 private:
 	static Extras *_instance;
 	TDEPopupMenu *_menu;
diff --git a/kshutdown/links.cpp b/kshutdown/links.cpp
index df35fae..a0a0898 100644
--- a/kshutdown/links.cpp
+++ b/kshutdown/links.cpp
@@ -102,7 +102,7 @@ void Links::createLink(const TQString &path, const TQString &command, const TQSt
 	if (!TQFile::exists(path))
 	{
 		KMessageBox::error(
-			0,
+			nullptr,
 			MiscUtils::HTML(i18n("Could not create file <b>%1</b>!").arg(path))
 		);
 	}
@@ -113,7 +113,7 @@ void Links::removeLink(const TQString &path)
 	if (TQFile::exists(path) && !TQFile::remove(path))
 	{
 		KMessageBox::error(
-			0,
+			nullptr,
 			MiscUtils::HTML(i18n("Could not remove file <b>%1</b>!").arg(path))
 		);
 	}
diff --git a/kshutdown/main.cpp b/kshutdown/main.cpp
index 2512427..63e85c1 100644
--- a/kshutdown/main.cpp
+++ b/kshutdown/main.cpp
@@ -50,27 +50,27 @@ TDEAboutData aboutData(
 
 static TDECmdLineOptions options[] =
 {
-	{ "s", 0, 0 },
-	{ "shutdown", I18N_NOOP("Turn off computer"), 0 },
-	{ "h", 0, 0 },
-	{ "halt", I18N_NOOP("Turn off computer"), 0 },
-	{ "r", 0, 0 },
-	{ "reboot", I18N_NOOP("Restart computer"), 0 },
-	{ "k", 0, 0 },
-	{ "lock", I18N_NOOP("Lock session"), 0 },
-	{ "l", 0, 0 },
-	{ "logout", I18N_NOOP("End current session"), 0 },
-	{ "e", 0, 0 },
-	{ "extra <file>", I18N_NOOP("Execute \"Extras\" command (.desktop file)"), 0 },
-	{ "confirm", I18N_NOOP("Confirm command line action"), 0 },
-	{ "standard", I18N_NOOP("Show standard logout dialog"), 0 },
-	{ "c", 0, 0 },
-	{ "cancel", I18N_NOOP("Cancel an active action"), 0 },
-	{ "init", I18N_NOOP("Don't show window at startup"), 0 },
-	{ "test", I18N_NOOP("Enable test mode"), 0 },
-	{ "default", I18N_NOOP("Disable test mode"), 0 },
+	{ "s", nullptr, nullptr },
+	{ "shutdown", I18N_NOOP("Turn off computer"), nullptr },
+	{ "h", nullptr, nullptr },
+	{ "halt", I18N_NOOP("Turn off computer"), nullptr },
+	{ "r", nullptr, nullptr },
+	{ "reboot", I18N_NOOP("Restart computer"), nullptr },
+	{ "k", nullptr, nullptr },
+	{ "lock", I18N_NOOP("Lock session"), nullptr },
+	{ "l", nullptr, nullptr },
+	{ "logout", I18N_NOOP("End current session"), nullptr },
+	{ "e", nullptr, nullptr },
+	{ "extra <file>", I18N_NOOP("Execute \"Extras\" command (.desktop file)"), nullptr },
+	{ "confirm", I18N_NOOP("Confirm command line action"), nullptr },
+	{ "standard", I18N_NOOP("Show standard logout dialog"), nullptr },
+	{ "c", nullptr, nullptr },
+	{ "cancel", I18N_NOOP("Cancel an active action"), nullptr },
+	{ "init", I18N_NOOP("Don't show window at startup"), nullptr },
+	{ "test", I18N_NOOP("Enable test mode"), nullptr },
+	{ "default", I18N_NOOP("Disable test mode"), nullptr },
 	{ "+[time]", I18N_NOOP("Time; Examples: 01:30 - absolute time (HH:MM); " \
-		"10 - number of minutes to wait from now"), 0 },
+		"10 - number of minutes to wait from now"), nullptr },
 	TDECmdLineLastOption
 };
 
@@ -241,7 +241,7 @@ int KShutDownApplication::doProcessArgs(const TDECmdLineArgs *args) {
 				}
 				if (!ok || !dt.isValid() || dt.isNull()) {
 					KMessageBox::error(
-						0,
+						nullptr,
 						MiscUtils::HTML(i18n("Invalid time: <b>%1</b>").arg(timeArg))
 					);
 				}
diff --git a/kshutdown/miscutils.cpp b/kshutdown/miscutils.cpp
index c2b419d..6e1fa58 100644
--- a/kshutdown/miscutils.cpp
+++ b/kshutdown/miscutils.cpp
@@ -130,7 +130,7 @@ void MiscUtils::passiveMessage(const TQString &text, TQWidget *parent) {
 		SmallIcon("kshutdown"),
 		parent
 	);
-	if (parent == 0)
+	if (parent == nullptr)
 		popup->move(0, 0);
 }
 
@@ -228,7 +228,7 @@ void MiscUtils::showRunErrorMessage(const TQString &command)
 
 void MiscUtils::showTestMessage(const TQString &message)
 {
-	KMessageBox::information(0, message, i18n("Test"));
+	KMessageBox::information(nullptr, message, i18n("Test"));
 }
 
 // private
diff --git a/kshutdown/miscutils.h b/kshutdown/miscutils.h
index 2269ccc..b194806 100644
--- a/kshutdown/miscutils.h
+++ b/kshutdown/miscutils.h
@@ -83,7 +83,7 @@ public:
 	 */
 	static void notifyUser(const int secs);
 
-	static void passiveMessage(const TQString &text, TQWidget *parent = 0);
+	static void passiveMessage(const TQString &text, TQWidget *parent = nullptr);
 
 	static void plug(const TDEAction *action, KPushButton *pushButton);
 
diff --git a/kshutdown/mmainwindow.cpp b/kshutdown/mmainwindow.cpp
index 9d64aab..4e079c6 100644
--- a/kshutdown/mmainwindow.cpp
+++ b/kshutdown/mmainwindow.cpp
@@ -56,12 +56,12 @@
 #include <tdedesktopfile.h>
 #include <kmimetype.h>
 
-MMainWindow *MMainWindow::_instance = 0;
+MMainWindow *MMainWindow::_instance = nullptr;
 
 MMainWindow::MMainWindow()
 	// Iface
 	: DCOPObject("KShutdownIface"),
-	TDEMainWindow(0, "MMainWindow", WStyle_ContextHelp),
+	TDEMainWindow(nullptr, "MMainWindow", WStyle_ContextHelp),
 	_showMinimizeInfo(true),
 	_oldSec(-1),
 	_delayType(DelayType_Now)
@@ -297,7 +297,7 @@ void MMainWindow::start(const bool confirmation) {
 
 		cancel();
 		KMessageBox::error(
-			0,
+			nullptr,
 			MiscUtils::HTML(
 				i18n("Selected date/time is earlier than current date/time!") +
 				"<br><br>" +
@@ -840,7 +840,7 @@ void MMainWindow::slotDelayTypeChange(int index) {
 
 void MMainWindow::slotConfigureGlobalShortcuts() {
 	if (KKeyDialog::configure(_globalAccel, false, this)) {
-		_globalAccel->writeSettings(0, true);
+		_globalAccel->writeSettings(nullptr, true);
 		_globalAccel->updateConnections();
 	}
 }
diff --git a/kshutdown/mmessagedialog.cpp b/kshutdown/mmessagedialog.cpp
index 9e9c318..2164d27 100644
--- a/kshutdown/mmessagedialog.cpp
+++ b/kshutdown/mmessagedialog.cpp
@@ -37,7 +37,7 @@
 
 // public
 
-MMessageDialog *MMessageDialog::_instance = 0;
+MMessageDialog *MMessageDialog::_instance = nullptr;
 
 MMessageDialog::MMessageDialog(const int delay, const Action::Type actionToExecute, const TQString &text)
 	: KDialog(ks_main, "MMessageDialog", true),
@@ -124,7 +124,7 @@ void MMessageDialog::cancel() {
 		// kdDebug() << "MMessageDialog::cancel()" << endl;
 		_instance->slotReject();
 		delete _instance;
-		_instance = 0;
+		_instance = nullptr;
 	}
 }
 
@@ -139,7 +139,7 @@ bool MMessageDialog::show(const int timeout) {
 	);
 	bool result = (_instance->exec() == Accepted);
 	delete _instance;
-	_instance = 0;
+	_instance = nullptr;
 
 	// kdDebug() << "result = " << result << endl;
 
diff --git a/kshutdown/msettingsdialog.cpp b/kshutdown/msettingsdialog.cpp
index f21c91a..59f3b7d 100644
--- a/kshutdown/msettingsdialog.cpp
+++ b/kshutdown/msettingsdialog.cpp
@@ -54,7 +54,7 @@
 #include <kurllabel.h>
 
 int MSettingsDialog::_lastPage = 0;
-MSettingsDialog *MSettingsDialog::_instance = 0;
+MSettingsDialog *MSettingsDialog::_instance = nullptr;
 
 // public
 
@@ -592,7 +592,7 @@ void MSettingsDialog::slotDefault()
 			return;
 
 		if (KMessageBox::warningYesNo(
-			0,
+			nullptr,
 			i18n("Restore default settings for this page?"),
 			caption()) != KMessageBox::Yes
 		)
diff --git a/kshutdown/msettingsdialog.h b/kshutdown/msettingsdialog.h
index b6e3c05..4b8306d 100644
--- a/kshutdown/msettingsdialog.h
+++ b/kshutdown/msettingsdialog.h
@@ -53,7 +53,7 @@ public:
 	inline static void freeInstance() {
 		if (_instance) {
 			delete _instance;
-			_instance = 0;
+			_instance = nullptr;
 		}
 	}
 
@@ -95,7 +95,7 @@ private:
 	 * @param page A dialog page
 	 * @param pageLayout A dialog page layout
 	 */
-	bool disabledByAdmin(const TQString &key, TQFrame *page = 0, TQBoxLayout *pageLayout = 0) const;
+	bool disabledByAdmin(const TQString &key, TQFrame *page = nullptr, TQBoxLayout *pageLayout = nullptr) const;
 
 	void initActionsPage();
 	void initAdvancedPage();
diff --git a/kshutdown/mstatstab.cpp b/kshutdown/mstatstab.cpp
index 8305fbf..1148832 100644
--- a/kshutdown/mstatstab.cpp
+++ b/kshutdown/mstatstab.cpp
@@ -36,7 +36,7 @@
 
 // public
 
-MStatsTab *MStatsTab::_instance = 0;
+MStatsTab *MStatsTab::_instance = nullptr;
 
 MStatsTab::MStatsTab()
 	: KDialogBase(
diff --git a/kshutdown/msystemtray.cpp b/kshutdown/msystemtray.cpp
index 35bb06e..2838c2d 100644
--- a/kshutdown/msystemtray.cpp
+++ b/kshutdown/msystemtray.cpp
@@ -40,7 +40,7 @@ const int KS_TRAY_FADE_TIMEOUT = 50;
 const TQColor KS_TRAY_FADE_COLOR = TQt::yellow;
 
 MSystemTray::Mode MSystemTray::_mode = Always;
-MSystemTray *MSystemTray::_instance = 0;
+MSystemTray *MSystemTray::_instance = nullptr;
 
 // public
 
@@ -100,13 +100,13 @@ void MSystemTray::setMode(const Mode mode)
 			else
 			{
 				delete _instance;
-				_instance = 0;
+				_instance = nullptr;
 				MiscUtils::setAutostart(false);
 			}
 			break;
 		case Never:
 			delete _instance;
-			_instance = 0;
+			_instance = nullptr;
 			MiscUtils::setAutostart(false);
 			break;
 	}
@@ -132,7 +132,7 @@ MSystemTray::MSystemTray()
 	_incFade(true),
 	_fadeValue(0.0f),
 	_flashCount(0),
-	_saveIcon(0)
+	_saveIcon(nullptr)
 {
 	setPixmap(SmallIcon("system-log-out", TDEIcon::SizeSmallMedium)); // 22x22
 
diff --git a/kshutdown/progressbar.cpp b/kshutdown/progressbar.cpp
index e5f563d..626c352 100644
--- a/kshutdown/progressbar.cpp
+++ b/kshutdown/progressbar.cpp
@@ -31,7 +31,7 @@
 
 // static
 
-ProgressBar *ProgressBar::_instance = 0;
+ProgressBar *ProgressBar::_instance = nullptr;
 
 // public
 
@@ -127,7 +127,7 @@ void ProgressBar::paintEvent(TQPaintEvent *) {
 
 ProgressBar::ProgressBar()
 	: TQWidget(
-		0,
+		nullptr,
 		"ProgressBar",
 		WStyle_NoBorder | WStyle_StaysOnTop | WType_TopLevel | WX11BypassWM
 	),
diff --git a/kshutdown/progressbar.h b/kshutdown/progressbar.h
index 5fed507..a02bebe 100644
--- a/kshutdown/progressbar.h
+++ b/kshutdown/progressbar.h
@@ -32,7 +32,7 @@ public:
 	inline static void freeInstance() {
 		if (_instance) {
 			delete _instance;
-			_instance = 0;
+			_instance = nullptr;
 		}
 	}
 	inline static ProgressBar *getInstance() {
diff --git a/kshutdownlockout/lockout.cpp b/kshutdownlockout/lockout.cpp
index b7dd567..d8268b9 100644
--- a/kshutdownlockout/lockout.cpp
+++ b/kshutdownlockout/lockout.cpp
@@ -140,14 +140,14 @@ void Lockout::callKShutDown(const TQCString &function) {
 		// run KShutDown
 		TDEProcess *p = new TDEProcess();
 		if (!p) {
-			KMessageBox::error(0, i18n("Could not run KShutDown!"));
+			KMessageBox::error(nullptr, i18n("Could not run KShutDown!"));
 
 			return;
 		}
 		*p << "kshutdown";
 		*p << "--init";
 		if (!p->start(TDEProcess::Block))
-			KMessageBox::error(0, i18n("Could not run KShutDown!"));
+			KMessageBox::error(nullptr, i18n("Could not run KShutDown!"));
 		delete p;
 	}
 	client->send("kshutdown", "KShutdownIface", function, "");
@@ -192,7 +192,7 @@ void Lockout::initActions() {
 void Lockout::runCommand(const TQString &command) {
 	pid_t pid = KRun::run(command, KURL::List());
 	if (!pid)
-		KMessageBox::error(0, i18n("Could not run KShutDown!"));
+		KMessageBox::error(nullptr, i18n("Could not run KShutDown!"));
 }
 
 // private slots
diff --git a/kshutdownlockout/lockout.h b/kshutdownlockout/lockout.h
index a494b47..b914054 100644
--- a/kshutdownlockout/lockout.h
+++ b/kshutdownlockout/lockout.h
@@ -18,7 +18,7 @@ public:
 	 * @param configFile A configuration file (provided by the Kicker)
 	 * @param parent A parent widget
 	 */
-	Lockout(const TQString& configFile, TQWidget *parent = 0);
+	Lockout(const TQString& configFile, TQWidget *parent = nullptr);
 
 	/**
 	 * Destructor.
-- 
cgit v1.2.3

