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 5004b40e99)
r14.0.x
Slávek Banko 5 years ago
parent 78178b45c7
commit 5cad600637
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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" )

@ -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);
}

@ -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"

@ -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;

@ -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;
}

Loading…
Cancel
Save