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 20a84daca2)
r14.0.x
Slávek Banko 5 years ago
parent 66db0a23d7
commit 80f1da469d
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -62,7 +62,7 @@ include( ConfigureChecks.cmake )
###### global compiler settings ###### 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_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" )

@ -151,7 +151,7 @@ void BarCodeDialog::save()
bc.setTokenProvider( m_token ); bc.setTokenProvider( m_token );
bc.update( TQT_TQPAINTDEVICE(TDEApplication::desktop()) ); bc.update( TQT_TQPAINTDEVICE(TDEApplication::desktop()) );
if(!bc.pixmap().save( path, extension, 0 )) if(!bc.pixmap().save( path, extension.utf8(), 0 ))
KMessageBox::error( this, i18n("An error occurred during saving the image") ); KMessageBox::error( this, i18n("An error occurred during saving the image") );
} }
} }

@ -605,8 +605,8 @@ const char* Barkode::typeFromName( const TQString & name )
{ {
for( unsigned int i = 0; i < s_info.count(); i++ ) for( unsigned int i = 0; i < s_info.count(); i++ )
if( s_info[i].name == name ) if( s_info[i].name == name )
return s_info[i].xml; return s_info[i].xml.latin1();
return NULL; return NULL;
} }
@ -614,8 +614,8 @@ const char* Barkode::nameFromType( const TQString & type )
{ {
for( unsigned int i = 0; i < s_info.count(); i++ ) for( unsigned int i = 0; i < s_info.count(); i++ )
if( s_info[i].xml == type ) if( s_info[i].xml == type )
return s_info[i].name; return s_info[i].name.latin1();
return NULL; return NULL;
} }

@ -308,7 +308,7 @@ void BatchPrinter::startImages()
c++; c++;
} }
pixmap.save( filename, m_image_format ); pixmap.save( filename, m_image_format.utf8() );
if( !checkProgressDialog( progress ) ) if( !checkProgressDialog( progress ) )
{ {

@ -306,7 +306,7 @@ bool Definition::openFile()
if( !TQFile::exists( fname ) || fname.isEmpty() ) if( !TQFile::exists( fname ) || fname.isEmpty() )
return ( showFileError() ? openFile() : false ); return ( showFileError() ? openFile() : false );
if(!filecopy( (const char*)fname, (const char*)f )) if(!filecopy( fname.local8Bit(), f.local8Bit() ))
return ( showFileError() ? openFile() : false ); return ( showFileError() ? openFile() : false );
} }

@ -47,7 +47,7 @@ class DragCommand : public NewItemCommand {
DocumentItemDrag::DocumentItemDrag( TQWidget* dragSource, const char* name ) DocumentItemDrag::DocumentItemDrag( TQWidget* dragSource, const char* name )
: TQStoredDrag( DocumentItemDrag::mimeType(), dragSource, name ) : TQStoredDrag( DocumentItemDrag::mimeType().latin1(), dragSource, name )
{ {
} }
@ -83,12 +83,12 @@ void DocumentItemDrag::setDocumentItem( DocumentItemList* list )
bool DocumentItemDrag::canDecode( TQMimeSource* e ) bool DocumentItemDrag::canDecode( TQMimeSource* e )
{ {
return e->provides( DocumentItemDrag::mimeType() ); return e->provides( DocumentItemDrag::mimeType().latin1() );
} }
bool DocumentItemDrag::decode( TQMimeSource* mime, MyCanvasView* cv, TokenProvider* token, KCommandHistory* history ) bool DocumentItemDrag::decode( TQMimeSource* mime, MyCanvasView* cv, TokenProvider* token, KCommandHistory* history )
{ {
TQByteArray data = mime->encodedData( DocumentItemDrag::mimeType() ); TQByteArray data = mime->encodedData( DocumentItemDrag::mimeType().latin1() );
TQDomDocument doc( "KBarcodeClipboard" ); TQDomDocument doc( "KBarcodeClipboard" );
if( !doc.setContent( data ) ) if( !doc.setContent( data ) )
return false; return false;

@ -248,7 +248,7 @@ TQRect PixmapBarcode::bbox( const char* data, long size )
if( text.startsWith( bbox ) ) if( text.startsWith( bbox ) )
{ {
text = text.right( text.length() - len ); text = text.right( text.length() - len );
sscanf( (const char*)text, "%d %d %d %d", &x, &y, &w, &h ); sscanf( text.latin1(), "%d %d %d %d", &x, &y, &w, &h );
s = TQRect( x, y, w, h ); s = TQRect( x, y, w, h );
break; break;
} }

@ -160,7 +160,7 @@ void PurePostscriptBarcode::initInfo( TBarcodeInfoList* info )
example = line.right( line.length() - TQString( EXAMPLE ).length() ); example = line.right( line.length() - TQString( EXAMPLE ).length() );
// we should have a complete encoder now. // we should have a complete encoder now.
info->append( Barkode::createInfo( TQString("ps_") + encoder, description, PURE_POSTSCRIPT, PUREADV | COLORED ) ); info->append( Barkode::createInfo( TQString("ps_%1").arg(encoder).latin1(), description, PURE_POSTSCRIPT, PUREADV | COLORED ) );
} }
} }
} }

@ -215,7 +215,7 @@ TQString tec452(const TQString &url, int count, const TQString &art, const TQStr
TQString convZeros( int count, int zeros ) TQString convZeros( int count, int zeros )
{ {
TQString str= TQString("%1").arg(count); TQString str= TQString("%1").arg(count);
int l=strlen(str); //get the string length int l=strlen(str.latin1()); //get the string length
for(;l<zeros;l++) str = TQString("0") + str; for(;l<zeros;l++) str = TQString("0") + str;
return str; return str;
} }
@ -640,7 +640,7 @@ int fd, res;
char buf[1]; char buf[1];
TQString result; TQString result;
fd = open(file, O_RDONLY); fd = open(file.local8Bit(), O_RDONLY);
if (fd <0) return "Port Error."; if (fd <0) return "Port Error.";
res=read(fd,buf,1); res=read(fd,buf,1);
while (res == 1){ while (res == 1){

@ -905,7 +905,7 @@ const TQString TokenProvider::createSerial()
tmpstr.setNum(splitit.cap(2).length()); tmpstr.setNum(splitit.cap(2).length());
TQString formatstring = "%0" + tmpstr + "lu"; TQString formatstring = "%0" + tmpstr + "lu";
s = prenum + tmpstr.sprintf(formatstring, tmp) + postnum; s = prenum + tmpstr.sprintf(formatstring.latin1(), tmp) + postnum;
m_update = true; m_update = true;
} }

Loading…
Cancel
Save