https://github.com/kvirc/KVIrc/commit/5882316f4ccd20a768ae296e1d7efcdfed45d0a3

From 5882316f4ccd20a768ae296e1d7efcdfed45d0a3 Mon Sep 17 00:00:00 2001
From: ctrlaltca <ctrlaltca@gmail.com>
Date: Mon, 16 Jun 2025 22:22:29 +0200
Subject: [PATCH] KviControlCodes: fix compilation with Qt >= 6.9 (#2705)

* KviControlCodes: Qt >= 6.9's QChar removed implicit casts from ctors, add explicit cast to accommodate

* Update github action jobs
---
 src/kvirc/kvs/KviKvsCoreFunctions_af.cpp   | 2 +-
 src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp   | 4 ++--
 src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp   | 4 ++--
 src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp   | 2 +-
 src/kvirc/kvs/KviKvsReport.cpp             | 2 +-
 src/kvirc/kvs/object/KviKvsObject.cpp      | 2 +-
 src/kvirc/ui/KviInputEditor.cpp            | 2 +-
 src/kvirc/ui/KviIrcView.cpp                | 2 +-
 src/kvirc/ui/KviTextIconWindow.cpp         | 2 +-
 src/modules/regchan/libkviregchan.cpp      | 2 +-
 src/modules/spaste/SlowPasteController.cpp | 2 +-
 15 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp
index 07f84e9005..710b0ff062 100644
--- a/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp
+++ b/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp
@@ -349,7 +349,7 @@ namespace KviKvsCoreFunctions
 
 	KVSCF(b)
 	{
-		KVSCF_pRetBuffer->setString(QString(QChar(KviControlCodes::Bold)));
+		KVSCF_pRetBuffer->setString(QString(QChar((char)KviControlCodes::Bold)));
 		return true;
 	}
 
diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp
index f2259bbef9..989d8e9fb5 100644
--- a/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp
+++ b/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp
@@ -362,7 +362,7 @@ namespace KviKvsCoreFunctions
 
 	KVSCF(i)
 	{
-		KVSCF_pRetBuffer->setString(QString(QChar(KviControlCodes::Italic)));
+		KVSCF_pRetBuffer->setString(QString(QChar((char)KviControlCodes::Italic)));
 		return true;
 	}
 
@@ -869,7 +869,7 @@ namespace KviKvsCoreFunctions
 		KVSCF_PARAMETER("background", KVS_PT_UINT, KVS_PF_OPTIONAL, iBack)
 		KVSCF_PARAMETERS_END
 
-		QString szRet = QChar(KviControlCodes::Color);
+		QString szRet = QChar((char)KviControlCodes::Color);
 		if(KVSCF_pParams->count() > 0)
 		{
 			KviQString::appendFormatted(szRet, "%u", iFore);
diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp
index 1cf80c156b..0758fbcddf 100644
--- a/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp
+++ b/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp
@@ -378,7 +378,7 @@ namespace KviKvsCoreFunctions
 
 	KVSCF(o)
 	{
-		KVSCF_pRetBuffer->setString(QString(QChar(KviControlCodes::Reset)));
+		KVSCF_pRetBuffer->setString(QString(QChar((char)KviControlCodes::Reset)));
 		return true;
 	}
 
@@ -504,7 +504,7 @@ namespace KviKvsCoreFunctions
 
 	KVSCF(r)
 	{
-		KVSCF_pRetBuffer->setString(QString(QChar(KviControlCodes::Reverse)));
+		KVSCF_pRetBuffer->setString(QString(QChar((char)KviControlCodes::Reverse)));
 		return true;
 	}
 
diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp
index fb3b8fcea8..bb999c36d4 100644
--- a/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp
+++ b/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp
@@ -772,7 +772,7 @@ namespace KviKvsCoreFunctions
 
 	KVSCF(u)
 	{
-		KVSCF_pRetBuffer->setString(QString(QChar(KviControlCodes::Underline)));
+		KVSCF_pRetBuffer->setString(QString(QChar((char)KviControlCodes::Underline)));
 		return true;
 	}
 
diff --git a/src/kvirc/kvs/KviKvsReport.cpp b/src/kvirc/kvs/KviKvsReport.cpp
index 2161e232b8..7d9e87d903 100644
--- a/src/kvirc/kvs/KviKvsReport.cpp
+++ b/src/kvirc/kvs/KviKvsReport.cpp
@@ -135,7 +135,7 @@ void KviKvsReport::findLineColAndListing(const QChar * pBegin, const QChar * pPo
 		pBegin++;
 
 	{
-		QString * pListingStr = new QString(QString("%1%2 ").arg(QChar(KviControlCodes::Bold)).arg(iLine));
+		QString * pListingStr = new QString(QString("%1%2 ").arg(QChar((char)KviControlCodes::Bold)).arg(iLine));
 		*pListingStr += QString(pLineBegin, pBegin - pLineBegin);
 		pListingStr->replace("\n", "");
 		pListing->append(pListingStr);
diff --git a/src/kvirc/kvs/object/KviKvsObject.cpp b/src/kvirc/kvs/object/KviKvsObject.cpp
index 7d488980c3..7c48cced4e 100644
--- a/src/kvirc/kvs/object/KviKvsObject.cpp
+++ b/src/kvirc/kvs/object/KviKvsObject.cpp
@@ -1120,7 +1120,7 @@ bool KviKvsObject::function_listProperties(KviKvsObjectFunctionCall * c)
 				szOut = QString("%1, %2").arg(szName, szType);
 			else
 			{
-				szOut = QString(__tr2qs_ctx("Property: %1%2%3, type %4", "kvs")).arg(QChar(KviControlCodes::Bold)).arg(szName).arg(QChar(KviControlCodes::Bold)).arg(szType);
+				szOut = QString(__tr2qs_ctx("Property: %1%2%3, type %4", "kvs")).arg(QChar((char)KviControlCodes::Bold)).arg(szName).arg(QChar((char)KviControlCodes::Bold)).arg(szType);
 				szOut.prepend(" ");
 			}
 
diff --git a/src/kvirc/ui/KviInputEditor.cpp b/src/kvirc/ui/KviInputEditor.cpp
index 3bd6925b0f..46134cd83e 100644
--- a/src/kvirc/ui/KviInputEditor.cpp
+++ b/src/kvirc/ui/KviInputEditor.cpp
@@ -1500,7 +1500,7 @@ void KviInputEditor::insertText(const QString & szTxt)
 			if(iIdx != -1)
 			{
 				szBlock = szText.left(iIdx);
-				//else szBlock = QChar(KviControlCodes::Reset);
+				//else szBlock = QChar((char)KviControlCodes::Reset);
 				szText.remove(0, iIdx + 1);
 			}
 			else
diff --git a/src/kvirc/ui/KviIrcView.cpp b/src/kvirc/ui/KviIrcView.cpp
index 8ca9eec9a5..b49a8b8f56 100644
--- a/src/kvirc/ui/KviIrcView.cpp
+++ b/src/kvirc/ui/KviIrcView.cpp
@@ -3015,7 +3015,7 @@ KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos, int yPos, QRect
 													szLink.append(QChar(l->pBlocks[iEndOfLInk].pChunk->type));
 													break;
 												case KviControlCodes::Color:
-													szLink.append(QChar(KviControlCodes::Color));
+													szLink.append(QChar((char)KviControlCodes::Color));
 													if(l->pBlocks[iEndOfLInk].pChunk->colors.fore != KviControlCodes::NoChange)
 													{
 														szLink.append(QString("%1").arg((int)(l->pBlocks[iEndOfLInk].pChunk->colors.fore)));
diff --git a/src/kvirc/ui/KviTextIconWindow.cpp b/src/kvirc/ui/KviTextIconWindow.cpp
index 3ce4845a3a..6c88eaa112 100644
--- a/src/kvirc/ui/KviTextIconWindow.cpp
+++ b/src/kvirc/ui/KviTextIconWindow.cpp
@@ -182,7 +182,7 @@ void KviTextIconWindow::autoSelectBestMatchBasedOnOwnerText()
 		return;
 
 	QString szText = pOwner->textBeforeCursor();
-	int idx = szText.lastIndexOf(QChar(KviControlCodes::Icon));
+	int idx = szText.lastIndexOf(QChar((char)KviControlCodes::Icon));
 	if(idx < 0)
 		return;
 
diff --git a/src/modules/regchan/libkviregchan.cpp b/src/modules/regchan/libkviregchan.cpp
index cefc0b9dac..1bd27b48c8 100644
--- a/src/modules/regchan/libkviregchan.cpp
+++ b/src/modules/regchan/libkviregchan.cpp
@@ -223,7 +223,7 @@ static bool regchan_kvs_cmd_showlist(KviKvsModuleCommandCall * c)
 			c->window()->outputNoFmt(
 			    KVI_OUT_SYSTEMMESSAGE,
 			    __tr2qs_ctx("Channel: %1%2@%3", "register")
-			        .arg(QChar(KviControlCodes::Bold))
+			        .arg(QChar((char)KviControlCodes::Bold))
 			        .arg(ch->name())
 			        .arg(ch->netMask()));
 
diff --git a/src/modules/spaste/SlowPasteController.cpp b/src/modules/spaste/SlowPasteController.cpp
index f60e84396d..60c66dae25 100644
--- a/src/modules/spaste/SlowPasteController.cpp
+++ b/src/modules/spaste/SlowPasteController.cpp
@@ -111,7 +111,7 @@ void SlowPasteController::pasteFile()
 	{
 		line = data;
 		if(line.isEmpty())
-			line = QChar(KviControlCodes::Reset);
+			line = QChar((char)KviControlCodes::Reset);
 
 		line.replace('\t', QString(KVI_OPTION_UINT(KviOption_uintSpacesToExpandTabulationInput), ' ')); //expand tabs to spaces
 

