Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
digiKam
Commits
f6bcec9d
Commit
f6bcec9d
authored
Nov 14, 2014
by
Marcel Wiesweg
Browse files
Some fixes in face progress calculation
parent
7cb6d0e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
utilities/facemanagement/facepipeline.cpp
View file @
f6bcec9d
...
...
@@ -1171,6 +1171,7 @@ void FacePipeline::Private::send(FacePipelineExtendedPackage::Ptr package)
{
start
();
++
totalPackagesAdded
;
emit
(
q
->
processing
(
*
package
));
if
(
senderFlowControl
(
package
))
{
...
...
utilities/facemanagement/facepipeline.h
View file @
f6bcec9d
...
...
@@ -292,6 +292,8 @@ Q_SIGNALS:
/// Emitted when processing has started
void
started
(
const
QString
&
message
);
/// Emitted when one package begins processing
void
processing
(
const
FacePipelinePackage
&
package
);
/// Emitted when one package has finished processing
void
processed
(
const
FacePipelinePackage
&
package
);
void
progressValueChanged
(
float
progress
);
...
...
utilities/maintenance/facedetector.cpp
View file @
f6bcec9d
...
...
@@ -96,18 +96,27 @@ class FaceDetector::Private
public:
Private
()
:
benchmark
(
false
),
total
(
0
),
progressValue
(
0
),
currentProgressChunk
(
0
),
currentScheduled
(
0
),
currentFinished
(
0
)
{
benchmark
=
false
;
total
=
0
;
}
bool
benchmark
;
bool
benchmark
;
int
total
;
int
total
;
AlbumPointerList
<>
albumTodoList
;
ImageInfoJob
albumListing
;
FacePipeline
pipeline
;
AlbumPointerList
<>
albumTodoList
;
ImageInfoJob
albumListing
;
FacePipeline
pipeline
;
QMap
<
Album
*
,
double
>
relativeProgressValue
;
double
progressValue
;
double
currentProgressChunk
;
int
currentScheduled
;
int
currentFinished
;
};
FaceDetector
::
FaceDetector
(
const
FaceScanSettings
&
settings
,
ProgressItem
*
const
parent
)
...
...
@@ -275,25 +284,33 @@ void FaceDetector::slotStart()
QApplication
::
restoreOverrideCursor
();
}
d
->
total
=
0
;
// first, we use the relativeProgressValue map to store absolute counts
foreach
(
Album
*
const
album
,
d
->
albumTodoList
)
{
if
(
album
->
type
()
==
Album
::
PHYSICAL
)
{
d
->
total
+
=
palbumCounts
.
value
(
album
->
id
());
d
->
relativeProgressValue
[
album
]
=
palbumCounts
.
value
(
album
->
id
());
}
else
// this is possibly broken of course because we do not know if images have multiple tags,
// but there's no better solution without expensive operation
{
d
->
total
+
=
talbumCounts
.
value
(
album
->
id
());
d
->
relativeProgressValue
[
album
]
=
talbumCounts
.
value
(
album
->
id
());
}
}
kDebug
()
<<
"Total is"
<<
d
->
total
;
// second, calculate (approximate) overall sum
d
->
total
=
0
;
foreach
(
double
count
,
d
->
relativeProgressValue
)
{
d
->
total
+=
(
int
)
count
;
}
d
->
total
=
qMax
(
1
,
d
->
total
);
kDebug
()
<<
"Total is"
<<
d
->
total
;
// third, break absolute to relative values
for
(
QMap
<
Album
*
,
double
>::
iterator
it
=
d
->
relativeProgressValue
.
begin
();
it
!=
d
->
relativeProgressValue
.
end
();
++
it
)
{
it
.
value
()
/=
double
(
d
->
total
);
}
setUsesBusyIndicator
(
false
);
setTotalItems
(
d
->
total
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment