summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-05-26 01:30:17 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-05-26 15:03:08 +0200
commit5cad60063799de1846011f1fd5c6023166df9d28 (patch)
tree90c4487ec8629b334332dff9757b6bbe1210ce4f
parent78178b45c79a3fb909e9214664dc7dc1c577bed9 (diff)
downloadkscope-5cad60063799de1846011f1fd5c6023166df9d28.tar.gz
kscope-5cad60063799de1846011f1fd5c6023166df9d28.zip
Fix missing or incorrect ascii conversions when retrieving process output.
Added controlled conversions to char* instead of automatic ascii conversions. The definition of -UTQT_NO_ASCII_CAST is no longer needed. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 5004b40e99036a0d9346dba6b5e6a4553de5a65e)
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/frontend.cpp6
-rw-r--r--src/makedlg.cpp14
-rw-r--r--src/projectfilesdlg.cpp2
-rw-r--r--src/scanprogressdlg.cpp2
5 files changed, 9 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c9a1b1a..f95629d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,7 +60,7 @@ include( ConfigureChecks.cmake )
###### global compiler settings
-add_definitions( -DHAVE_CONFIG_H -UQT_NO_ASCII_CAST )
+add_definitions( -DHAVE_CONFIG_H )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
diff --git a/src/frontend.cpp b/src/frontend.cpp
index 1bcace8..ab12459 100644
--- a/src/frontend.cpp
+++ b/src/frontend.cpp
@@ -231,12 +231,12 @@ bool Frontend::tokenize(char** ppBuf, int* pBufSize, TQString& sResult,
// Either a token was found, or the search through the buffer was
// finished without a delimiter character
if (bFoundToken) {
- sResult = *ppBuf;
+ sResult = TQString::fromLocal8Bit(*ppBuf);
*ppBuf = pBuf;
*pBufSize = nSize;
}
else if (m_bInToken) {
- sResult = TQString::fromLatin1(*ppBuf, *pBufSize);
+ sResult = TQString::fromLocal8Bit(*ppBuf, *pBufSize);
}
else {
sResult = TQString::null;
@@ -358,7 +358,7 @@ void Frontend::slotReadStderr(TDEProcess*, char* pBuffer, int nSize)
if (m_bKilled)
return;
- sBuf.setLatin1(pBuffer, nSize);
+ sBuf = TQString::fromLocal8Bit(pBuffer, nSize);
parseStderr(sBuf);
}
diff --git a/src/makedlg.cpp b/src/makedlg.cpp
index 2037224..287e5c6 100644
--- a/src/makedlg.cpp
+++ b/src/makedlg.cpp
@@ -198,12 +198,7 @@ void MakeDlg::slotStop()
*/
void MakeDlg::slotShowOutput(FrontendToken* pToken)
{
- TQString sData;
-
- // GCC uses unicode quote characters - this should ensure that they are
- // treated correctly by the text browser widget
- sData = TQTextCodec::codecForLocale()->toUnicode(pToken->getData());
- m_pOutputBrowser->append(sData);
+ m_pOutputBrowser->append(pToken->getData());
}
/**
@@ -258,10 +253,7 @@ void MakeDlg::slotBrowserClicked(const TQString& sURL)
void MakeDlg::slotAddError(const TQString& sFile, const TQString& sLine,
const TQString& sText)
{
- TQString sUniText;
-
- sUniText = TQTextCodec::codecForLocale()->toUnicode(sText);
- m_pErrorView->addRecord("", sFile, sLine, sUniText);
+ m_pErrorView->addRecord("", sFile, sLine, sText);
}
-
+
#include "makedlg.moc"
diff --git a/src/projectfilesdlg.cpp b/src/projectfilesdlg.cpp
index 3c9cf2b..a353e5a 100644
--- a/src/projectfilesdlg.cpp
+++ b/src/projectfilesdlg.cpp
@@ -201,7 +201,7 @@ void ProjectFilesDlg::customEvent(TQCustomEvent* pEvent)
}
// Prompt the user for the files to add
- sMsg.sprintf(i18n("Would you like to add %d files to your project?"),
+ sMsg.sprintf(i18n("Would you like to add %d files to your project?").utf8(),
pDSE->m_nFiles);
if (KMessageBox::questionYesNo(0, sMsg) == KMessageBox::No)
return;
diff --git a/src/scanprogressdlg.cpp b/src/scanprogressdlg.cpp
index 52dcf08..28708fa 100644
--- a/src/scanprogressdlg.cpp
+++ b/src/scanprogressdlg.cpp
@@ -73,7 +73,7 @@ void ScanProgressDlg::addFiles(int nFiles)
// Update progress only if more than 100 files were scanned since the last
// update
if ((m_nFiles - m_nCurFiles) > 100) {
- sText.sprintf(i18n("Scanned %d files..."), m_nFiles);
+ sText.sprintf(i18n("Scanned %d files...").utf8(), m_nFiles);
m_pText->setText(sText);
m_nCurFiles = m_nFiles;
}