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 6 years ago
parent f0a3534123
commit c0263d89c6
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -61,7 +61,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" )

@ -864,7 +864,7 @@ TQCString LCHMFileImpl::convertSearchWord( const TQString & src )
}; };
if ( !m_textCodec ) if ( !m_textCodec )
return (TQCString) src.lower(); return src.lower().utf8();
TQCString dest = m_textCodec->fromUnicode (src); TQCString dest = m_textCodec->fromUnicode (src);
@ -996,7 +996,7 @@ bool LCHMFileImpl::parseFileAndFillArray( const TQString & file, QT34VECTOR< LCH
else if ( tagword == "/object" && in_object ) else if ( tagword == "/object" && in_object )
{ {
// a topic entry closed. Add a tree item // a topic entry closed. Add a tree item
if ( entry.name ) if ( !entry.name.isEmpty() )
{ {
if ( !root_indent_offset_set ) if ( !root_indent_offset_set )
{ {

@ -109,7 +109,7 @@ class LCHMFileImpl
//! Encode the string with the currently selected text codec, if possible. Or return as-is, if not. //! Encode the string with the currently selected text codec, if possible. Or return as-is, if not.
inline TQString encodeWithCurrentCodec (const TQString& str) const inline TQString encodeWithCurrentCodec (const TQString& str) const
{ {
return (m_textCodec ? m_textCodec->toUnicode (str) : str); return (m_textCodec ? m_textCodec->toUnicode (str.utf8()) : str);
} }
//! Encode the string with the currently selected text codec, if possible. Or return as-is, if not. //! Encode the string with the currently selected text codec, if possible. Or return as-is, if not.
@ -122,7 +122,7 @@ class LCHMFileImpl
//! Or return as-is, if not. //! Or return as-is, if not.
inline TQString encodeInternalWithCurrentCodec (const TQString& str) const inline TQString encodeInternalWithCurrentCodec (const TQString& str) const
{ {
return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : str); return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str.utf8()) : str);
} }
//! Encode the string from internal files with the currently selected text codec, if possible. //! Encode the string from internal files with the currently selected text codec, if possible.

@ -113,7 +113,7 @@ static inline bool handleFileType( const TQString& link, TQString& generated )
if ( !link.endsWith( intext ) ) if ( !link.endsWith( intext ) )
return false; return false;
TQString filelink = link.left( link.length() - strlen( intext ) ); TQString filelink = link.left( link.length() - intext.length() );
generated = "<html><body><img src=\"" + filelink + "\"></body></html>"; generated = "<html><body><img src=\"" + filelink + "\"></body></html>";
return true; return true;
} }

@ -632,7 +632,7 @@ bool KCHMMainWindow::parseCmdLineArgs( )
search_index = args->getOption ("sindex"); search_index = args->getOption ("sindex");
if ( args->count() > 0 ) if ( args->count() > 0 )
filename = args->arg(0); filename = TQString::fromLocal8Bit(args->arg(0));
#else #else
// argv[0] in TQt is still a program name // argv[0] in TQt is still a program name
for ( int i = 1; i < tqApp->argc(); i++ ) for ( int i = 1; i < tqApp->argc(); i++ )
@ -651,13 +651,13 @@ bool KCHMMainWindow::parseCmdLineArgs( )
exit (1); exit (1);
} }
else else
filename = tqApp->argv()[i]; filename = TQSTring::fromLocal8Bit(tqApp->argv()[i]);
} }
#endif #endif
if ( !filename.isEmpty() ) if ( !filename.isEmpty() )
{ {
if ( !loadChmFile( TQString::fromLocal8Bit( filename )) ) if ( !loadChmFile( filename ) )
return true; // skip the latest checks, but do not exit from the program return true; // skip the latest checks, but do not exit from the program
if ( !search_index.isEmpty() ) if ( !search_index.isEmpty() )

Loading…
Cancel
Save