X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2FCard.java;h=65ab6fa5225b91fdacdd3430fdc52abdbb317395;hp=a9018ca066d1cc590fcb92b76ce884919150a1ea;hb=0b0b2b0ff1f5e21f7b0feb955b4b54855fb3d508;hpb=9c8baf0c360173b864683176c567757429c4fb12 diff --git a/src/be/nikiroo/jvcard/Card.java b/src/be/nikiroo/jvcard/Card.java index a9018ca..65ab6fa 100644 --- a/src/be/nikiroo/jvcard/Card.java +++ b/src/be/nikiroo/jvcard/Card.java @@ -24,10 +24,15 @@ public class Card { private List contacts; private File file; private boolean dirty; + private String name; public Card(File file, Format format) throws IOException { this.file = file; + if (file != null) { + name = file.getName(); + } + BufferedReader buffer = new BufferedReader(new FileReader(file)); List lines = new LinkedList(); for (String line = buffer.readLine(); line != null; line = buffer @@ -36,6 +41,7 @@ public class Card { } load(lines, format); + dirty = false; // initial load, so no change yet } public List getContacts() { @@ -88,6 +94,15 @@ public class Card { return dirty; } + /** + * Return the name of this card. + * + * @return the name + */ + public String getName() { + return name; + } + /** * Notify that this element has unsaved changes. */