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>
pull/1/head
Slávek Banko 5 years ago
parent 8bc51aef53
commit 5004b40e99
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -60,7 +60,7 @@ include( ConfigureChecks.cmake )
###### global compiler settings ###### 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_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )

@ -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 // Either a token was found, or the search through the buffer was
// finished without a delimiter character // finished without a delimiter character
if (bFoundToken) { if (bFoundToken) {
sResult = *ppBuf; sResult = TQString::fromLocal8Bit(*ppBuf);
*ppBuf = pBuf; *ppBuf = pBuf;
*pBufSize = nSize; *pBufSize = nSize;
} }
else if (m_bInToken) { else if (m_bInToken) {
sResult = TQString::fromLatin1(*ppBuf, *pBufSize); sResult = TQString::fromLocal8Bit(*ppBuf, *pBufSize);
} }
else { else {
sResult = TQString::null; sResult = TQString::null;
@ -358,7 +358,7 @@ void Frontend::slotReadStderr(TDEProcess*, char* pBuffer, int nSize)
if (m_bKilled) if (m_bKilled)
return; return;
sBuf.setLatin1(pBuffer, nSize); sBuf = TQString::fromLocal8Bit(pBuffer, nSize);
parseStderr(sBuf); parseStderr(sBuf);
} }

@ -198,12 +198,7 @@ void MakeDlg::slotStop()
*/ */
void MakeDlg::slotShowOutput(FrontendToken* pToken) void MakeDlg::slotShowOutput(FrontendToken* pToken)
{ {
TQString sData; m_pOutputBrowser->append(pToken->getData());
// 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);
} }
/** /**
@ -258,10 +253,7 @@ void MakeDlg::slotBrowserClicked(const TQString& sURL)
void MakeDlg::slotAddError(const TQString& sFile, const TQString& sLine, void MakeDlg::slotAddError(const TQString& sFile, const TQString& sLine,
const TQString& sText) const TQString& sText)
{ {
TQString sUniText; m_pErrorView->addRecord("", sFile, sLine, sText);
sUniText = TQTextCodec::codecForLocale()->toUnicode(sText);
m_pErrorView->addRecord("", sFile, sLine, sUniText);
} }
#include "makedlg.moc" #include "makedlg.moc"

@ -201,7 +201,7 @@ void ProjectFilesDlg::customEvent(TQCustomEvent* pEvent)
} }
// Prompt the user for the files to add // 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); pDSE->m_nFiles);
if (KMessageBox::questionYesNo(0, sMsg) == KMessageBox::No) if (KMessageBox::questionYesNo(0, sMsg) == KMessageBox::No)
return; return;

@ -73,7 +73,7 @@ void ScanProgressDlg::addFiles(int nFiles)
// Update progress only if more than 100 files were scanned since the last // Update progress only if more than 100 files were scanned since the last
// update // update
if ((m_nFiles - m_nCurFiles) > 100) { 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_pText->setText(sText);
m_nCurFiles = m_nFiles; m_nCurFiles = m_nFiles;
} }

Loading…
Cancel
Save