git://git.nikiroo.be
/
jvcard.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix timestamp not updated after save
[jvcard.git]
/
src
/
be
/
nikiroo
/
jvcard
/
Card.java
diff --git
a/src/be/nikiroo/jvcard/Card.java
b/src/be/nikiroo/jvcard/Card.java
index de5ab67a604207f0d294f3d9a7652a460c4754a3..7939263bfc60b3201458810a735c3690df041077 100644
(file)
--- a/
src/be/nikiroo/jvcard/Card.java
+++ b/
src/be/nikiroo/jvcard/Card.java
@@
-40,12
+40,10
@@
public class Card extends BaseClass<Contact> {
* if format is NULL
*/
public Card(File file, Format format) throws IOException {
* if format is NULL
*/
public Card(File file, Format format) throws IOException {
- this(Parser.parse(file, format));
+ this(Parser.parse
Contact
(file, format));
- if (file != null) {
- if (file.exists()) {
- lastModified = file.lastModified();
- }
+ if (file != null && file.exists()) {
+ lastModified = file.lastModified();
}
this.format = format;
}
this.format = format;
@@
-105,6
+103,7
@@
public class Card extends BaseClass<Contact> {
if (this.file != null
&& file.getCanonicalPath().equals(this.file.getCanonicalPath())) {
if (this.file != null
&& file.getCanonicalPath().equals(this.file.getCanonicalPath())) {
+ lastModified = file.lastModified();
setPristine();
}
setPristine();
}
@@
-135,8
+134,10
@@
public class Card extends BaseClass<Contact> {
if (file == null)
return false;
if (file == null)
return false;
- this.replaceListContent(Parser.parse(file, format));
+ this.replaceListContent(Parser.parseContact(file, format));
+ lastModified = file.lastModified();
setPristine();
setPristine();
+
return true;
}
return true;
}
@@
-150,7
+151,12
@@
public class Card extends BaseClass<Contact> {
* @return the {@link String}
*/
public String toString(Format format) {
* @return the {@link String}
*/
public String toString(Format format) {
- return Parser.toString(this, format);
+ StringBuilder builder = new StringBuilder();
+ for (String line : Parser.toStrings(this, format)) {
+ builder.append(line);
+ builder.append("\r\n");
+ }
+ return builder.toString();
}
/**
}
/**