summaryrefslogtreecommitdiffabout
path: root/kabc
Unidiff
Diffstat (limited to 'kabc') (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 )
231 } 231 }
232 232
233 QString aRole = ""; 233 QString aRole = "";
234 QString aOrga = ""; 234 QString aOrga = "";
235 if ( true /*!mAddressee.role().isEmpty()*/ ) { 235 if ( true /*!mAddressee.role().isEmpty()*/ ) {
236 aRole = "<tr>" 236 aRole = "<tr>"
237 "<td align=\"left\">" + mAddressee.role() + "</td>" 237 "<td align=\"left\">" + mAddressee.role() + "</td>"
238 "</tr>"; 238 "</tr>";
239 } 239 }
240 if ( true /*!mAddressee.organization().isEmpty()*/ ) { 240 if ( true /*!mAddressee.organization().isEmpty()*/ ) {
241 aOrga = "<tr>" 241 aOrga = "<tr>"
242 "<td align=\"left\">" + mAddressee.organization() + "</td>" 242 "<td align=\"left\">" + mAddressee.organization() + "</td>"
243 "</tr>"; 243 "</tr>";
244 } 244 }
245 mText = ""; 245 mText = "";
246 QString picString = ""; 246 QString picString = "";
247 KABC::Picture picture = mAddressee.photo(); 247 KABC::Picture picture = mAddressee.photo();
248 bool picAvailintern = false; 248 bool picAvailintern = false;
249 bool picAvailUrl = false; 249 bool picAvailUrl = false;
250 if (! picture.undefined() ) { 250 if (! picture.undefined() ) {
251 picAvailintern = (picture.isIntern() && !picture.data().isNull()); 251 picAvailintern = (picture.isIntern() && !picture.data().isNull());
252 picAvailUrl = !picture.isIntern() && QFile::exists(picture.url() ); 252 picAvailUrl = !picture.isIntern() && QFile::exists(picture.url() );
253 } 253 }
254 if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) { 254 if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) {
255 picString = "<img src=\"myimage\" width=\"50\" height=\"70\">";
255 if ( picAvailintern ) { 256 if ( picAvailintern ) {
256 QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() ); 257 QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() );
257 } else { 258 } else {
258 if ( picAvailUrl ) { 259 if ( picAvailUrl ) {
259 QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", QPixmap( picture.url() )); 260 QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", QPixmap( picture.url() ));
260 } else { 261 } else {
261 QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", KGlobal::iconLoader()->loadIcon( "package_toys", KIcon::Desktop, 128 ) ); 262 static bool setDefaultImage = false;
263 if ( !setDefaultImage ) {
264 qDebug("Setting default pixmap ");
265 QMimeSourceFactory::defaultFactory()->setPixmap( "defaultPenguin", KGlobal::iconLoader()->loadIcon( "package_toys", KIcon::Desktop, 128 ) );
266 setDefaultImage = true;
267 }
268 picString = "<img src=\"defaultPenguin\" width=\"64\" height=\"64\">";
262 } 269 }
263 } 270 }
264 picString = "<img src=\"myimage\" width=\"50\" height=\"70\">";
265 mText = QString::fromLatin1( 271 mText = QString::fromLatin1(
266 "<html>" 272 "<html>"
267 "<body text=\"%1\" bgcolor=\"%2\">" // text and background color 273 "<body text=\"%1\" bgcolor=\"%2\">" // text and background color
268 "<table>" 274 "<table>"
269 "<tr>" 275 "<tr>"
270 "<td rowspan=\"3\" align=\"right\" valign=\"top\">" 276 "<td rowspan=\"3\" align=\"right\" valign=\"top\">"
271 "%3" 277 "%3"
272 "</td>" 278 "</td>"
273 "<td align=\"left\"><font size=\"+2\"><b>%4</b></font></td>" // name 279 "<td align=\"left\"><font size=\"+2\"><b>%4</b></font></td>" // name
274 "</tr>" 280 "</tr>"
275 "%5" // role 281 "%5" // role
276 "%6" // organization 282 "%6" // organization
277 "<td colspan=\"2\">&nbsp;</td>" 283 "<td colspan=\"2\">&nbsp;</td>"
278 "%7" // dynamic part 284 "%7" // dynamic part
279 "%8" // notes 285 "%8" // notes
280 "</table>" 286 "</table>"
281 "</body>" 287 "</body>"
282 "</html>") 288 "</html>")
283//US 289//US
284 .arg( /*KGlobalSettings::textColor().name()*/ "black" ) 290 .arg( /*KGlobalSettings::textColor().name()*/ "black" )
285//US 291//US
286 .arg( /*KGlobalSettings::baseColor().name()*/ "white" ) 292 .arg( /*KGlobalSettings::baseColor().name()*/ "white" )
287 .arg( picString ) 293 .arg( picString )
288 .arg( name ) 294 .arg( name )