diff options
author | Slávek Banko <[email protected]> | 2020-05-26 01:30:17 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2020-05-26 01:30:17 +0200 |
commit | 5004b40e99036a0d9346dba6b5e6a4553de5a65e (patch) | |
tree | d7f9d99920bfff3b4a5719446ead1c3951ec5399 | |
parent | 8bc51aef53e4d9de236ca4f19806b32da1cc0525 (diff) | |
download | kscope-5004b40e99036a0d9346dba6b5e6a4553de5a65e.tar.gz kscope-5004b40e99036a0d9346dba6b5e6a4553de5a65e.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 <[email protected]>
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/frontend.cpp | 6 | ||||
-rw-r--r-- | src/makedlg.cpp | 14 | ||||
-rw-r--r-- | src/projectfilesdlg.cpp | 2 | ||||
-rw-r--r-- | src/scanprogressdlg.cpp | 2 |
5 files changed, 9 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 76d0986..a4d770d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ include( ConfigureChecks.cmake ) ###### global compiler settings -add_definitions( -DHAVE_CONFIG_H -UTQT_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; } |