summaryrefslogtreecommitdiffabout
path: root/kabc/addresseeview.cpp
Side-by-side diff
Diffstat (limited to 'kabc/addresseeview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addresseeview.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp
index e85991e..8f104e0 100644
--- a/kabc/addresseeview.cpp
+++ b/kabc/addresseeview.cpp
@@ -231,58 +231,64 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee )
}
QString aRole = "";
QString aOrga = "";
if ( true /*!mAddressee.role().isEmpty()*/ ) {
aRole = "<tr>"
"<td align=\"left\">" + mAddressee.role() + "</td>"
"</tr>";
}
if ( true /*!mAddressee.organization().isEmpty()*/ ) {
aOrga = "<tr>"
"<td align=\"left\">" + mAddressee.organization() + "</td>"
"</tr>";
}
mText = "";
QString picString = "";
KABC::Picture picture = mAddressee.photo();
bool picAvailintern = false;
bool picAvailUrl = false;
if (! picture.undefined() ) {
picAvailintern = (picture.isIntern() && !picture.data().isNull());
picAvailUrl = !picture.isIntern() && QFile::exists(picture.url() );
}
if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) {
+ picString = "<img src=\"myimage\" width=\"50\" height=\"70\">";
if ( picAvailintern ) {
QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() );
} else {
if ( picAvailUrl ) {
QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", QPixmap( picture.url() ));
} else {
- QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", KGlobal::iconLoader()->loadIcon( "package_toys", KIcon::Desktop, 128 ) );
+ static bool setDefaultImage = false;
+ if ( !setDefaultImage ) {
+ qDebug("Setting default pixmap ");
+ QMimeSourceFactory::defaultFactory()->setPixmap( "defaultPenguin", KGlobal::iconLoader()->loadIcon( "package_toys", KIcon::Desktop, 128 ) );
+ setDefaultImage = true;
+ }
+ picString = "<img src=\"defaultPenguin\" width=\"64\" height=\"64\">";
}
}
- picString = "<img src=\"myimage\" width=\"50\" height=\"70\">";
mText = QString::fromLatin1(
"<html>"
"<body text=\"%1\" bgcolor=\"%2\">" // text and background color
"<table>"
"<tr>"
"<td rowspan=\"3\" align=\"right\" valign=\"top\">"
"%3"
"</td>"
"<td align=\"left\"><font size=\"+2\"><b>%4</b></font></td>" // name
"</tr>"
"%5" // role
"%6" // organization
"<td colspan=\"2\">&nbsp;</td>"
"%7" // dynamic part
"%8" // notes
"</table>"
"</body>"
"</html>")
//US
.arg( /*KGlobalSettings::textColor().name()*/ "black" )
//US
.arg( /*KGlobalSettings::baseColor().name()*/ "white" )
.arg( picString )
.arg( name )