summaryrefslogtreecommitdiffstats
path: root/libkdepim/addresseeview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /libkdepim/addresseeview.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/addresseeview.cpp')
-rw-r--r--libkdepim/addresseeview.cpp280
1 files changed, 140 insertions, 140 deletions
diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp
index 30aa3bef..c250aa49 100644
--- a/libkdepim/addresseeview.cpp
+++ b/libkdepim/addresseeview.cpp
@@ -19,10 +19,10 @@
Boston, MA 02110-1301, USA.
*/
-#include <qbuffer.h>
-#include <qimage.h>
-#include <qpopupmenu.h>
-#include <qurl.h>
+#include <tqbuffer.h>
+#include <tqimage.h>
+#include <tqpopupmenu.h>
+#include <tqurl.h>
#include <kabc/address.h>
#include <kabc/addressee.h>
@@ -50,26 +50,26 @@
using namespace KPIM;
-AddresseeView::AddresseeView( QWidget *parent, const char *name,
+AddresseeView::AddresseeView( TQWidget *parent, const char *name,
KConfig *config )
: KTextBrowser( parent, name ), mDefaultConfig( false ), mImageJob( 0 ),
mLinkMask( AddressLinks | EmailLinks | PhoneLinks | URLLinks | IMLinks | CustomFields )
{
- setWrapPolicy( QTextEdit::AtWordBoundary );
+ setWrapPolicy( TQTextEdit::AtWordBoundary );
setLinkUnderline( false );
- setVScrollBarMode( QScrollView::AlwaysOff );
- setHScrollBarMode( QScrollView::AlwaysOff );
+ setVScrollBarMode( TQScrollView::AlwaysOff );
+ setHScrollBarMode( TQScrollView::AlwaysOff );
- QStyleSheet *sheet = styleSheet();
- QStyleSheetItem *link = sheet->item( "a" );
+ TQStyleSheet *sheet = styleSheet();
+ TQStyleSheetItem *link = sheet->item( "a" );
link->setColor( KGlobalSettings::linkColor() );
- connect( this, SIGNAL( mailClick( const QString&, const QString& ) ),
- this, SLOT( slotMailClicked( const QString&, const QString& ) ) );
- connect( this, SIGNAL( urlClick( const QString& ) ),
- this, SLOT( slotUrlClicked( const QString& ) ) );
- connect( this, SIGNAL( highlighted( const QString& ) ),
- this, SLOT( slotHighlighted( const QString& ) ) );
+ connect( this, TQT_SIGNAL( mailClick( const TQString&, const TQString& ) ),
+ this, TQT_SLOT( slotMailClicked( const TQString&, const TQString& ) ) );
+ connect( this, TQT_SIGNAL( urlClick( const TQString& ) ),
+ this, TQT_SLOT( slotUrlClicked( const TQString& ) ) );
+ connect( this, TQT_SIGNAL( highlighted( const TQString& ) ),
+ this, TQT_SLOT( slotHighlighted( const TQString& ) ) );
setNotifyClick( true );
@@ -88,13 +88,13 @@ AddresseeView::AddresseeView( QWidget *parent, const char *name,
mActionShowCustomFields = new KToggleAction( i18n( "Show Custom Fields" ) );
mActionShowCustomFields->setCheckedState( i18n( "Hide Custom Fields" ) );
- connect( mActionShowBirthday, SIGNAL( toggled( bool ) ), SLOT( configChanged() ) );
- connect( mActionShowAddresses, SIGNAL( toggled( bool ) ), SLOT( configChanged() ) );
- connect( mActionShowEmails, SIGNAL( toggled( bool ) ), SLOT( configChanged() ) );
- connect( mActionShowPhones, SIGNAL( toggled( bool ) ), SLOT( configChanged() ) );
- connect( mActionShowURLs, SIGNAL( toggled( bool ) ), SLOT( configChanged() ) );
- connect( mActionShowIMAddresses, SIGNAL( toggled( bool ) ), SLOT( configChanged() ) );
- connect( mActionShowCustomFields, SIGNAL( toggled( bool ) ), SLOT( configChanged() ) );
+ connect( mActionShowBirthday, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( configChanged() ) );
+ connect( mActionShowAddresses, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( configChanged() ) );
+ connect( mActionShowEmails, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( configChanged() ) );
+ connect( mActionShowPhones, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( configChanged() ) );
+ connect( mActionShowURLs, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( configChanged() ) );
+ connect( mActionShowIMAddresses, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( configChanged() ) );
+ connect( mActionShowCustomFields, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( configChanged() ) );
if ( !config ) {
mConfig = new KConfig( "kaddressbookrc" );
@@ -106,10 +106,10 @@ AddresseeView::AddresseeView( QWidget *parent, const char *name,
// set up IMProxy to display contacts' IM presence and make connections to keep the display live
mKIMProxy = ::KIMProxy::instance( kapp->dcopClient() );
- connect( mKIMProxy, SIGNAL( sigContactPresenceChanged( const QString& ) ),
- this, SLOT( slotPresenceChanged( const QString& ) ) );
- connect( mKIMProxy, SIGNAL( sigPresenceInfoExpired() ),
- this, SLOT( slotPresenceInfoExpired() ) );
+ connect( mKIMProxy, TQT_SIGNAL( sigContactPresenceChanged( const TQString& ) ),
+ this, TQT_SLOT( slotPresenceChanged( const TQString& ) ) );
+ connect( mKIMProxy, TQT_SIGNAL( sigPresenceInfoExpired() ),
+ this, TQT_SLOT( slotPresenceInfoExpired() ) );
}
AddresseeView::~AddresseeView()
@@ -148,10 +148,10 @@ void AddresseeView::enableLinks( int linkMask )
mLinkMask = linkMask;
}
-QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *proxy, LinkMask linkMask,
+TQString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *proxy, LinkMask linkMask,
bool internalLoading, FieldMask fieldMask )
{
- QString image = QString( "contact_%1_image" ).arg( addr.uid() );
+ TQString image = TQString( "contact_%1_image" ).arg( addr.uid() );
// Style strings from Gentix; this is just an initial version.
//
@@ -160,18 +160,18 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
// placeholder where we fill in something else (in this case,
// the global background color).
//
- QString backgroundColor = KGlobalSettings::alternateBackgroundColor().name();
- QString cellStyle = QString::fromLatin1(
+ TQString backgroundColor = KGlobalSettings::alternateBackgroundColor().name();
+ TQString cellStyle = TQString::fromLatin1(
"style=\""
"padding-right: 2px; "
"border-right: #000 dashed 1px; "
"background: %1;\"").arg(backgroundColor);
- QString backgroundColor2 = KGlobalSettings::baseColor().name();
- QString cellStyle2 = QString::fromLatin1(
+ TQString backgroundColor2 = KGlobalSettings::baseColor().name();
+ TQString cellStyle2 = TQString::fromLatin1(
"style=\""
"padding-left: 2px; "
"background: %1;\"").arg(backgroundColor2);
- QString tableStyle = QString::fromLatin1(
+ TQString tableStyle = TQString::fromLatin1(
"style=\""
"border: solid 1px; "
"margin: 0em;\"");
@@ -179,17 +179,17 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
// 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.
//
- QString rowFmtStr = QString::fromLatin1(
+ TQString rowFmtStr = TQString::fromLatin1(
"<tr>"
"<td align=\"right\" valign=\"top\" width=\"30%\" "); // Tag unclosed
rowFmtStr.append( cellStyle );
- rowFmtStr.append( QString::fromLatin1(
+ rowFmtStr.append( TQString::fromLatin1(
">" // Close tag
"<b>%1</b>"
"</td>"
"<td align=\"left\" valign=\"top\" width=\"70%\" ") ); // Tag unclosed
rowFmtStr.append( cellStyle2 );
- rowFmtStr.append( QString::fromLatin1(
+ rowFmtStr.append( TQString::fromLatin1(
">" // Close tag
"%2"
"</td>"
@@ -197,7 +197,7 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
) );
// Build the table's rows here
- QString dynamicPart;
+ TQString dynamicPart;
if ( !internalLoading ) {
@@ -212,7 +212,7 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
}
if ( fieldMask & BirthdayFields ) {
- QDate date = addr.birthday().date();
+ TQDate date = addr.birthday().date();
if ( date.isValid() )
dynamicPart += rowFmtStr
@@ -224,22 +224,22 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
KABC::PhoneNumber::List phones = addr.phoneNumbers();
KABC::PhoneNumber::List::ConstIterator phoneIt;
for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) {
- QString number = QStyleSheet::escape( (*phoneIt).number() );
+ TQString number = TQStyleSheet::escape( (*phoneIt).number() );
- QString url;
+ TQString url;
if ( (*phoneIt).type() & KABC::PhoneNumber::Fax )
- url = QString::fromLatin1( "fax:" ) + number;
+ url = TQString::fromLatin1( "fax:" ) + number;
else
- url = QString::fromLatin1( "phone:" ) + number;
+ url = TQString::fromLatin1( "phone:" ) + number;
if ( linkMask & PhoneLinks ) {
- QString smsURL;
+ TQString smsURL;
if ( (*phoneIt).type() & KABC::PhoneNumber::Cell )
- smsURL = QString(" (<a href=\"sms:%1\">%2</a>)" ).arg( number ).arg( i18n( "SMS") );
+ smsURL = TQString(" (<a href=\"sms:%1\">%2</a>)" ).arg( number ).arg( i18n( "SMS") );
dynamicPart += rowFmtStr
.arg( (*phoneIt).typeLabel().replace( " ", "&nbsp;" ) )
- .arg( QString::fromLatin1( "<a href=\"%1\">%2</a>%3" ).arg( url ).arg( number ).arg( smsURL ) );
+ .arg( TQString::fromLatin1( "<a href=\"%1\">%2</a>%3" ).arg( url ).arg( number ).arg( smsURL ) );
} else {
dynamicPart += rowFmtStr
.arg( (*phoneIt).typeLabel().replace( " ", "&nbsp;" ) )
@@ -249,17 +249,17 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
}
if ( fieldMask & EmailFields ) {
- QStringList emails = addr.emails();
- QStringList::ConstIterator emailIt;
- QString type = i18n( "Email" );
+ TQStringList emails = addr.emails();
+ TQStringList::ConstIterator emailIt;
+ TQString type = i18n( "Email" );
for ( emailIt = emails.begin(); emailIt != emails.end(); ++emailIt ) {
- QString fullEmail = addr.fullEmail( *emailIt );
- QUrl::encode( fullEmail );
+ TQString fullEmail = addr.fullEmail( *emailIt );
+ TQUrl::encode( fullEmail );
if ( linkMask & EmailLinks ) {
dynamicPart += rowFmtStr.arg( type )
- .arg( QString::fromLatin1( "<a href=\"mailto:%1\">%2</a>" )
- .arg( fullEmail, QStyleSheet::escape( *emailIt ) ) );
+ .arg( TQString::fromLatin1( "<a href=\"mailto:%1\">%2</a>" )
+ .arg( fullEmail, TQStyleSheet::escape( *emailIt ) ) );
} else {
dynamicPart += rowFmtStr.arg( type ).arg( *emailIt );
}
@@ -268,7 +268,7 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
if ( fieldMask & URLFields ) {
if ( !addr.url().url().isEmpty() ) {
- QString url;
+ TQString url;
if ( linkMask & URLLinks ) {
url = (addr.url().url().startsWith( "http://" ) || addr.url().url().startsWith( "https://" ) ? addr.url().prettyURL() :
"http://" + addr.url().prettyURL());
@@ -279,7 +279,7 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
dynamicPart += rowFmtStr.arg( i18n("Homepage") ).arg( url );
}
- QString blog = addr.custom( "KADDRESSBOOK", "BlogFeed" );
+ TQString blog = addr.custom( "KADDRESSBOOK", "BlogFeed" );
if ( !blog.isEmpty() ) {
if ( linkMask & URLLinks ) {
blog = KStringHandler::tagURLs( blog );
@@ -293,12 +293,12 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
KABC::Address::List::ConstIterator addrIt;
for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) {
if ( (*addrIt).label().isEmpty() ) {
- QString formattedAddress;
+ TQString formattedAddress;
- formattedAddress = QStyleSheet::escape( (*addrIt).formattedAddress().stripWhiteSpace() );
+ formattedAddress = TQStyleSheet::escape( (*addrIt).formattedAddress().stripWhiteSpace() );
formattedAddress = formattedAddress.replace( '\n', "<br>" );
- QString link = "<a href=\"addr:" + (*addrIt).id() + "\">" +
+ TQString link = "<a href=\"addr:" + (*addrIt).id() + "\">" +
formattedAddress + "</a>";
if ( linkMask & AddressLinks ) {
@@ -311,7 +311,7 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
.arg( formattedAddress );
}
} else {
- QString link = "<a href=\"addr:" + (*addrIt).id() + "\">" +
+ TQString link = "<a href=\"addr:" + (*addrIt).id() + "\">" +
(*addrIt).label().replace( '\n', "<br>" ) + "</a>";
if ( linkMask & AddressLinks ) {
@@ -327,18 +327,18 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
}
}
- QString notes;
+ TQString notes;
if ( !addr.note().isEmpty() ) {
// @STYLE@ - substitute the cell style in first, and append
// the data afterwards (keeps us safe from possible % signs
// in either one).
- notes = QStyleSheet::escape( addr.note() );
+ notes = TQStyleSheet::escape( addr.note() );
notes = rowFmtStr.arg( i18n( "Notes" ) ).arg( notes.replace( '\n', "<br>" ) ) ;
}
- QString customData;
+ TQString customData;
if ( fieldMask & CustomFields ) {
- static QMap<QString, QString> titleMap;
+ static TQMap<TQString, TQString> titleMap;
if ( titleMap.isEmpty() ) {
titleMap.insert( "Department", i18n( "Department" ) );
titleMap.insert( "Profession", i18n( "Profession" ) );
@@ -350,60 +350,60 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
}
if ( !addr.customs().empty() ) {
- QStringList customs = addr.customs();
- QStringList::Iterator it( customs.begin() );
- const QStringList::Iterator endIt( customs.end() );
+ TQStringList customs = addr.customs();
+ TQStringList::Iterator it( customs.begin() );
+ const TQStringList::Iterator endIt( customs.end() );
for ( ; it != endIt; ++it ) {
- QString customEntry = *it;
+ TQString customEntry = *it;
if ( customEntry.startsWith ( "KADDRESSBOOK-" ) ) {
customEntry.remove( "KADDRESSBOOK-X-" );
customEntry.remove( "KADDRESSBOOK-" );
int pos = customEntry.find( ':' );
- QString key = customEntry.left( pos );
- const QString value = customEntry.mid( pos + 1 );
+ TQString key = customEntry.left( pos );
+ const TQString value = customEntry.mid( pos + 1 );
// blog and im address is handled separated
if ( key == "BlogFeed" || key == "IMAddress" )
continue;
- const QMap<QString, QString>::ConstIterator keyIt = titleMap.find( key );
+ const TQMap<TQString, TQString>::ConstIterator keyIt = titleMap.find( key );
if ( keyIt != titleMap.end() )
key = keyIt.data();
- customData += rowFmtStr.arg( key ).arg( QStyleSheet::escape( value ) ) ;
+ customData += rowFmtStr.arg( key ).arg( TQStyleSheet::escape( value ) ) ;
}
}
}
}
- QString name( QStyleSheet::escape( addr.realName() ) );
- QString role( QStyleSheet::escape( addr.role() ) );
- QString organization( QStyleSheet::escape( addr.organization() ) );
+ TQString name( TQStyleSheet::escape( addr.realName() ) );
+ TQString role( TQStyleSheet::escape( addr.role() ) );
+ TQString organization( TQStyleSheet::escape( addr.organization() ) );
if ( fieldMask & IMFields ) {
- const QString imAddress = addr.custom( "KADDRESSBOOK", "X-IMAddress" );
+ const TQString imAddress = addr.custom( "KADDRESSBOOK", "X-IMAddress" );
if ( !imAddress.isEmpty() ) {
- customData += rowFmtStr.arg( i18n( "IM Address" ) ).arg( QStyleSheet::escape( imAddress ) ) ;
+ customData += rowFmtStr.arg( i18n( "IM Address" ) ).arg( TQStyleSheet::escape( imAddress ) ) ;
}
if ( proxy ) {
if ( proxy->isPresent( addr.uid() ) && proxy->presenceNumeric( addr.uid() ) > 0 ) {
- // set image source to either a QMimeSourceFactory key or a data:/ URL
- QString imgSrc;
+ // set image source to either a TQMimeSourceFactory key or a data:/ URL
+ TQString imgSrc;
if ( internalLoading ) {
- imgSrc = QString::fromLatin1( "im_status_%1_image").arg( addr.uid() );
- QMimeSourceFactory::defaultFactory()->setPixmap( imgSrc, proxy->presenceIcon( 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
- QString imStatus;
+ TQString imStatus;
if ( linkMask & IMLinks )
- imStatus = QString::fromLatin1( "<a href=\"im:\"><img src=\"%1\"> (%2)</a>" );
+ imStatus = TQString::fromLatin1( "<a href=\"im:\"><img src=\"%1\"> (%2)</a>" );
else
- imStatus = QString::fromLatin1( "<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
@@ -421,58 +421,58 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
// do it this way to avoid cases where the substituted string
// contains %1 and the like.
//
- QString strAddr = QString::fromLatin1(
+ TQString strAddr = TQString::fromLatin1(
"<div align=\"center\">"
"<table cellpadding=\"1\" cellspacing=\"0\" %1>"
"<tr>").arg(tableStyle);
- strAddr.append( QString::fromLatin1(
+ strAddr.append( TQString::fromLatin1(
"<td align=\"right\" valign=\"top\" width=\"30%\" rowspan=\"3\" %2>")
.arg( cellStyle ) );
- strAddr.append( QString::fromLatin1(
+ strAddr.append( TQString::fromLatin1(
"<img src=\"%1\" width=\"50\" vspace=\"1\">" // image
"</td>")
.arg( image ) );
- strAddr.append( QString::fromLatin1(
+ strAddr.append( TQString::fromLatin1(
"<td align=\"left\" width=\"70%\" %2>")
.arg( cellStyle2 ) );
- strAddr.append( QString::fromLatin1(
+ strAddr.append( TQString::fromLatin1(
"<font size=\"+2\"><b>%2</b></font></td>" // name
"</tr>")
.arg( name ) );
- strAddr.append( QString::fromLatin1(
+ strAddr.append( TQString::fromLatin1(
"<tr>"
"<td align=\"left\" width=\"70%\" %2>")
.arg( cellStyle2 ) );
- strAddr.append( QString::fromLatin1(
+ strAddr.append( TQString::fromLatin1(
"%3</td>" // role
"</tr>")
.arg( role ) );
- strAddr.append( QString::fromLatin1(
+ strAddr.append( TQString::fromLatin1(
"<tr>"
"<td align=\"left\" width=\"70%\" %2>")
.arg( cellStyle2 ) );
- strAddr.append( QString::fromLatin1(
+ strAddr.append( TQString::fromLatin1(
"%4</td>" // organization
"</tr>")
.arg( organization ) );
- strAddr.append( QString::fromLatin1(
+ strAddr.append( TQString::fromLatin1(
"<tr><td %2>")
.arg( cellStyle ) );
- strAddr.append( QString::fromLatin1(
+ strAddr.append( TQString::fromLatin1(
"&nbsp;</td><td %2>&nbsp;</td></tr>")
.arg( cellStyle2 ) );
strAddr.append( dynamicPart );
strAddr.append( notes );
strAddr.append( customData );
- strAddr.append( QString::fromLatin1( "</table></div>\n" ) );
+ strAddr.append( TQString::fromLatin1( "</table></div>\n" ) );
if ( addr.resource() ) {
- QString addrBookName = addr.resource()->resourceName();
+ TQString addrBookName = addr.resource()->resourceName();
ResourceABC *r = dynamic_cast<ResourceABC*>( addr.resource() );
if ( r && !r->subresources().isEmpty() ) {
- const QString subRes = r->uidToResourceMap()[ addr.uid() ];
- const QString label = r->subresourceLabel( subRes );
+ const TQString subRes = r->uidToResourceMap()[ addr.uid() ];
+ const TQString label = r->subresourceLabel( subRes );
if ( !label.isEmpty() )
addrBookName = label;
}
@@ -481,13 +481,13 @@ QString AddresseeView::vCardAsHTML( const KABC::Addressee& addr, ::KIMProxy *pro
return strAddr;
}
-QString AddresseeView::pixmapAsDataUrl( const QPixmap& pixmap )
+TQString AddresseeView::pixmapAsDataUrl( const TQPixmap& pixmap )
{
- QByteArray ba;
- QBuffer buffer( ba );
+ TQByteArray ba;
+ TQBuffer buffer( ba );
buffer.open( IO_WriteOnly );
pixmap.save( &buffer, "PNG" );
- QString encoded( "data:image/png;base64," );
+ TQString encoded( "data:image/png;base64," );
encoded.append( KCodecs::base64Encode( ba ) );
return encoded;
}
@@ -495,7 +495,7 @@ QString AddresseeView::pixmapAsDataUrl( const QPixmap& pixmap )
void AddresseeView::updateView()
{
// clear view
- setText( QString::null );
+ setText( TQString::null );
if ( mAddressee.isEmpty() )
return;
@@ -523,10 +523,10 @@ void AddresseeView::updateView()
if ( mActionShowCustomFields->isChecked() )
fieldMask |= CustomFields;
- QString strAddr = vCardAsHTML( mAddressee, mKIMProxy, (LinkMask)mLinkMask,
+ TQString strAddr = vCardAsHTML( mAddressee, mKIMProxy, (LinkMask)mLinkMask,
true, (FieldMask)fieldMask );
- strAddr = QString::fromLatin1(
+ strAddr = TQString::fromLatin1(
"<html>"
"<body text=\"%1\" bgcolor=\"%2\">" // text and background color
"%3" // dynamic part
@@ -536,24 +536,24 @@ void AddresseeView::updateView()
.arg( KGlobalSettings::baseColor().name() )
.arg( strAddr );
- QString imageURL = QString( "contact_%1_image" ).arg( mAddressee.uid() );
+ TQString imageURL = TQString( "contact_%1_image" ).arg( mAddressee.uid() );
KABC::Picture picture = mAddressee.photo();
if ( picture.isIntern() && !picture.data().isNull() )
- QMimeSourceFactory::defaultFactory()->setImage( imageURL, picture.data() );
+ TQMimeSourceFactory::defaultFactory()->setImage( imageURL, picture.data() );
else {
if ( !picture.url().isEmpty() ) {
if ( mImageData.count() > 0 )
- QMimeSourceFactory::defaultFactory()->setImage( imageURL, mImageData );
+ TQMimeSourceFactory::defaultFactory()->setImage( imageURL, mImageData );
else {
mImageJob = KIO::get( KURL( picture.url() ), false, false );
- connect( mImageJob, SIGNAL( data( KIO::Job*, const QByteArray& ) ),
- this, SLOT( data( KIO::Job*, const QByteArray& ) ) );
- connect( mImageJob, SIGNAL( result( KIO::Job* ) ),
- this, SLOT( result( KIO::Job* ) ) );
+ connect( mImageJob, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ),
+ this, TQT_SLOT( data( KIO::Job*, const TQByteArray& ) ) );
+ connect( mImageJob, TQT_SIGNAL( result( KIO::Job* ) ),
+ this, TQT_SLOT( result( KIO::Job* ) ) );
}
} else {
- QMimeSourceFactory::defaultFactory()->setPixmap( imageURL,
+ TQMimeSourceFactory::defaultFactory()->setPixmap( imageURL,
KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 128 ) );
}
}
@@ -567,24 +567,24 @@ KABC::Addressee AddresseeView::addressee() const
return mAddressee;
}
-void AddresseeView::urlClicked( const QString &url )
+void AddresseeView::urlClicked( const TQString &url )
{
kapp->invokeBrowser( url );
}
-void AddresseeView::emailClicked( const QString &email )
+void AddresseeView::emailClicked( const TQString &email )
{
if ( email.startsWith( "mailto:" ) )
- kapp->invokeMailer( email.mid( 7 ), QString::null );
+ kapp->invokeMailer( email.mid( 7 ), TQString::null );
else
- kapp->invokeMailer( email, QString::null );
+ kapp->invokeMailer( email, TQString::null );
}
-void AddresseeView::phoneNumberClicked( const QString &number )
+void AddresseeView::phoneNumberClicked( const TQString &number )
{
KConfig config( "kaddressbookrc" );
config.setGroup( "General" );
- QString commandLine = config.readEntry( "PhoneHookApplication" );
+ TQString commandLine = config.readEntry( "PhoneHookApplication" );
if ( commandLine.isEmpty() ) {
KMessageBox::sorry( this, i18n( "There is no application set which could be executed. Please go to the settings dialog and configure one." ) );
@@ -595,11 +595,11 @@ void AddresseeView::phoneNumberClicked( const QString &number )
KRun::runCommand( commandLine );
}
-void AddresseeView::smsTextClicked( const QString &number )
+void AddresseeView::smsTextClicked( const TQString &number )
{
KConfig config( "kaddressbookrc" );
config.setGroup( "General" );
- QString commandLine = config.readEntry( "SMSHookApplication" );
+ TQString commandLine = config.readEntry( "SMSHookApplication" );
if ( commandLine.isEmpty() ) {
KMessageBox::sorry( this, i18n( "There is no application set which could be executed. Please go to the settings dialog and configure one." ) );
@@ -612,14 +612,14 @@ void AddresseeView::smsTextClicked( const QString &number )
sendSMS ( number, dlg.text() );
}
-void AddresseeView::sendSMS( const QString &number, const QString &text )
+void AddresseeView::sendSMS( const TQString &number, const TQString &text )
{
KConfig config( "kaddressbookrc" );
config.setGroup( "General" );
- QString commandLine = config.readEntry( "SMSHookApplication" );
+ TQString commandLine = config.readEntry( "SMSHookApplication" );
KTempFile file ;
- QTextStream* stream = file.textStream();
+ TQTextStream* stream = file.textStream();
*stream << text;
file.close();
@@ -629,11 +629,11 @@ void AddresseeView::sendSMS( const QString &number, const QString &text )
KRun::runCommand( commandLine );
}
-void AddresseeView::faxNumberClicked( const QString &number )
+void AddresseeView::faxNumberClicked( const TQString &number )
{
KConfig config( "kaddressbookrc" );
config.setGroup( "General" );
- QString commandLine = config.readEntry( "FaxHookApplication", "kdeprintfax --phone %N" );
+ TQString commandLine = config.readEntry( "FaxHookApplication", "kdeprintfax --phone %N" );
if ( commandLine.isEmpty() ) {
KMessageBox::sorry( this, i18n( "There is no application set which could be executed. Please go to the settings dialog and configure one." ) );
@@ -649,9 +649,9 @@ void AddresseeView::imAddressClicked()
mKIMProxy->chatWithContact( mAddressee.uid() );
}
-QPopupMenu *AddresseeView::createPopupMenu( const QPoint& )
+TQPopupMenu *AddresseeView::createPopupMenu( const TQPoint& )
{
- QPopupMenu *menu = new QPopupMenu( this );
+ TQPopupMenu *menu = new TQPopupMenu( this );
mActionShowBirthday->plug( menu );
mActionShowAddresses->plug( menu );
mActionShowEmails->plug( menu );
@@ -663,12 +663,12 @@ QPopupMenu *AddresseeView::createPopupMenu( const QPoint& )
return menu;
}
-void AddresseeView::slotMailClicked( const QString&, const QString &email )
+void AddresseeView::slotMailClicked( const TQString&, const TQString &email )
{
emailClicked( email );
}
-void AddresseeView::slotUrlClicked( const QString &url )
+void AddresseeView::slotUrlClicked( const TQString &url )
{
if ( url.startsWith( "phone:" ) )
phoneNumberClicked( strippedNumber( url.mid( 8 ) ) );
@@ -684,27 +684,27 @@ void AddresseeView::slotUrlClicked( const QString &url )
urlClicked( url );
}
-void AddresseeView::slotHighlighted( const QString &link )
+void AddresseeView::slotHighlighted( const TQString &link )
{
if ( link.startsWith( "mailto:" ) ) {
- QString email = link.mid( 7 );
+ TQString email = link.mid( 7 );
emit emailHighlighted( email );
emit highlightedMessage( i18n( "Send mail to '%1'" ).arg( email ) );
} else if ( link.startsWith( "phone:" ) ) {
- QString number = link.mid( 8 );
+ TQString number = link.mid( 8 );
emit phoneNumberHighlighted( strippedNumber( number ) );
emit highlightedMessage( i18n( "Call number %1" ).arg( number ) );
} else if ( link.startsWith( "fax:" ) ) {
- QString number = link.mid( 6 );
+ TQString number = link.mid( 6 );
emit faxNumberHighlighted( strippedNumber( 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:" ) ) {
- QString number = link.mid( 6 );
+ TQString number = link.mid( 6 );
emit highlightedMessage( i18n( "Send SMS to %1" ).arg( number ) );
} else if ( link.startsWith( "http:" ) || link.startsWith( "https:" ) ) {
emit urlHighlighted( link );
@@ -715,7 +715,7 @@ void AddresseeView::slotHighlighted( const QString &link )
emit highlightedMessage( "" );
}
-void AddresseeView::slotPresenceChanged( const QString &uid )
+void AddresseeView::slotPresenceChanged( const TQString &uid )
{
kdDebug() << k_funcinfo << " uid is: " << uid << " mAddressee is: " << mAddressee.uid() << endl;
if ( uid == mAddressee.uid() )
@@ -734,7 +734,7 @@ void AddresseeView::configChanged()
updateView();
}
-void AddresseeView::data( KIO::Job*, const QByteArray &d )
+void AddresseeView::data( KIO::Job*, const TQByteArray &d )
{
unsigned int oldSize = mImageData.size();
mImageData.resize( oldSize + d.size() );
@@ -776,12 +776,12 @@ void AddresseeView::save()
mConfig->sync();
}
-QString AddresseeView::strippedNumber( const QString &number )
+TQString AddresseeView::strippedNumber( const TQString &number )
{
- QString retval;
+ TQString retval;
for ( uint i = 0; i < number.length(); ++i ) {
- QChar c = number[ i ];
+ TQChar c = number[ i ];
if ( c.isDigit() || c == '*' || c == '#' || c == '+' && i == 0 )
retval.append( c );
}