Skip to content

Commit

Permalink
Fix file saving (nickbnf#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
variar committed Dec 24, 2020
1 parent edf980f commit 576b91d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/ui/src/abstractlogview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,8 @@ void AbstractLogView::saveToFile()
using LinesData = std::pair<std::vector<QString>, bool>;
auto lineReader = tbb::flow::source_node<LinesData>(
saveFileGraph,
[ this, &offsets, &interruptRequest, &progressDialog,
offsetIndex = 0u ]( LinesData& lines ) mutable -> bool {
[ this, &offsets, &interruptRequest, &progressDialog, offsetIndex = 0u,
finalLines = false ]( LinesData& lines ) mutable -> bool {
if ( !interruptRequest && offsetIndex < offsets.size() ) {
const auto& offset = offsets.at( offsetIndex );
lines.first = logData->getLines( offset.first, offset.second );
Expand All @@ -1103,9 +1103,12 @@ void AbstractLogView::saveToFile()
progressDialog.setValue( static_cast<int>( offsetIndex ) );
return true;
}
else {
else if ( !finalLines ) {
finalLines = true;
lines.second = false;

return true;
}
else {
return false;
}
},
Expand Down

0 comments on commit 576b91d

Please sign in to comment.