Skip to content

Commit

Permalink
- send the number of slide completed instead of page number
Browse files Browse the repository at this point in the history
  • Loading branch information
ritzalam committed Mar 9, 2012
1 parent b17cf9a commit d8274e0
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,17 @@ public PdfToSwfSlide call() {
tasks.add(task);
completionService.submit(c);
}


int slidesCompleted = 0;

for (final PdfToSwfSlide slide : slides) {
Future<PdfToSwfSlide> future = null;
try {
future = completionService.poll(MAXWAIT, TimeUnit.MILLISECONDS);
if (future != null) {
PdfToSwfSlide s = future.get();
notifier.sendConversionUpdateMessage(s.getPageNumber(), pres);
slidesCompleted++;
notifier.sendConversionUpdateMessage(slidesCompleted, pres);
} else {
log.info("Timedout waiting for page to finish conversion.");
}
Expand All @@ -144,8 +147,8 @@ public PdfToSwfSlide call() {
for (final PdfToSwfSlide slide : slides) {
if (! slide.isDone()){
log.warn("Creating blank slide for " + slide.getPageNumber());
slide.generateBlankSlide();
notifier.sendConversionUpdateMessage(slide.getPageNumber(), pres);
slide.generateBlankSlide();
notifier.sendConversionUpdateMessage(slidesCompleted++, pres);
}
}
}
Expand Down

0 comments on commit d8274e0

Please sign in to comment.