author | zautrix <zautrix> | 2005-03-29 18:35:10 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-29 18:35:10 (UTC) |
commit | b70d9695bb6a2d567b75965c0530792ad90c84a3 (patch) (unidiff) | |
tree | bc27647d044cf4a8d9c75acd19d9a2d078fe00b2 /kabc | |
parent | a7c827aa0e555206b60dec3bc07f7afab4352883 (diff) | |
download | kdepimpi-b70d9695bb6a2d567b75965c0530792ad90c84a3.zip kdepimpi-b70d9695bb6a2d567b75965c0530792ad90c84a3.tar.gz kdepimpi-b70d9695bb6a2d567b75965c0530792ad90c84a3.tar.bz2 |
icons
-rw-r--r-- | kabc/addresseeview.cpp | 10 |
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 | |||
@@ -223,74 +223,80 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) | |||
223 | notes = QString( | 223 | notes = QString( |
224 | "<tr>" | 224 | "<tr>" |
225 | "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label | 225 | "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label |
226 | "<td align=\"left\">%2</td>" // note | 226 | "<td align=\"left\">%2</td>" // note |
227 | "</tr>" ).arg( i18n( "Notes" ) ) | 227 | "</tr>" ).arg( i18n( "Notes" ) ) |
228 | //US .arg( mAddressee.note().replace( '\n', "<br>" ) ); | 228 | //US .arg( mAddressee.note().replace( '\n', "<br>" ) ); |
229 | .arg( mAddressee.note().replace( QRegExp("\n"), "<br>" ) ); | 229 | .arg( mAddressee.note().replace( QRegExp("\n"), "<br>" ) ); |
230 | //qDebug("AddresseeView::setAddressee has to be verified."); | 230 | //qDebug("AddresseeView::setAddressee has to be verified."); |
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\"> </td>" | 283 | "<td colspan=\"2\"> </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 ) |
289 | .arg( aRole ) | 295 | .arg( aRole ) |
290 | .arg( aOrga ) | 296 | .arg( aOrga ) |
291 | .arg( dynamicPart ) | 297 | .arg( dynamicPart ) |
292 | .arg( notes ); | 298 | .arg( notes ); |
293 | 299 | ||
294 | } else { // no picture! | 300 | } else { // no picture! |
295 | 301 | ||
296 | mText = "<table width=\"100%\">\n"; | 302 | mText = "<table width=\"100%\">\n"; |