Fix incorrect use of TQString() inside i18n().

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 5615796c0a)
r14.0.x
Slávek Banko 6 years ago
parent 83fb5c2a16
commit 43addd52a7
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -57,7 +57,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 "-Wl,--no-undefined" )

@ -96,7 +96,7 @@ bool CommonWidget::buildPortRangesTables( const boolPtr tcpPorts, const boolPtr
portRange = portRange.right( portRange.length( ) - 2 );
}
else
{ KMessageBox::error( this, i18n( TQString( "Internal error - Unknown Port Range protocol '%1'" ).arg( portRange[ 0 ])), i18n( "Internal error" ));
{ KMessageBox::error( this, i18n( "Internal error - Unknown Port Range protocol '%1'" ).arg( portRange[ 0 ]), i18n( "Internal error" ));
return false;
}
@ -282,7 +282,7 @@ bool CommonWidget::getOptions( )
bool portRangesState = m_portRangesCheckBox->isChecked( );
if( portRangesState && portRanges.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Port ranges not specified" )), i18n( "Port ranges error" ));
{ KMessageBox::error( this, i18n( "Port ranges not specified" ), i18n( "Port ranges error" ));
return false;
}

@ -269,42 +269,42 @@ bool CompoundWidget::getOptions( bool& needRoot )
TQString targetFileValue = m_targetFileLineEdit->text( );
if( dataDirState && dataDirValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Data directory name not specified" )), i18n( "Data directory name error" ));
{ KMessageBox::error( this, i18n( "Data directory name not specified" ), i18n( "Data directory name error" ));
return false;
}
if( decoyState && decoyValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Decoy host list not specified" )), i18n( "Decoy hosts error" ));
{ KMessageBox::error( this, i18n( "Decoy host list not specified" ), i18n( "Decoy hosts error" ));
return false;
}
if( excludeState && excludeValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Exclude hosts not specified" )), i18n( "Exclude hosts error" ));
{ KMessageBox::error( this, i18n( "Exclude hosts not specified" ), i18n( "Exclude hosts error" ));
return false;
}
if( excludeFileState && excludeFileValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Exclude hosts file name not specified" )), i18n( "Exclude hosts file name error" ));
{ KMessageBox::error( this, i18n( "Exclude hosts file name not specified" ), i18n( "Exclude hosts file name error" ));
return false;
}
if( interfaceState && interfaceValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Interface name not specified" )), i18n( "Interface name error" ));
{ KMessageBox::error( this, i18n( "Interface name not specified" ), i18n( "Interface name error" ));
return false;
}
if( sourceIPState && sourceIPValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Source IP address not specified" )), i18n( "Source IP address error" ));
{ KMessageBox::error( this, i18n( "Source IP address not specified" ), i18n( "Source IP address error" ));
return false;
}
if( spoofMacState && spoofMacValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Spoof MAC address not specified" )), i18n( "Spoof MAC address error" ));
{ KMessageBox::error( this, i18n( "Spoof MAC address not specified" ), i18n( "Spoof MAC address error" ));
return false;
}
if( targetFileState && targetFileValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Target hosts file name not specified" )), i18n( "Target hosts file name error" ));
{ KMessageBox::error( this, i18n( "Target hosts file name not specified" ), i18n( "Target hosts file name error" ));
return false;
}

@ -194,7 +194,7 @@ void HTMLWidget::slotGunzipProcessExited( )
m_htmlData = TQString::null;
m_process->start( TDEProcess::NotifyOnExit, TDEProcess::Communication( TDEProcess::Stdin | TDEProcess::Stdout ));
m_process->writeStdin( m_manPageData, m_manPageData.length( ));
m_process->writeStdin( m_manPageData.local8Bit(), m_manPageData.local8Bit().length( ));
m_process->closeStdin( );
}

@ -184,37 +184,37 @@ bool LoggingOptions::getOptions( )
TQString xmlLogValue = m_xmlLogLineEdit->text( );
if( baseFileNameState && baseFileNameValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Base file name not specified" )), i18n( "Base file name error" ));
{ KMessageBox::error( this, i18n( "Base file name not specified" ), i18n( "Base file name error" ));
return false;
}
if( grepableLogState && grepableLogValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "grep'able log file name not specified" )), i18n( "grep'able log file name error" ));
{ KMessageBox::error( this, i18n( "grep'able log file name not specified" ), i18n( "grep'able log file name error" ));
return false;
}
if( normalLogState && normalLogValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Normal log file name not specified" )), i18n( "Normal log file name error" ));
{ KMessageBox::error( this, i18n( "Normal log file name not specified" ), i18n( "Normal log file name error" ));
return false;
}
if( resumeState && scriptKiddieValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Resume file name not specified" )), i18n( "Resume file name error" ));
{ KMessageBox::error( this, i18n( "Resume file name not specified" ), i18n( "Resume file name error" ));
return false;
}
if( scriptKiddieState && scriptKiddieValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "Script kiddie log file name not specified" )), i18n( "Script kiddie log file name error" ));
{ KMessageBox::error( this, i18n( "Script kiddie log file name not specified" ), i18n( "Script kiddie log file name error" ));
return false;
}
if( stylesheetState && stylesheetValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "XSL stylesheet file name not specified" )), i18n( "XSL stylesheet file name error" ));
{ KMessageBox::error( this, i18n( "XSL stylesheet file name not specified" ), i18n( "XSL stylesheet file name error" ));
return false;
}
if( xmlLogState && xmlLogValue.isEmpty( ))
{ KMessageBox::error( this, i18n( TQString( "XML log file name not specified" )), i18n( "XML log file name error" ));
{ KMessageBox::error( this, i18n( "XML log file name not specified" ), i18n( "XML log file name error" ));
return false;
}

@ -39,7 +39,7 @@ int main( int argc, string argv[])
{ TQString version = TQString( "Version 2.1, %1 %2" ).arg( __TIME__ ).arg( __DATE__ );
TDEAboutData about( "knmap",
I18N_NOOP( "Knmap" ),
version,
version.utf8(),
description,
TDEAboutData::License_GPL,
"(C) 2005, 2006 Kevin Gilbert",

@ -435,7 +435,7 @@ void MainWidget::slotWrapText( )
void MainWidget::slotZoomCustom( )
{ bool ok;
int zoom = KInputDialog::getInteger( i18n( "Zoom percentage" ),
i18n( TQString( "Enter zoom %'age (%1% - %2%)").arg( ZOOM_MIN_FACTOR ).arg( ZOOM_MAX_FACTOR)),
i18n( "Enter zoom %'age (%1% - %2%)" ).arg( ZOOM_MIN_FACTOR ).arg( ZOOM_MAX_FACTOR),
int( m_htmlWidget->zoomFactor( )),
ZOOM_MIN_FACTOR,
ZOOM_MAX_FACTOR,

@ -479,23 +479,23 @@ bool ScanWidget::createPipe( const TQString type, const TQString& tempDir, TQFil
delete pipe;
}
if( mkfifo( pipe->name( ), 0600 ))
if( mkfifo( pipe->name( ).local8Bit(), 0600 ))
{ TQString text = TQString( i18n( "Couldn't create the named pipe \"%1\" for nmap output: %2\n" )).arg( pipe->name( )).arg( strerror( errno ));
m_outputWidget->addOutput( OutputWidget::Stderr, text, text.length( ));
m_outputWidget->addOutput( OutputWidget::Stderr, text.local8Bit(), text.local8Bit().length( ));
delete pipe;
pipe = NULL;
return false;
}
pipeFD = ::open( pipe->name( ), O_RDONLY | O_NONBLOCK );
pipeFD = ::open( pipe->name( ).local8Bit(), O_RDONLY | O_NONBLOCK );
if( pipeFD != -1 )
return true;
TQString text = TQString( i18n( "Couldn't open the named pipe \"%1\" for nmap output: %2\n" )).arg( pipe->name( ))
.arg( strerror( errno ));
m_outputWidget->addOutput( OutputWidget::Stderr, text, text.length( ));
m_outputWidget->addOutput( OutputWidget::Stderr, text.local8Bit(), text.local8Bit().length( ));
delete pipe;
pipe = NULL;
@ -514,7 +514,7 @@ bool ScanWidget::createPipes( )
if( tempDir.isEmpty( ))
{ TQString text = TQString( i18n( "Couldn't create the named pipe for nmap output: no temp file dir\n" ));
m_outputWidget->addOutput( OutputWidget::Stderr, text, text.length( ));
m_outputWidget->addOutput( OutputWidget::Stderr, text.local8Bit(), text.local8Bit().length( ));
return false;
}
@ -593,7 +593,7 @@ bool ScanWidget::getOptions( )
return false;
if( m_commonWidget->host( ).isEmpty( ) && !m_compoundWidget->targetFileState( ))
{ KMessageBox::error( this, i18n( TQString( "Target host(s) not specified by \"Target host(s)\" or \"Target hosts file\" options" )), i18n( "Target host(s) error" ));
{ KMessageBox::error( this, i18n( "Target host(s) not specified by \"Target host(s)\" or \"Target hosts file\" options" ), i18n( "Target host(s) error" ));
return false;
}
@ -983,7 +983,7 @@ void ScanWidget::slotStartClicked( )
cmd.stripWhiteSpace( );
m_clearOutputButton->setEnabled( true );
m_outputWidget->addOutput( OutputWidget::Stdin, cmd, cmd.length( ));
m_outputWidget->addOutput( OutputWidget::Stdin, cmd.local8Bit(), cmd.local8Bit().length( ));
emit( outputAvailable( true, true ));
connect( m_nmapProcess, SIGNAL( processExited( TDEProcess* )), SLOT( slotProcessExited( )));

@ -253,22 +253,22 @@ bool TimingWidget::getOptions( )
uint scanDelayValue = m_scanDelayLineEdit->text( ).toUInt( );
if( minHostGroupValue > maxHostGroupValue )
{ KMessageBox::error( this, i18n( TQString( "Min host group not < Max host group" )), i18n( "Host group error" ));
{ KMessageBox::error( this, i18n( "Min host group not < Max host group" ), i18n( "Host group error" ));
return false;
}
if( minParallelismValue > maxParallelismValue )
{ KMessageBox::error( this, i18n( TQString( "Min parallelism not < Max parallelism" )), i18n( "Parallelism error" ));
{ KMessageBox::error( this, i18n( "Min parallelism not < Max parallelism" ), i18n( "Parallelism error" ));
return false;
}
if( minRTTTimeoutValue > maxRTTTimeoutValue )
{ KMessageBox::error( this, i18n( TQString( "Min RTT timeout not < Max RTT timeout" )), i18n( "RTT timeout error" ));
{ KMessageBox::error( this, i18n( "Min RTT timeout not < Max RTT timeout" ), i18n( "RTT timeout error" ));
return false;
}
if( scanDelayValue > maxScanDelayValue )
{ KMessageBox::error( this, i18n( TQString( "Min scan delay not < Max scan delay" )), i18n( "Scan delay error" ));
{ KMessageBox::error( this, i18n( "Min scan delay not < Max scan delay" ), i18n( "Scan delay error" ));
return false;
}

Loading…
Cancel
Save