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/3/head
Slávek Banko 6 years ago
parent 6248169007
commit 20a84daca2
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

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

@ -151,7 +151,7 @@ void BarCodeDialog::save()
bc.setTokenProvider( m_token );
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") );
}
}

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

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

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

@ -47,7 +47,7 @@ class DragCommand : public NewItemCommand {
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 )
{
return e->provides( DocumentItemDrag::mimeType() );
return e->provides( DocumentItemDrag::mimeType().latin1() );
}
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" );
if( !doc.setContent( data ) )
return false;

@ -248,7 +248,7 @@ TQRect PixmapBarcode::bbox( const char* data, long size )
if( text.startsWith( bbox ) )
{
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 );
break;
}

@ -160,7 +160,7 @@ void PurePostscriptBarcode::initInfo( TBarcodeInfoList* info )
example = line.right( line.length() - TQString( EXAMPLE ).length() );
// 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 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;
return str;
}
@ -640,7 +640,7 @@ int fd, res;
char buf[1];
TQString result;
fd = open(file, O_RDONLY);
fd = open(file.local8Bit(), O_RDONLY);
if (fd <0) return "Port Error.";
res=read(fd,buf,1);
while (res == 1){

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

Loading…
Cancel
Save