<table><tr><td style="">TallFurryMan requested changes to this revision.<br />TallFurryMan added inline comments.<br />This revision now requires changes to proceed.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D20029">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D20029#inline-112519">View Inline</a><span style="color: #4b4d51; font-weight: bold;">scheduler.cpp:1455</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">    {
</div><div style="padding: 0 8px; margin: 0 4px; ">        appendLogText(i18n("No jobs left in the scheduler queue."));
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        setCurrentJob(nullptr);
</div><div style="padding: 0 8px; margin: 0 4px; ">        jobEvaluationOnly = false;
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">A null pointer exception here? I see no direct reason for it (in setCurrentJob), nor for the removal of the current job if no job is left to run, could you elaborate on the consequences?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D20029#inline-112520">View Inline</a><span style="color: #4b4d51; font-weight: bold;">scheduler.cpp:5061</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">            if (oneSeqJob->getFrameType() == FRAME_LIGHT)
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">                lightFramesRequired += oneSeqJob->getCount() - newFramesCount[signature];
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                lightFramesRequired += oneSeqJob->getCount()<span class="bright">*oneJob->getRepeatsRequired()</span> - newFramesCount[signature];
</div><div style="padding: 0 8px; margin: 0 4px; ">        }
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This fixes the count correctly, OK.</p>

<p style="padding: 0; margin: 8px;">Side note: I think SchedulerJob cannot just be a model (with the latest changes it's less and less a model actually). We need to move the repeat count management to that class at some point. That's another story I'd like to have a look at.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D20029#inline-112522">View Inline</a><span style="color: #4b4d51; font-weight: bold;">scheduler.cpp:5212</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">        }
</div><div style="padding: 0 8px; margin: 0 4px; ">        // Else rely on the captures done during this session
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">        else captures_completed = schedJob->getCompletedCount();
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I don't understand why you removed that line. Variable "captures_completed" can't always equal zero when not remembering progress: runtime events may abort the job, but still number of captures must be retained. This would cause areJobCapturesComplete to flip to true immediately...</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D20029#inline-112523">View Inline</a><span style="color: #4b4d51; font-weight: bold;">scheduler.cpp:5268</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    // only in case we remember the job progress, we change the completion count
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    if (rememberJobProgress)
</div><div style="padding: 0 8px; margin: 0 4px; ">        schedJob->setCompletedCount(totalCompletedCount);
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">If the algorithm is OK, I would expect totalCompletedCount == captures_completed if rememberJobProgress is false.<br />
I see the "optimization" andI agree on the principle, but I'd prefer a debug assertion here in a else. This change is introducing a dependency between the end and beginning of the algorithm, while we strive to clarify it.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R321 KStars</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D20029">https://phabricator.kde.org/D20029</a></div></div><br /><div><strong>To: </strong>wreissenberger, mutlaqja, TallFurryMan<br /><strong>Cc: </strong>kde-edu, narvaez, apol<br /></div>