diff options
Diffstat (limited to 'libtdepim/addresseeview.cpp')
-rw-r--r-- | libtdepim/addresseeview.cpp | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/libtdepim/addresseeview.cpp b/libtdepim/addresseeview.cpp index 15c7215ed..b3bccffad 100644 --- a/libtdepim/addresseeview.cpp +++ b/libtdepim/addresseeview.cpp @@ -151,27 +151,27 @@ void AddresseeView::enableLinks( int linkMask ) TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *proxy, LinkMask linkMask, bool internalLoading, FieldMask fieldMask ) { - TQString image = TQString( "contact_%1_image" ).tqarg( addr.uid() ); + TQString image = TQString( "contact_%1_image" ).arg( addr.uid() ); // Style strings from Gentix; this is just an initial version. // - // These will be substituted into various HTML strings with .tqarg(). + // These will be substituted into various HTML strings with .arg(). // Search for @STYLE@ to find where. Note how we use %1 as a // placeholder where we fill in something else (in this case, // the global background color). // TQString backgroundColor = KGlobalSettings::alternateBackgroundColor().name(); - TQString cellStyle = TQString::tqfromLatin1( + TQString cellStyle = TQString::fromLatin1( "style=\"" "padding-right: 2px; " "border-right: #000 dashed 1px; " - "background: %1;\"").tqarg(backgroundColor); + "background: %1;\"").arg(backgroundColor); TQString backgroundColor2 = KGlobalSettings::baseColor().name(); - TQString cellStyle2 = TQString::tqfromLatin1( + TQString cellStyle2 = TQString::fromLatin1( "style=\"" "padding-left: 2px; " - "background: %1;\"").tqarg(backgroundColor2); - TQString tableStyle = TQString::tqfromLatin1( + "background: %1;\"").arg(backgroundColor2); + TQString tableStyle = TQString::fromLatin1( "style=\"" "border: solid 1px; " "margin: 0em;\""); @@ -179,17 +179,17 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr // We'll be building a table to display the vCard in. // Each row of the table will be built using this string for its HTML. // - TQString rowFmtStr = TQString::tqfromLatin1( + TQString rowFmtStr = TQString::fromLatin1( "<tr>" "<td align=\"right\" valign=\"top\" width=\"30%\" "); // Tag unclosed rowFmtStr.append( cellStyle ); - rowFmtStr.append( TQString::tqfromLatin1( + rowFmtStr.append( TQString::fromLatin1( ">" // Close tag "<b>%1</b>" "</td>" "<td align=\"left\" valign=\"top\" width=\"70%\" ") ); // Tag unclosed rowFmtStr.append( cellStyle2 ); - rowFmtStr.append( TQString::tqfromLatin1( + rowFmtStr.append( TQString::fromLatin1( ">" // Close tag "%2" "</td>" @@ -216,8 +216,8 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr if ( date.isValid() ) dynamicPart += rowFmtStr - .tqarg( KABC::Addressee::birthdayLabel() ) - .tqarg( KGlobal::locale()->formatDate( date, true ) ); + .arg( KABC::Addressee::birthdayLabel() ) + .arg( KGlobal::locale()->formatDate( date, true ) ); } if ( fieldMask & PhoneFields ) { @@ -228,22 +228,22 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr TQString url; if ( (*phoneIt).type() & KABC::PhoneNumber::Fax ) - url = TQString::tqfromLatin1( "fax:" ) + number; + url = TQString::fromLatin1( "fax:" ) + number; else - url = TQString::tqfromLatin1( "phone:" ) + number; + url = TQString::fromLatin1( "phone:" ) + number; if ( linkMask & PhoneLinks ) { TQString smsURL; if ( (*phoneIt).type() & KABC::PhoneNumber::Cell ) - smsURL = TQString(" (<a href=\"sms:%1\">%2</a>)" ).tqarg( number ).tqarg( i18n( "SMS") ); + smsURL = TQString(" (<a href=\"sms:%1\">%2</a>)" ).arg( number ).arg( i18n( "SMS") ); dynamicPart += rowFmtStr - .tqarg( (*phoneIt).typeLabel().replace( " ", " " ) ) - .tqarg( TQString::tqfromLatin1( "<a href=\"%1\">%2</a>%3" ).tqarg( url ).tqarg( number ).tqarg( smsURL ) ); + .arg( (*phoneIt).typeLabel().replace( " ", " " ) ) + .arg( TQString::fromLatin1( "<a href=\"%1\">%2</a>%3" ).arg( url ).arg( number ).arg( smsURL ) ); } else { dynamicPart += rowFmtStr - .tqarg( (*phoneIt).typeLabel().replace( " ", " " ) ) - .tqarg( number ); + .arg( (*phoneIt).typeLabel().replace( " ", " " ) ) + .arg( number ); } } } @@ -257,11 +257,11 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr TQUrl::encode( fullEmail ); if ( linkMask & EmailLinks ) { - dynamicPart += rowFmtStr.tqarg( type ) - .tqarg( TQString::tqfromLatin1( "<a href=\"mailto:%1\">%2</a>" ) - .tqarg( fullEmail, TQStyleSheet::escape( *emailIt ) ) ); + dynamicPart += rowFmtStr.arg( type ) + .arg( TQString::fromLatin1( "<a href=\"mailto:%1\">%2</a>" ) + .arg( fullEmail, TQStyleSheet::escape( *emailIt ) ) ); } else { - dynamicPart += rowFmtStr.tqarg( type ).tqarg( *emailIt ); + dynamicPart += rowFmtStr.arg( type ).arg( *emailIt ); } } } @@ -276,7 +276,7 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr } else { url = addr.url().prettyURL(); } - dynamicPart += rowFmtStr.tqarg( i18n("Homepage") ).tqarg( url ); + dynamicPart += rowFmtStr.arg( i18n("Homepage") ).arg( url ); } TQString blog = addr.custom( "KADDRESSBOOK", "BlogFeed" ); @@ -284,7 +284,7 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr if ( linkMask & URLLinks ) { blog = KStringHandler::tagURLs( blog ); } - dynamicPart += rowFmtStr.tqarg( i18n("Blog Feed") ).tqarg( blog ); + dynamicPart += rowFmtStr.arg( i18n("Blog Feed") ).arg( blog ); } } @@ -303,12 +303,12 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr if ( linkMask & AddressLinks ) { dynamicPart += rowFmtStr - .tqarg( KABC::Address::typeLabel( (*addrIt).type() ) ) - .tqarg( link ); + .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) + .arg( link ); } else { dynamicPart += rowFmtStr - .tqarg( KABC::Address::typeLabel( (*addrIt).type() ) ) - .tqarg( formattedAddress ); + .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) + .arg( formattedAddress ); } } else { TQString link = "<a href=\"addr:" + (*addrIt).id() + "\">" + @@ -316,12 +316,12 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr if ( linkMask & AddressLinks ) { dynamicPart += rowFmtStr - .tqarg( KABC::Address::typeLabel( (*addrIt).type() ) ) - .tqarg( link ); + .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) + .arg( link ); } else { dynamicPart += rowFmtStr - .tqarg( KABC::Address::typeLabel( (*addrIt).type() ) ) - .tqarg( (*addrIt).label().replace( '\n', "<br>" ) ); + .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) + .arg( (*addrIt).label().replace( '\n', "<br>" ) ); } } } @@ -333,7 +333,7 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr // the data afterwards (keeps us safe from possible % signs // in either one). notes = TQStyleSheet::escape( addr.note() ); - notes = rowFmtStr.tqarg( i18n( "Notes" ) ).tqarg( notes.replace( '\n', "<br>" ) ) ; + notes = rowFmtStr.arg( i18n( "Notes" ) ).arg( notes.replace( '\n', "<br>" ) ) ; } TQString customData; @@ -371,7 +371,7 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr if ( keyIt != titleMap.end() ) key = keyIt.data(); - customData += rowFmtStr.tqarg( key ).tqarg( TQStyleSheet::escape( value ) ) ; + customData += rowFmtStr.arg( key ).arg( TQStyleSheet::escape( value ) ) ; } } } @@ -385,7 +385,7 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr const TQString imAddress = addr.custom( "KADDRESSBOOK", "X-IMAddress" ); if ( !imAddress.isEmpty() ) { - customData += rowFmtStr.tqarg( i18n( "IM Address" ) ).tqarg( TQStyleSheet::escape( imAddress ) ) ; + customData += rowFmtStr.arg( i18n( "IM Address" ) ).arg( TQStyleSheet::escape( imAddress ) ) ; } if ( proxy ) { @@ -393,24 +393,24 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr // set image source to either a TQMimeSourceFactory key or a data:/ URL TQString imgSrc; if ( internalLoading ) { - imgSrc = TQString::tqfromLatin1( "im_status_%1_image").tqarg( addr.uid() ); + imgSrc = TQString::fromLatin1( "im_status_%1_image").arg( addr.uid() ); TQMimeSourceFactory::defaultFactory()->setPixmap( imgSrc, proxy->presenceIcon( addr.uid() ) ); } else imgSrc = pixmapAsDataUrl( proxy->presenceIcon( addr.uid() ) ); // make the status a link, if required - TQString imtqStatus; + TQString imStatus; if ( linkMask & IMLinks ) - imtqStatus = TQString::tqfromLatin1( "<a href=\"im:\"><img src=\"%1\"> (%2)</a>" ); + imStatus = TQString::fromLatin1( "<a href=\"im:\"><img src=\"%1\"> (%2)</a>" ); else - imtqStatus = TQString::tqfromLatin1( "<img src=\"%1\"> (%2)" ); + imStatus = TQString::fromLatin1( "<img src=\"%1\"> (%2)" ); // append our status to the rest of the dynamic part of the addressee dynamicPart += rowFmtStr - .tqarg( i18n( "Presence" ) ) - .tqarg( imtqStatus - .tqarg( imgSrc ) - .tqarg( proxy->presenceString( addr.uid() ) ) + .arg( i18n( "Presence" ) ) + .arg( imStatus + .arg( imgSrc ) + .arg( proxy->presenceString( addr.uid() ) ) ); } } @@ -421,51 +421,51 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr // do it this way to avoid cases where the substituted string // contains %1 and the like. // - TQString strAddr = TQString::tqfromLatin1( + TQString strAddr = TQString::fromLatin1( "<div align=\"center\">" "<table cellpadding=\"1\" cellspacing=\"0\" %1>" - "<tr>").tqarg(tableStyle); + "<tr>").arg(tableStyle); - strAddr.append( TQString::tqfromLatin1( + strAddr.append( TQString::fromLatin1( "<td align=\"right\" valign=\"top\" width=\"30%\" rowspan=\"3\" %2>") - .tqarg( cellStyle ) ); - strAddr.append( TQString::tqfromLatin1( + .arg( cellStyle ) ); + strAddr.append( TQString::fromLatin1( "<img src=\"%1\" width=\"50\" vspace=\"1\">" // image "</td>") - .tqarg( image ) ); - strAddr.append( TQString::tqfromLatin1( + .arg( image ) ); + strAddr.append( TQString::fromLatin1( "<td align=\"left\" width=\"70%\" %2>") - .tqarg( cellStyle2 ) ); - strAddr.append( TQString::tqfromLatin1( + .arg( cellStyle2 ) ); + strAddr.append( TQString::fromLatin1( "<font size=\"+2\"><b>%2</b></font></td>" // name "</tr>") - .tqarg( name ) ); - strAddr.append( TQString::tqfromLatin1( + .arg( name ) ); + strAddr.append( TQString::fromLatin1( "<tr>" "<td align=\"left\" width=\"70%\" %2>") - .tqarg( cellStyle2 ) ); - strAddr.append( TQString::tqfromLatin1( + .arg( cellStyle2 ) ); + strAddr.append( TQString::fromLatin1( "%3</td>" // role "</tr>") - .tqarg( role ) ); - strAddr.append( TQString::tqfromLatin1( + .arg( role ) ); + strAddr.append( TQString::fromLatin1( "<tr>" "<td align=\"left\" width=\"70%\" %2>") - .tqarg( cellStyle2 ) ); - strAddr.append( TQString::tqfromLatin1( + .arg( cellStyle2 ) ); + strAddr.append( TQString::fromLatin1( "%4</td>" // organization "</tr>") - .tqarg( organization ) ); - strAddr.append( TQString::tqfromLatin1( + .arg( organization ) ); + strAddr.append( TQString::fromLatin1( "<tr><td %2>") - .tqarg( cellStyle ) ); - strAddr.append( TQString::tqfromLatin1( + .arg( cellStyle ) ); + strAddr.append( TQString::fromLatin1( " </td><td %2> </td></tr>") - .tqarg( cellStyle2 ) ); + .arg( cellStyle2 ) ); strAddr.append( dynamicPart ); strAddr.append( notes ); strAddr.append( customData ); - strAddr.append( TQString::tqfromLatin1( "</table></div>\n" ) ); + strAddr.append( TQString::fromLatin1( "</table></div>\n" ) ); if ( addr.resource() ) { TQString addrBookName = addr.resource()->resourceName(); @@ -476,7 +476,7 @@ TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pr if ( !label.isEmpty() ) addrBookName = label; } - strAddr.append( i18n( "<p><b>Address book</b>: %1</p>" ).tqarg( addrBookName ) ); + strAddr.append( i18n( "<p><b>Address book</b>: %1</p>" ).arg( addrBookName ) ); } return strAddr; } @@ -526,17 +526,17 @@ void AddresseeView::updateView() TQString strAddr = vCardAsHTML( mAddressee, mKIMProxy, (LinkMask)mLinkMask, true, (FieldMask)fieldMask ); - strAddr = TQString::tqfromLatin1( + strAddr = TQString::fromLatin1( "<html>" "<body text=\"%1\" bgcolor=\"%2\">" // text and background color "%3" // dynamic part "</body>" "</html>" ) - .tqarg( KGlobalSettings::textColor().name() ) - .tqarg( KGlobalSettings::baseColor().name() ) - .tqarg( strAddr ); + .arg( KGlobalSettings::textColor().name() ) + .arg( KGlobalSettings::baseColor().name() ) + .arg( strAddr ); - TQString imageURL = TQString( "contact_%1_image" ).tqarg( mAddressee.uid() ); + TQString imageURL = TQString( "contact_%1_image" ).arg( mAddressee.uid() ); KABC::Picture picture = mAddressee.photo(); if ( picture.isIntern() && !picture.data().isNull() ) @@ -690,27 +690,27 @@ void AddresseeView::slotHighlighted( const TQString &link ) TQString email = link.mid( 7 ); emit emailHighlighted( email ); - emit highlightedMessage( i18n( "Send mail to '%1'" ).tqarg( email ) ); + emit highlightedMessage( i18n( "Send mail to '%1'" ).arg( email ) ); } else if ( link.startsWith( "phone:" ) ) { TQString number = link.mid( 8 ); emit phoneNumberHighlighted( strippedNumber( number ) ); - emit highlightedMessage( i18n( "Call number %1" ).tqarg( number ) ); + emit highlightedMessage( i18n( "Call number %1" ).arg( number ) ); } else if ( link.startsWith( "fax:" ) ) { TQString number = link.mid( 6 ); emit faxNumberHighlighted( strippedNumber( number ) ); - emit highlightedMessage( i18n( "Send fax to %1" ).tqarg( number ) ); + emit highlightedMessage( i18n( "Send fax to %1" ).arg( number ) ); } else if ( link.startsWith( "addr:" ) ) { emit highlightedMessage( i18n( "Show address on map" ) ); } else if ( link.startsWith( "sms:" ) ) { TQString number = link.mid( 6 ); - emit highlightedMessage( i18n( "Send SMS to %1" ).tqarg( number ) ); + emit highlightedMessage( i18n( "Send SMS to %1" ).arg( number ) ); } else if ( link.startsWith( "http:" ) || link.startsWith( "https:" ) ) { emit urlHighlighted( link ); - emit highlightedMessage( i18n( "Open URL %1" ).tqarg( link ) ); + emit highlightedMessage( i18n( "Open URL %1" ).arg( link ) ); } else if ( link.startsWith( "im:" ) ) { - emit highlightedMessage( i18n( "Chat with %1" ).tqarg( mAddressee.realName() ) ); + emit highlightedMessage( i18n( "Chat with %1" ).arg( mAddressee.realName() ) ); } else emit highlightedMessage( "" ); } |