From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'kabc/addresseeview.cpp') diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp index cde19a1..425e67c 100644 --- a/kabc/addresseeview.cpp +++ b/kabc/addresseeview.cpp @@ -27,23 +27,28 @@ #include #include //US #include -#include +#include #include #include -#include +#include #include #include #include #include #include #ifdef DESKTOP_VERSION -#include +#include #include #include #endif +#include -#include +#include +//Added by qt3to4: +#include +#include +#include #include "externalapphandler.h" #include @@ -59,7 +64,7 @@ using namespace KABC; bool AddresseeView::sFullDetailsMode = false; AddresseeView::AddresseeView( QWidget *parent, const char *name ) - : QTextBrowser( parent, name ) + : Q3TextBrowser( parent, name ) { @@ -82,7 +87,7 @@ void AddresseeView::printMe() return; QPainter p; p.begin ( &printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); @@ -402,7 +407,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) { picString = ""; if ( picAvailintern ) { - QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() ); + Q3MimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() ); int wid = picture.data().width(); int hei = picture.data().height(); if ( wid > 128 || hei > 128 ) { @@ -418,7 +423,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) } else { if ( picAvailUrl ) { QPixmap picPix( picture.url() ); - QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", picPix ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "myimage", picPix ); int wid = picPix.width(); int hei = picPix.height(); if ( wid > 128 || hei > 128 ) { @@ -435,7 +440,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) if ( !mAddressee.custom( "KADDRESSBOOK", "X-Children" ).isEmpty() ) { static bool setDefaultImageChildren = false; if ( !setDefaultImageChildren ) { - QMimeSourceFactory::defaultFactory()->setPixmap( "familyIcon", KGlobal::iconLoader()->loadIcon( "ic_kids", KIcon::Desktop, 128 ) ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "familyIcon", KGlobal::iconLoader()->loadIcon( "ic_kids", KIcon::Desktop, 128 ) ); setDefaultImageChildren = true; } picString = ""; @@ -443,7 +448,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) } else if ( !mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ).isEmpty() ) { static bool setDefaultImagepouses = false; if ( !setDefaultImagepouses ) { - QMimeSourceFactory::defaultFactory()->setPixmap( "SpousesIcon", KGlobal::iconLoader()->loadIcon( "ic_family", KIcon::Desktop, 128 ) ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "SpousesIcon", KGlobal::iconLoader()->loadIcon( "ic_family", KIcon::Desktop, 128 ) ); setDefaultImagepouses = true; } picString = ""; @@ -452,7 +457,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) if ( gen == "male" ) { static bool setDefaultImageMale = false; if ( !setDefaultImageMale ) { - QMimeSourceFactory::defaultFactory()->setPixmap( "MaleIcon", KGlobal::iconLoader()->loadIcon( "ic_male", KIcon::Desktop, 128 ) ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "MaleIcon", KGlobal::iconLoader()->loadIcon( "ic_male", KIcon::Desktop, 128 ) ); setDefaultImageMale = true; } picString = ""; @@ -460,7 +465,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) } else if ( gen == "female" ) { static bool setDefaultImageFemale = false; if ( !setDefaultImageFemale ) { - QMimeSourceFactory::defaultFactory()->setPixmap( "FemaleIcon", KGlobal::iconLoader()->loadIcon( "ic_female", KIcon::Desktop, 128 ) ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "FemaleIcon", KGlobal::iconLoader()->loadIcon( "ic_female", KIcon::Desktop, 128 ) ); setDefaultImageFemale = true; } picString = ""; @@ -469,7 +474,7 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) static bool setDefaultImage = false; if ( !setDefaultImage ) { //qDebug("Setting default pixmap "); - QMimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) ); setDefaultImage = true; } picString = ""; @@ -653,7 +658,7 @@ void AddresseeView::addTag(const QString & tag,const QString & text) { if ( text.isEmpty() ) return; - int number=text.contains("\n"); + int number=text.count("\n"); QString str = "<" + tag + ">"; QString tmpText=text; QString tmpStr=str; @@ -688,24 +693,24 @@ AddresseeChooser::AddresseeChooser( KABC::Addressee loc, KABC::Addressee rem, bo findButton( User1 )->setText( i18n("Local")); QWidget* topframe = new QWidget( this ); setMainWidget( topframe ); - QBoxLayout* bl; + Q3BoxLayout* bl; if ( QApplication::desktop()->width() < 640 ) { - bl = new QVBoxLayout( topframe ); + bl = new Q3VBoxLayout( topframe ); } else { - bl = new QHBoxLayout( topframe ); + bl = new Q3HBoxLayout( topframe ); } - QVBox* subframe = new QVBox( topframe ); + Q3VBox* subframe = new Q3VBox( topframe ); bl->addWidget(subframe ); QLabel* lab = new QLabel( i18n("Local Addressee"), subframe ); if ( takeloc ) - lab->setBackgroundColor(Qt::green.light() ); + lab->setBackgroundColor(QColor(Qt::green).light() ); AddresseeView * av = new AddresseeView( subframe ); av->setAddressee( loc ); - subframe = new QVBox( topframe ); + subframe = new Q3VBox( topframe ); bl->addWidget(subframe ); lab = new QLabel( i18n("Remote Addressee"), subframe ); if ( !takeloc ) - lab->setBackgroundColor(Qt::green.light() ); + lab->setBackgroundColor(QColor(Qt::green).light() ); av = new AddresseeView( subframe ); av->setAddressee( rem ); QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); -- cgit v0.9.0.2