X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Ftui%2Fpanes%2FContactDetails.java;h=08df4034165c761931a0fedebcf5eebf241d0058;hp=8aeac19f27002419035c58ba6218cf36a692bc82;hb=2a96e7b2cf3f155cccc633272b2f547ffd8f4672;hpb=ef431d801e4e42da46c5c81e7ee7c821f9fb266d diff --git a/src/be/nikiroo/jvcard/tui/panes/ContactDetails.java b/src/be/nikiroo/jvcard/tui/panes/ContactDetails.java index 8aeac19..08df403 100644 --- a/src/be/nikiroo/jvcard/tui/panes/ContactDetails.java +++ b/src/be/nikiroo/jvcard/tui/panes/ContactDetails.java @@ -62,19 +62,16 @@ public class ContactDetails extends MainContent { /** * Change the enclosed {@link Contact} from this {@link ContactDetails}. + * Also re-set the image. * * @param contact * the new {@link Contact} */ public void setContact(Contact contact) { - if (this.contact == contact) - return; - this.contact = contact; + image = null; - if (contact == null) { - image = null; - } else { + if (contact != null) { infoPanel.removeAllComponents(); String name = contact.getPreferredDataValue("FN"); @@ -106,14 +103,13 @@ public class ContactDetails extends MainContent { Data photo = contact.getPreferredData("PHOTO"); if (photo != null) { TypeInfo encoding = null; - TypeInfo type = null; for (int index = 0; index < photo.size(); index++) { TypeInfo info = photo.get(index); if (info.getName() != null) { if (info.getName().equalsIgnoreCase("ENCODING")) encoding = info; - if (info.getName().equalsIgnoreCase("TYPE")) - type = info; + // We don't check for the "TYPE" anymore, we just defer + // it to ImageIcon } }