rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbarcode@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 7a4cd8d44e
commit 33038ab0e8

@ -84,7 +84,7 @@ void BarcodeItem::loadXML (TQDomElement* element)
/*
* check for encoding types saved by kbarcode <= 1.2.0
*/
if( legacy.tqcontains( type() ) )
if( legacy.contains( type() ) )
setType( legacy[type()] );
setTextVisible( element->attribute("text", "0" ).toInt() );

@ -248,19 +248,19 @@ const TQString Barkode::parsedValue()
if( !sequenceEnabled() )
return text;
if( m_value.tqcontains( '#' ) <= 0 )
if( m_value.contains( '#' ) <= 0 )
return text;
int pos = 0, counter = 1;
pos = text.tqfind("#", pos);
pos = text.find("#", pos);
pos++;
while( text[pos] == '#' ) {
text.remove(pos, 1);
counter++;
}
pos = text.tqfind("#", 0);
pos = text.find("#", 0);
TQString temp;
if( sequenceMode() == NUM ) {
@ -298,7 +298,7 @@ const TQString Barkode::parsedValue()
}
}
text.tqreplace( pos, 1, temp);
text.replace( pos, 1, temp);
return text;
}

@ -251,8 +251,8 @@ void BatchWizard::setupPage10()
TQStringList formats = KImageIO::types( KImageIO::Writing );
comboFormat = new KComboBox( false, formatBox );
comboFormat->insertStringList( formats );
if( formats.tqcontains( PNG_FORMAT ) )
comboFormat->setCurrentItem( formats.tqfindIndex( PNG_FORMAT ) );
if( formats.contains( PNG_FORMAT ) )
comboFormat->setCurrentItem( formats.findIndex( PNG_FORMAT ) );
label->setBuddy( comboFormat );
TQVButtonGroup* imageNameGroup = new TQVButtonGroup( i18n("&Filename:"), imageBox );
@ -762,7 +762,7 @@ void BatchWizard::addGroupCompletion( const TQString & group )
if( !group.isEmpty() )
{
TQStringList slist = compGroup->items();
if(!slist.tqcontains( group ) )
if(!slist.contains( group ) )
compGroup->addItem( group );
}
}

@ -84,7 +84,7 @@ void DatabaseBrowser::setupActions()
KAction* acut = KStdAction::cut( TQT_TQOBJECT(this), TQT_SLOT( cut() ), actionCollection() );
KAction* acopy = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( copy() ), actionCollection() );
KAction* apaste = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT( paste() ), actionCollection() );
KAction* atqfind = KStdAction::find( TQT_TQOBJECT(this), TQT_SLOT( find() ), actionCollection() );
KAction* afind = KStdAction::find( TQT_TQOBJECT(this), TQT_SLOT( find() ), actionCollection() );
menuBar()->insertItem( i18n("&Edit"), editMenu, -1, 1 );
acut->plug( editMenu );
@ -92,7 +92,7 @@ void DatabaseBrowser::setupActions()
apaste->plug( editMenu );
editMenu->insertSeparator();
atqfind->plug( editMenu );
afind->plug( editMenu );
KStdAction::findNext( TQT_TQOBJECT(this), TQT_SLOT( findNext() ), actionCollection() )->plug( editMenu );
editMenu->insertSeparator();
KAction* aimport = new KAction( i18n("&Import CSV File..."), "",
@ -104,7 +104,7 @@ void DatabaseBrowser::setupActions()
apaste->plug( toolBar() );
toolBar()->insertSeparator();
atqfind->plug( toolBar() );
afind->plug( toolBar() );
DSMainWindow::loadConfig();
}
@ -133,12 +133,12 @@ void DatabaseBrowser::setupSql()
table->refresh( TQDataTable::RefreshAll );
}
void DatabaseBrowser::tqfind()
void DatabaseBrowser::find()
{
if( !findDlg )
findDlg = new KEdFind( this, "findDlg", false );
findDlg->setText( m_tqfind );
findDlg->setText( m_find );
findDlg->setDirection( m_direction );
findDlg->setCaseSensitive( m_case );
connect( findDlg, TQT_SIGNAL( search() ), this, TQT_SLOT( findNext() ) );
@ -150,13 +150,13 @@ void DatabaseBrowser::tqfind()
void DatabaseBrowser::findNext()
{
if( findDlg ) {
m_tqfind = findDlg->getText();
m_find = findDlg->getText();
m_direction = findDlg->get_direction();
m_case = findDlg->case_sensitive();
} else
tqfind();
find();
table->tqfind( m_tqfind, m_case, m_direction );
table->find( m_find, m_case, m_direction );
}
void DatabaseBrowser::cut()

@ -47,7 +47,7 @@ class DatabaseBrowser : public DSMainWindow{
void copy();
void paste();
void tqfind();
void find();
void findNext();
void import();
@ -62,7 +62,7 @@ class DatabaseBrowser : public DSMainWindow{
KEdFind* findDlg;
TQString m_tqfind;
TQString m_find;
bool m_direction;
bool m_case;
};

@ -81,7 +81,7 @@ class PrivateParser {
PrivateParser::PrivateParser( TQString line, bool all )
{
line = line.stripWhiteSpace();
int pos = line.tqfind("(");
int pos = line.find("(");
line = line.mid( pos + 1, line.length() - pos - 1 );
m_label_def_id = TQString(line.section( ",", 0, 0 )).stripWhiteSpace();
@ -353,7 +353,7 @@ const TQStringList Definition::getProducers()
increaseProgress();
PrivateParser p( s, false );
if( !listProducers->tqcontains( p.getProducer() ) )
if( !listProducers->contains( p.getProducer() ) )
listProducers->append( p.getProducer() );
}
@ -365,7 +365,7 @@ const TQStringList Definition::getProducers()
const TQStringList Definition::getTypes( TQString producer )
{
if( mapTypes.tqcontains( producer ) ) {
if( mapTypes.contains( producer ) ) {
return mapTypes[producer];
}
@ -374,7 +374,7 @@ const TQStringList Definition::getTypes( TQString producer )
if( SqlTables::isConnected() ) {
TQSqlQuery query("SELECT type FROM " TABLE_LABEL_DEF " WHERE manufacture='" + producer + "'" );
while( query.next() )
if( !list.tqcontains( query.value( 0 ).toString() ) )
if( !list.contains( query.value( 0 ).toString() ) )
list.append( query.value( 0 ).toString() );
} else {
if(!openFile())
@ -392,7 +392,7 @@ const TQStringList Definition::getTypes( TQString producer )
PrivateParser p( s, false );
if( p.getProducer() == producer )
if( !list.tqcontains( p.getType() ) )
if( !list.contains( p.getType() ) )
list.append( p.getType() );
}
@ -486,7 +486,7 @@ int Definition::writeFile( const Measurements & c, TQString type, TQString produ
TQTextStream t( file );
for( unsigned int i = 0; i < data.count(); i++ )
t << data[i].tqreplace( TQRegExp("\\n"), "" ) << "\n";
t << data[i].replace( TQRegExp("\\n"), "" ) << "\n";
// get the file back to the normal stage
file->close();

@ -47,7 +47,7 @@ Another example
DSRichText::DSRichText( const TQString & t )
: text( t )
{
if( text.tqfind("<html>") == -1 )
if( text.find("<html>") == -1 )
text = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body style=\"font-size:10pt;font-family:Nimbus Sans l\"><p>"
+ t + "</p></body></html>";
@ -66,7 +66,7 @@ DSRichText::DSRichText( const TQString & t )
m_base = parseStyle( parse( tmp, "style=\"", "\"", pos ), &m_color );
}
pos = text.tqfind( "<p", 0 ); // initalize pos correctly
pos = text.find( "<p", 0 ); // initalize pos correctly
while( parseParagraph() ); // empty while loop
}
@ -246,7 +246,7 @@ bool DSRichText::parseParagraph()
break;
if( d[i] == '<' ) {
TQString span = d.mid( i, d.tqfind( ">", i ) - i + 1 );
TQString span = d.mid( i, d.find( ">", i ) - i + 1 );
i += span.length();
if( span.startsWith( "<span " ) ) {
@ -275,7 +275,7 @@ TQFont DSRichText::parseStyle( const TQString & s, TQColor* color )
TQFont f = m_base;
*color = m_color;
for ( int i = 0; i < style.tqcontains(';')+1; i++ ) {
for ( int i = 0; i < style.contains(';')+1; i++ ) {
TQString s = style.section( ';', i, i );
if( s.isEmpty() )
continue;
@ -311,17 +311,17 @@ TQFont DSRichText::parseStyle( const TQString & s, TQColor* color )
return f;
}
TQString DSRichText::parse( const TQString & t, const TQString & tqfind, const TQString & tqfind2, int start )
TQString DSRichText::parse( const TQString & t, const TQString & find, const TQString & find2, int start )
{
int s = t.tqfind( tqfind, start );
int s = t.find( find, start );
if( s == -1 || s < start )
return TQString();
int pend = t.tqfind( tqfind2, s + tqfind.length() );
if( pend == -1 || pend < (signed int)(s + tqfind.length()) )
int pend = t.find( find2, s + find.length() );
if( pend == -1 || pend < (signed int)(s + find.length()) )
return TQString();
TQString text = t.mid( s, pend - s + tqfind2.length() );
TQString text = t.mid( s, pend - s + find2.length() );
return text;
}
@ -396,10 +396,10 @@ inline int DSRichText::yDeviation( const formated_line* line )
TQString DSRichText::replaceEscapeSequences( const TQString & t )
{
TQString tmp = TQString( t );
tmp = tmp.tqreplace( DSREPLACE( "&lt;" ), "<" );
tmp = tmp.tqreplace( DSREPLACE( "&gt;" ), ">" );
tmp = tmp.tqreplace( DSREPLACE( "&amp;" ), "&" );
tmp = tmp.tqreplace( DSREPLACE( "&quot;" ), "\"" );
tmp = tmp.replace( DSREPLACE( "&lt;" ), "<" );
tmp = tmp.replace( DSREPLACE( "&gt;" ), ">" );
tmp = tmp.replace( DSREPLACE( "&amp;" ), "&" );
tmp = tmp.replace( DSREPLACE( "&quot;" ), "\"" );
return tmp;
}
@ -410,8 +410,8 @@ TQString DSRichText::parseParagraphTag( const TQString &t, int* tqalignment )
d = d.mid( 3, d.length() - 3 );
} else if( d.startsWith("<p ") ) {
*tqalignment = parseAlignment( parse( d, "align=\"", "\"", 0 ) );
if( d.tqcontains( ">" ) ) {
int x = d.tqfind(">" ) + 1;
if( d.contains( ">" ) ) {
int x = d.find(">" ) + 1;
d = d.mid( x, d.length() - x );
}
}

@ -148,7 +148,7 @@ class DSRichText {
* style. The font color is saved in the TQColor* @p color.
*/
TQFont parseStyle( const TQString & s, TQColor* color );
TQString parse( const TQString & t, const TQString & tqfind, const TQString & end, int start );
TQString parse( const TQString & t, const TQString & find, const TQString & end, int start );
void parseWords( const TQString & t, formated_word* w, WordList* words );
void initFormat( formated_word* f, int tqalignment );
void initLine( TQValueList<formated_line>* l );

@ -85,13 +85,13 @@ void DSTextEdit::fixParagraphs()
while( pos != -1 )
{
pos = t.tqfindRev( "</p>", pos );
pos = t.findRev( "</p>", pos );
if( pos != -1 )
{
++count;
if( count > 1 ) //&& pos != -1 )
t = t.tqreplace( pos, 4, "<br />" );
t = t.replace( pos, 4, "<br />" );
else
pos -= 4;
}
@ -128,14 +128,14 @@ bool DSTextEdit::cursorIsInToken()
qDebug("data=" + data );
--index;
firstopen = data.tqfindRev( "[", index );
firstclose = data.tqfindRev( "]", index );
firstopen = data.findRev( "[", index );
firstclose = data.findRev( "]", index );
++index;
if( firstopen != -1 && firstopen > firstclose )
{
firstopen = data.tqfind( "[", index );
firstclose = data.tqfind( "]", index );
firstopen = data.find( "[", index );
firstclose = data.find( "]", index );
if( ( firstclose != -1 && firstopen != -1 && firstclose < firstopen ) ||
( firstclose != -1 && firstopen == -1 ) )
return true;

@ -62,7 +62,7 @@ public:
setText( 0, m_action->plainText() );
setText( 1, m_action->shortcutText() );
// replace HTML tags in What's this help
setText( 2, m_action->whatsThis().tqreplace( regtag, "" ) );
setText( 2, m_action->whatsThis().replace( regtag, "" ) );
setPixmap( 0, pix );
}

@ -53,7 +53,7 @@ class KActionMapDlg : public KDialogBase {
* What is an Action Map?
*
* Almost every web page has a site map. According to Wikipedia,
* a site map "helps visitors, and search engine robots, to tqfind
* a site map "helps visitors, and search engine robots, to find
* pages on the site". Similar an Action Map should help the
* user to find actions (i.e. functions or menu items) in an application.
*

@ -50,7 +50,7 @@ Label::Label( Definition* _def, TQIODevice* device, TQString labelname, TQPaintD
setCustomerNo( customer_id );
setArticleNo( _article_no );
setGroup( _group );
setLabelName( labelname.right( labelname.length() - labelname.tqfindRev( "/" ) - 1 ) );
setLabelName( labelname.right( labelname.length() - labelname.findRev( "/" ) - 1 ) );
d = _def;
@ -63,7 +63,7 @@ Label::Label( Definition* _def, TQIODevice* device, TQString labelname, TQPaintD
m_sequence = false;
m_printer = _printer;
setLabelName( labelname.right( labelname.length() - labelname.tqfindRev( "/" ) - 1 ) );
setLabelName( labelname.right( labelname.length() - labelname.findRev( "/" ) - 1 ) );
d = _def;

@ -305,7 +305,7 @@ bool LabelEditor::save( TQString name )
save( TQT_TQIODEVICE(&f) );
m_token->setLabelName( filename.right( filename.length() - filename.tqfindRev( "/" ) - 1 ) );
m_token->setLabelName( filename.right( filename.length() - filename.findRev( "/" ) - 1 ) );
// maybe we should redraw all items on the canvas now.
// if there is a label with [filename], the filename might not
// get updated if the label gets saved with another filename.
@ -359,7 +359,7 @@ bool LabelEditor::openUrl( const TQString & url )
filename = url;
setCaption( filename, false );
m_token->setLabelName( filename.right( filename.length() - filename.tqfindRev( "/" ) - 1 ) );
m_token->setLabelName( filename.right( filename.length() - filename.findRev( "/" ) - 1 ) );
TQFile f( filename );
if ( !f.open( IO_ReadOnly ) )
@ -428,7 +428,7 @@ bool LabelEditor::newLabel()
delete nl;
filename = TQString();
m_token->setLabelName( filename.right( filename.length() - filename.tqfindRev( "/" ) - 1 ) );
m_token->setLabelName( filename.right( filename.length() - filename.findRev( "/" ) - 1 ) );
setCaption( filename, false );
enableActions();
@ -938,7 +938,7 @@ void LabelEditor::backCurrent()
const TQString LabelEditor::fileName() const
{
return filename.right( filename.length() - filename.tqfindRev( "/" ) - 1 );
return filename.right( filename.length() - filename.findRev( "/" ) - 1 );
}
void LabelEditor::preview()

@ -89,13 +89,13 @@ double LabelUtils::pixelToPixelY( double unit, const TQPaintDevice* src, const T
const TQString LabelUtils::getTypeFromCaption( const TQString & cap )
{
// TODO: remove this function
TQString search = cap.right( cap.length() - cap.tqfind(":") - 1 ).lower().stripWhiteSpace();
TQString search = cap.right( cap.length() - cap.find(":") - 1 ).lower().stripWhiteSpace();
return search;
}
const TQString LabelUtils::getModeFromCaption( const TQString & cap )
{
return cap.left( cap.tqfind(":") ).lower().stripWhiteSpace();
return cap.left( cap.find(":") ).lower().stripWhiteSpace();
}
TQSize LabelUtils::stringSize( const TQString & t )

@ -57,13 +57,13 @@ void setupDirs()
KStandardDirs* dirs = KGlobal::dirs();
TQString kdedir = dirs->kfsstnd_prefixes();
if( !kdedir.tqcontains( "/usr/local/" ) )
if( !kdedir.contains( "/usr/local/" ) )
dirs->addPrefix( "/usr/local/" );
if( !kdedir.tqcontains( "/usr/local/kde/" ) )
if( !kdedir.contains( "/usr/local/kde/" ) )
dirs->addPrefix( "/usr/local/kde/" );
if( !kdedir.tqcontains( "/usr/" ) )
if( !kdedir.contains( "/usr/" ) )
dirs->addPrefix( "/usr/" );
qDebug("WARNING: Prefix changed: %s", dirs->kfsstnd_prefixes().latin1() );

@ -416,20 +416,20 @@ TQString BarCode::createSequence( const TQString & value )
if( !barcode.sequence.enabled )
return value;
if( value.tqcontains( '#' ) <= 0 )
if( value.contains( '#' ) <= 0 )
return value;
TQString text = value;
int pos = 0, counter = 1;
pos = text.tqfind("#", pos);
pos = text.find("#", pos);
pos++;
while( text[pos] == '#' ) {
text.remove(pos, 1);
counter++;
}
pos = text.tqfind("#", 0);
pos = text.find("#", 0);
TQString temp;
if( barcode.sequence.mode == NUM ) {
@ -467,7 +467,7 @@ TQString BarCode::createSequence( const TQString & value )
}
}
text.tqreplace( pos, 1, temp);
text.replace( pos, 1, temp);
return text;
}

@ -301,7 +301,7 @@ bool MyCanvasView::isInside( TQPoint p, TQCanvasItem* item )
if( !item->isVisible() )
return false;
return item->boundingRect().tqcontains( p );
return item->boundingRect().contains( p );
}
int MyCanvasView::isEdge( TQPoint p, TQCanvasItem* item )

@ -82,13 +82,13 @@ PurePostscriptBarcode::PurePostscriptBarcode()
{
if( append )
{
if( line.tqcontains( END_TEMPLATE ) )
if( line.contains( END_TEMPLATE ) )
break;
m_program.append( line );
}
if( !append && line.tqcontains( BEGIN_TEMPLATE ) )
if( !append && line.contains( BEGIN_TEMPLATE ) )
append = true;
}
pureFile.close();

@ -421,7 +421,7 @@ void SqlTables::updateTables()
update << "gap_top" << "gap_left" << "height" << "width" << "gap_v" << "gap_h";
TQSqlQuery query4("SHOW FIELDS FROM " TABLE_LABEL_DEF );
while( query4.next() )
if( update.tqcontains( query4.value( 0 ).toString() ) && query4.value(1).toString() == "decimal(10,0)" ) {
if( update.contains( query4.value( 0 ).toString() ) && query4.value(1).toString() == "decimal(10,0)" ) {
TQSqlQuery q;
q.exec( TQString("ALTER TABLE " TABLE_LABEL_DEF " CHANGE ") +
query4.value( 0 ).toString() + " " + query4.value( 0 ).toString() + " NUMERIC(10,4)" );

@ -30,7 +30,7 @@
#define TABLE_BASIC "barcode_basic"
/* -------- */
// a macro to support TQString::tqreplace( TQString, TQString )
// a macro to support TQString::replace( TQString, TQString )
// also on QT 3.0.x
#define DSREPLACE( x ) x

@ -222,7 +222,7 @@ return str;
TQString posConv( TQString str, int zeros )
{
int point=str.tqfind(".",0);
int point=str.find(".",0);
TQString dec= TQString("%1").tqarg(str.mid(point+1,1));
str = str.mid(0,point);
str = TQString("%1%2").tqarg(str).tqarg(dec);
@ -439,7 +439,7 @@ temp = TQString(buf);
// LF = = 10
// CR = \r = 13
if (temp.tqfind(TQString("\r"),0,1)==-1) result+= temp;
if (temp.find(TQString("\r"),0,1)==-1) result+= temp;
else {
result+= temp;
exit=0;
@ -489,138 +489,138 @@ TQString getData(const TQString &etext, const TQString &art, const TQString &gro
TQString temp;
if (etext.tqcontains("[serial_watch]") ) etext.tqreplace( "[serial_watch]" , serialWatch() );
if (etext.tqcontains("[customer_no]") ) etext.tqreplace( "[customer_no]" , id );
if (etext.tqcontains("[customer_name]") ) etext.tqreplace( "[customer_name]" , name );
if (etext.tqcontains("[group]") ) etext.tqreplace( "[group]" , group );
if (etext.tqcontains("[article_no]") ) etext.tqreplace( "[article_no]" , art );
if (etext.tqcontains("[line1]") ) {
if (etext.contains("[serial_watch]") ) etext.replace( "[serial_watch]" , serialWatch() );
if (etext.contains("[customer_no]") ) etext.replace( "[customer_no]" , id );
if (etext.contains("[customer_name]") ) etext.replace( "[customer_name]" , name );
if (etext.contains("[group]") ) etext.replace( "[group]" , group );
if (etext.contains("[article_no]") ) etext.replace( "[article_no]" , art );
if (etext.contains("[line1]") ) {
TQSqlQuery query("SELECT line1 FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[line1]" , temp );
etext.replace( "[line1]" , temp );
}
if (etext.tqcontains("[line0]") ) {
if (etext.contains("[line0]") ) {
TQSqlQuery query("SELECT line0 FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[line0]" , temp );
etext.replace( "[line0]" , temp );
}
if (etext.tqcontains("[line2]") ) {
if (etext.contains("[line2]") ) {
TQSqlQuery query("SELECT line2 FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[line2]" , temp );
etext.replace( "[line2]" , temp );
}
if (etext.tqcontains("[line3]") ) {
if (etext.contains("[line3]") ) {
TQSqlQuery query("SELECT line3 FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[line3]" , temp );
etext.replace( "[line3]" , temp );
}
if (etext.tqcontains("[line4]") ) {
if (etext.contains("[line4]") ) {
TQSqlQuery query("SELECT line4 FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[line4]" , temp );
etext.replace( "[line4]" , temp );
}
if (etext.tqcontains("[line5]") ) {
if (etext.contains("[line5]") ) {
TQSqlQuery query("SELECT line5 FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[line5]" , temp );
etext.replace( "[line5]" , temp );
}
if (etext.tqcontains("[line6]") ) {
if (etext.contains("[line6]") ) {
TQSqlQuery query("SELECT line6 FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[line6]" , temp );
etext.replace( "[line6]" , temp );
}
if (etext.tqcontains("[line7]") ) {
if (etext.contains("[line7]") ) {
TQSqlQuery query("SELECT line7 FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[line7]" , temp );
etext.replace( "[line7]" , temp );
}
if (etext.tqcontains("[line8]") ) {
if (etext.contains("[line8]") ) {
TQSqlQuery query("SELECT line8 FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[line8]" , temp );
etext.replace( "[line8]" , temp );
}
if (etext.tqcontains("[line9]") ) {
if (etext.contains("[line9]") ) {
TQSqlQuery query("SELECT line9 FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[line9]" , temp );
etext.replace( "[line9]" , temp );
}
if (etext.tqcontains("[field0]") ) {
if (etext.contains("[field0]") ) {
TQSqlQuery query("SELECT field0 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field0]" , temp );
etext.replace( "[field0]" , temp );
}
if (etext.tqcontains("[field1]") ) {
if (etext.contains("[field1]") ) {
TQSqlQuery query("SELECT field1 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field1]" , temp );
etext.replace( "[field1]" , temp );
}
if (etext.tqcontains("[field2]") ) {
if (etext.contains("[field2]") ) {
TQSqlQuery query("SELECT field2 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field2]" , temp );
etext.replace( "[field2]" , temp );
}
if (etext.tqcontains("[field3]") ) {
if (etext.contains("[field3]") ) {
TQSqlQuery query("SELECT field3 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field3]" , temp );
etext.replace( "[field3]" , temp );
}
if (etext.tqcontains("[field4]") ) {
if (etext.contains("[field4]") ) {
TQSqlQuery query("SELECT field4 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field4]" , temp );
etext.replace( "[field4]" , temp );
}
if (etext.tqcontains("[field5]") ) {
if (etext.contains("[field5]") ) {
TQSqlQuery query("SELECT field5 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field5]" , temp );
etext.replace( "[field5]" , temp );
}
if (etext.tqcontains("[field6]") ) {
if (etext.contains("[field6]") ) {
TQSqlQuery query("SELECT field6 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field6]" , temp );
etext.replace( "[field6]" , temp );
}
if (etext.tqcontains("[field7]") ) {
if (etext.contains("[field7]") ) {
TQSqlQuery query("SELECT field7 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field7]" , temp );
etext.replace( "[field7]" , temp );
}
if (etext.tqcontains("[field8]") ) {
if (etext.contains("[field8]") ) {
TQSqlQuery query("SELECT field8 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field8]" , temp );
etext.replace( "[field8]" , temp );
}
if (etext.tqcontains("[field9]") ) {
if (etext.contains("[field9]") ) {
TQSqlQuery query("SELECT field9 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field9]" , temp );
etext.replace( "[field9]" , temp );
}
if (etext.tqcontains("[article_desc]") ) {
if (etext.contains("[article_desc]") ) {
TQSqlQuery query("SELECT article_desc FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[article_desc]" , temp );
etext.replace( "[article_desc]" , temp );
}
if (etext.tqcontains("[barcode_no]") ) {
if (etext.contains("[barcode_no]") ) {
TQSqlQuery query("SELECT barcode_no FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[barcode_no]" , temp );
etext.replace( "[barcode_no]" , temp );
}
if (etext.tqcontains("[field9]") ) {
if (etext.contains("[field9]") ) {
TQSqlQuery query("SELECT field9 FROM barcode_basic where article_no='" + art + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[field9]" , temp );
etext.replace( "[field9]" , temp );
}
if (etext.tqcontains("[article_no_customer]") ) {
if (etext.contains("[article_no_customer]") ) {
TQSqlQuery query("SELECT article_no_customer FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace( "[article_no_customer]" , temp );
etext.replace( "[article_no_customer]" , temp );
}
if (etext.tqcontains("[barcode_no_customer]") ){
if (etext.contains("[barcode_no_customer]") ){
TQSqlQuery query("SELECT barcode_no FROM customer_text where customer_no='" + id + "'" );
while( query.next() ) temp = TQString (query.value( 0 ).toString());
etext.tqreplace("[barcode_no_customer]" , temp );
etext.replace("[barcode_no_customer]" , temp );
}
if (etext.tqcontains("[date]") ) etext.tqreplace( "[date]" ,TQDateTime::tqcurrentDateTime().toString( KBarcodeSettings::getDateFormat() ));
if (etext.tqcontains("[time]") ) etext.tqreplace( "[time]" ,TQTime::currentTime().toString());
if (etext.contains("[date]") ) etext.replace( "[date]" ,TQDateTime::tqcurrentDateTime().toString( KBarcodeSettings::getDateFormat() ));
if (etext.contains("[time]") ) etext.replace( "[time]" ,TQTime::currentTime().toString());
return etext;*/
}

@ -122,7 +122,7 @@ void TextItem::draw(TQPainter* painter)
void TextItem::drawZpl( TQTextStream* stream )
{
// simply remove all html tags....
TQString data = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
TQString data = m_text.replace( TQRegExp("<[^>]*>"), "" );
*stream << ZPLUtils::fieldOrigin( rect().x(), rect().y() );
*stream << ZPLUtils::font( TQFont() ); // todo: select a valid font
}
@ -132,7 +132,7 @@ void TextItem::drawIpl( TQTextStream* stream, IPLUtils* utils )
int counter = utils->counter();
// simply remove all html tags....
TQString data = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
TQString data = m_text.replace( TQRegExp("<[^>]*>"), "" );
TQString s = TQString("H%1;").tqarg( counter ); // field number
@ -155,7 +155,7 @@ void TextItem::drawEPcl( TQTextStream* stream )
//
// break string into lines
TQString t = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
TQString t = m_text.replace( TQRegExp("<[^>]*>"), "" );
// @DOM:
// TODO:
// provide an API which simplifies wordwrapping for

@ -87,7 +87,7 @@ void TextLineItem::draw(TQPainter* painter)
void TextLineItem::drawZpl( TQTextStream* stream )
{
// simply remove all html tags....
TQString data = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
TQString data = m_text.replace( TQRegExp("<[^>]*>"), "" );
*stream << ZPLUtils::fieldOrigin( rect().x(), rect().y() );
*stream << ZPLUtils::font( TQFont() ); // todo: select a valid font
}
@ -97,7 +97,7 @@ void TextLineItem::drawIpl( TQTextStream* stream, IPLUtils* utils )
int counter = utils->counter();
// simply remove all html tags....
TQString data = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
TQString data = m_text.replace( TQRegExp("<[^>]*>"), "" );
TQString s = TQString("H%1;").tqarg( counter ); // field number
@ -120,7 +120,7 @@ void TextLineItem::drawEPcl( TQTextStream* stream )
//
// break string into lines
TQString t = m_text.tqreplace( TQRegExp("<[^>]*>"), "" );
TQString t = m_text.replace( TQRegExp("<[^>]*>"), "" );
// @DOM:
// TODO:
// provide an API which simplifies wordwrapping for

@ -343,15 +343,15 @@ void TokenProvider::findBrackets( TQString & text, TQString (TokenProvider::*par
int num, pos = -1, a;
TQString token;
if( text.tqcontains("]", FALSE) <= 0 || text.isEmpty() )
if( text.contains("]", FALSE) <= 0 || text.isEmpty() )
return;
num = text.tqcontains("[", FALSE);
num = text.contains("[", FALSE);
if(num <= 0 )
return;
pos = text.tqfindRev("[", pos);
a = text.tqfind("]", pos );
pos = text.findRev("[", pos);
a = text.find("]", pos );
if( a < 0 && pos >= 0 )
return;
@ -581,7 +581,7 @@ TQString TokenProvider::process( const TQString & t )
if( !m_uservardata.isEmpty() )
{
TQString tok = t.right( t.length() - 1 );
if( m_uservardata.tqcontains( tok ) )
if( m_uservardata.contains( tok ) )
{
ret = m_uservardata[tok];
if( ret.isNull() )
@ -915,10 +915,10 @@ const TQString TokenProvider::createSerial()
TQString TokenProvider::unescapeText( const TQString & t )
{
TQString tmp = t;
tmp = tmp.tqreplace( DSREPLACE( "&lt;" ), "<" );
tmp = tmp.tqreplace( DSREPLACE( "&gt;" ), ">" );
tmp = tmp.tqreplace( DSREPLACE( "&amp;" ), "&" );
tmp = tmp.tqreplace( DSREPLACE( "&quot;" ), "\"" );
tmp = tmp.replace( DSREPLACE( "&lt;" ), "<" );
tmp = tmp.replace( DSREPLACE( "&gt;" ), ">" );
tmp = tmp.replace( DSREPLACE( "&amp;" ), "&" );
tmp = tmp.replace( DSREPLACE( "&quot;" ), "\"" );
return tmp;
}
@ -926,11 +926,11 @@ TQString TokenProvider::unescapeText( const TQString & t )
TQString TokenProvider::escapeText( const TQString & t )
{
TQString tmp = t;
tmp = tmp.tqreplace( DSREPLACE( "<" ), "&lt;" );
tmp = tmp.tqreplace( DSREPLACE( ">" ), "&gt;" );
tmp = tmp.tqreplace( DSREPLACE( "&" ), "&amp;" );
tmp = tmp.tqreplace( DSREPLACE( "\"" ), "&quot;" );
tmp = tmp.tqreplace( DSREPLACE( "\n" ), "<br />" );
tmp = tmp.replace( DSREPLACE( "<" ), "&lt;" );
tmp = tmp.replace( DSREPLACE( ">" ), "&gt;" );
tmp = tmp.replace( DSREPLACE( "&" ), "&amp;" );
tmp = tmp.replace( DSREPLACE( "\"" ), "&quot;" );
tmp = tmp.replace( DSREPLACE( "\n" ), "<br />" );
return tmp;
}

@ -146,7 +146,7 @@ class TokenProvider {
/**
* parse the given text for tokens and return a
* string with all tokens replaced correctly.
* @param text TQString look in this text for tokens to tqreplace
* @param text TQString look in this text for tokens to replace
*/
TQString parse( const TQString & text );

@ -359,7 +359,7 @@ Definition* XMLUtils::readDefinition( TQDomElement* tag )
int id = label_def_id;
TQStringList p = Definition::getProducers();
if( !p.tqcontains( producer ) ) {
if( !p.contains( producer ) ) {
for( unsigned int i = 0; i < p.count(); i++ ) {
id = Definition::getClosest( p[i], type );
if( id >= 0 )
@ -457,7 +457,7 @@ void XMLUtils::readBarcode( TQDomElement* tag, Barkode* bcode )
/*
* check for encoding types saved by kbarcode <= 1.2.0
*/
if( legacy.tqcontains( bcode->type() ) )
if( legacy.contains( bcode->type() ) )
bcode->setType( legacy[bcode->type()] );
bcode->setTextVisible( tag->attribute("text", "0" ).toInt() );

Loading…
Cancel
Save