git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Progress handling in BasicOutput
[fanfix.git]
/
src
/
be
/
nikiroo
/
fanfix
/
reader
/
LocalReader.java
diff --git
a/src/be/nikiroo/fanfix/reader/LocalReader.java
b/src/be/nikiroo/fanfix/reader/LocalReader.java
index 88ffc5d42d534dbbfbf1fa7d89c8de310ec4d79a..a28d4feadeeeb4502da949661923619acc16d241 100644
(file)
--- a/
src/be/nikiroo/fanfix/reader/LocalReader.java
+++ b/
src/be/nikiroo/fanfix/reader/LocalReader.java
@@
-59,10
+59,18
@@
class LocalReader extends BasicReader {
* in case of I/O error
*/
public void imprt(String luid, Progress pg) throws IOException {
* in case of I/O error
*/
public void imprt(String luid, Progress pg) throws IOException {
+ Progress pgGetStory = new Progress();
+ Progress pgSave = new Progress();
+ if (pg != null) {
+ pg.setMax(2);
+ pg.addProgress(pgGetStory, 1);
+ pg.addProgress(pgSave, 1);
+ }
+
try {
try {
- Story story = Instance.getLibrary().getStory(luid, pg);
+ Story story = Instance.getLibrary().getStory(luid, pg
GetStory
);
if (story != null) {
if (story != null) {
- story = lib.save(story, luid);
+ story = lib.save(story, luid
, pgSave
);
} else {
throw new IOException("Cannot find story in Library: " + luid);
}
} else {
throw new IOException("Cannot find story in Library: " + luid);
}