From 8a283514124aefaa4730bbefbe8e61984c639733 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Sat, 14 Nov 2026 17:35:06 -0300
Subject: Kamera: Replace NULL pointer constants with nullptr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Replace NULL pointer constants with nullptr.

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 kamera/kcontrol/kamera.cpp       |  2 +-
 kamera/kcontrol/kameradevice.cpp |  8 ++++----
 kamera/tdeioslave/kamera.cpp     | 34 +++++++++++++++++-----------------
 3 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/kamera/kcontrol/kamera.cpp b/kamera/kcontrol/kamera.cpp
index f3c89149..e1cb3e83 100644
--- a/kamera/kcontrol/kamera.cpp
+++ b/kamera/kcontrol/kamera.cpp
@@ -46,7 +46,7 @@ K_EXPORT_COMPONENT_FACTORY( kcm_kamera, KKameraConfigFactory( "kcmkamera" ) )
 
 // --------------- Camera control center module widget ---
 
-KKameraConfig *KKameraConfig::m_instance = NULL;
+KKameraConfig *KKameraConfig::m_instance = nullptr;
 
 KKameraConfig::KKameraConfig(TQWidget *parent, const char *name, const TQStringList &)
 	: TDECModule(KKameraConfigFactory::instance(), parent, name)
diff --git a/kamera/kcontrol/kameradevice.cpp b/kamera/kcontrol/kameradevice.cpp
index f1a4c295..bc266bbb 100644
--- a/kamera/kcontrol/kameradevice.cpp
+++ b/kamera/kcontrol/kameradevice.cpp
@@ -61,7 +61,7 @@ KCamera::KCamera(const TQString &name, const TQString &path)
 	m_name	= name;
 	m_model	= name;
 	m_path	= path;
-	m_camera = NULL;
+	m_camera = nullptr;
 }
 
 KCamera::~KCamera()
@@ -128,7 +128,7 @@ bool KCamera::initCamera()
 		result = gp_camera_init(m_camera, glob_context);
 		if (result != GP_OK) {
 			gp_camera_free(m_camera);
-			m_camera = NULL;
+			m_camera = nullptr;
 			emit error(
 				i18n("Unable to initialize camera. Check your port settings and camera connectivity and try again."),
 				gp_result_as_string(result));
@@ -239,7 +239,7 @@ void KCamera::invalidateCamera()
 {
 	if (m_camera) {
 		gp_camera_free(m_camera);
-		m_camera = NULL;
+		m_camera = nullptr;
 	}
 }
 
@@ -451,7 +451,7 @@ void KameraDeviceSelectDialog::slot_setModel(TQListViewItem *item)
 
 		// turn off any selected port
 		TQButton *selected = m_portSelectGroup->selected();
-		if(selected != NULL)
+		if(selected)
 			selected->toggle();
 
 	        // if there's only one available port type, make sure it's selected
diff --git a/kamera/tdeioslave/kamera.cpp b/kamera/tdeioslave/kamera.cpp
index 8810bcc5..70142a14 100644
--- a/kamera/tdeioslave/kamera.cpp
+++ b/kamera/tdeioslave/kamera.cpp
@@ -89,12 +89,12 @@ int kdemain(int argc, char **argv)
 
 KameraProtocol::KameraProtocol(const TQCString &pool, const TQCString &app)
 : SlaveBase("camera", pool, app),
-m_camera(NULL)
+m_camera(nullptr)
 {
 	// attempt to initialize libgphoto2 and chosen camera (requires locking)
 	// (will init m_camera, since the m_camera's configuration is empty)
 	m_camera = 0;
-	m_file = NULL;
+	m_file = nullptr;
 	m_config = new TDESimpleConfig(KProtocolInfo::config("camera"));
 	m_context = gp_context_new();
 	actiondone = true;
@@ -140,7 +140,7 @@ KameraProtocol::~KameraProtocol()
 	if(m_camera) {
 		closeCamera();
  		gp_camera_free(m_camera);
-		m_camera = NULL;
+		m_camera = nullptr;
 	}
 }
 
@@ -308,12 +308,12 @@ void KameraProtocol::get(const KURL &url)
 		case GP_ERROR_FILE_NOT_FOUND:
 		case GP_ERROR_DIRECTORY_NOT_FOUND:
 			gp_file_unref(m_file);
-			m_file = NULL;
+			m_file = nullptr;
 			error(TDEIO::ERR_DOES_NOT_EXIST, url.fileName());
 			return ;
 		default:
 			gp_file_unref(m_file);
-			m_file = NULL;
+			m_file = nullptr;
 			error(TDEIO::ERR_UNKNOWN, gp_result_as_string(gpr));
 			return;
 	}
@@ -333,7 +333,7 @@ void KameraProtocol::get(const KURL &url)
 	if (gpr != GP_OK) {
 		kdDebug(7123) << "get():: get_data_and_size failed." << endl;
 		gp_file_free(m_file);
-		m_file = NULL;
+		m_file = nullptr;
 		error(TDEIO::ERR_UNKNOWN, gp_result_as_string(gpr));
 		return;
 	}
@@ -365,7 +365,7 @@ void KameraProtocol::get(const KURL &url)
 
 	finished();
 	gp_file_unref(m_file); /* just unref, might be stored in fs */
-	m_file = NULL;
+	m_file = nullptr;
 }
 
 // The TDEIO slave "stat" function.
@@ -548,7 +548,7 @@ void KameraProtocol::listDir(const KURL &url)
 		TQMap<TQString,int>	modelcnt;
 
 		/* Autodetect USB cameras ... */
-		GPContext *glob_context = NULL;
+		GPContext *glob_context = nullptr;
 		int i, count;
 		CameraList *list;
 		CameraAbilitiesList *al;
@@ -688,11 +688,11 @@ void KameraProtocol::listDir(const KURL &url)
 	if (!url.path().compare("/")) {
 		CameraText text;
 		if (GP_OK == gp_camera_get_manual(m_camera, &text, m_context))
-			gp_list_append(specialList,"manual.txt",NULL);
+			gp_list_append(specialList,"manual.txt",nullptr);
 		if (GP_OK == gp_camera_get_about(m_camera, &text, m_context))
-			gp_list_append(specialList,"about.txt",NULL);
+			gp_list_append(specialList,"about.txt",nullptr);
 		if (GP_OK == gp_camera_get_summary(m_camera, &text, m_context))
-			gp_list_append(specialList,"summary.txt",NULL);
+			gp_list_append(specialList,"summary.txt",nullptr);
 	}
 
 	gpr = readCameraFolder(url.path(), dirList, fileList);
@@ -761,7 +761,7 @@ void KameraProtocol::setHost(const TQString& host, int port, const TQString& use
 			kdDebug(7123) << "Configuration change detected" << endl;
 			closeCamera();
 			gp_camera_unref(m_camera);
-			m_camera = NULL;
+			m_camera = nullptr;
 			infoMessage( i18n("Reinitializing camera") );
 		} else {
 			kdDebug(7123) << "Initializing camera" << endl;
@@ -810,7 +810,7 @@ void KameraProtocol::setHost(const TQString& host, int port, const TQString& use
 
 		// register gphoto2 callback functions
 		gp_context_set_status_func(m_context, frontendCameraStatus, this);
-		gp_context_set_progress_funcs(m_context, frontendProgressStart, frontendProgressUpdate, NULL, this);
+		gp_context_set_progress_funcs(m_context, frontendProgressStart, frontendProgressUpdate, nullptr, this);
 		// gp_camera_set_message_func(m_camera, ..., this)
 
 		// set model and port
@@ -890,7 +890,7 @@ void KameraProtocol::translateFileToUDS(UDSEntry &udsEntry, const CameraFileInfo
 		udsEntry.append(atom);
 	} else {
 		atom.m_uds = UDS_MODIFICATION_TIME;
-		atom.m_long = time(NULL); /* NOW */
+		atom.m_long = time(nullptr); /* NOW */
 		udsEntry.append(atom);
 	}
 
@@ -978,7 +978,7 @@ void frontendProgressUpdate(
 	// camera and pass it to TDEIO, to allow progressive display
 	// of the downloaded photo.
 
-	const char *fileData = NULL;
+	const char *fileData = nullptr;
 	long unsigned int fileSize = 0;
 
 	// This merely returns us a pointer to gphoto's internal data
@@ -1023,7 +1023,7 @@ unsigned int frontendProgressStart(
 # elif HAVE___VA_COPY
 	__va_copy(xvalist, args);
 # endif
-	int size=vsnprintf(NULL, 0, format, xvalist);
+	int size=vsnprintf(nullptr, 0, format, xvalist);
 	if(size<=0)
 		return GP_OK; // vsnprintf is broken, better don't do anything.
 
@@ -1076,7 +1076,7 @@ static void frontendCameraStatus(
 # elif HAVE___VA_COPY
 	__va_copy(xvalist, args);
 # endif
-	int size=vsnprintf(NULL, 0, format, xvalist);
+	int size=vsnprintf(nullptr, 0, format, xvalist);
 	if(size<=0)
 		return; // vsnprintf is broken, better don't do anything.
 
-- 
cgit v1.2.3

