mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:13:24 +00:00
Fix helper function
Avoid counting the selected dives - we have that number. But also don't return 0 because we devide by the total work for the progress bar. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4bdead6ad6
commit
094264014d
1 changed files with 4 additions and 9 deletions
|
@ -2,18 +2,13 @@
|
||||||
|
|
||||||
#include "templatelayout.h"
|
#include "templatelayout.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
#include "display.h"
|
||||||
|
|
||||||
int getTotalWork()
|
int getTotalWork()
|
||||||
{
|
{
|
||||||
int dives = 0, i;
|
// return the correct number depending on all/selected dives
|
||||||
struct dive *dive;
|
// but don't return 0 as we might divide by this number
|
||||||
for_each_dive (i, dive) {
|
return amount_selected ? amount_selected : 1;
|
||||||
//TODO check for exporting selected dives only
|
|
||||||
if (!dive->selected)
|
|
||||||
continue;
|
|
||||||
dives++;
|
|
||||||
}
|
|
||||||
return dives;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TemplateLayout::TemplateLayout(print_options *PrintOptions) :
|
TemplateLayout::TemplateLayout(print_options *PrintOptions) :
|
||||||
|
|
Loading…
Add table
Reference in a new issue