Commit 97a3f8d3 authored by Jasem Mutlaq's avatar Jasem Mutlaq

No need to perform meridian flip if there are no more pending jobs in the sequence queue

parent c0a58d2f
......@@ -1236,8 +1236,9 @@ void Capture::processJobCompletion()
stop();
// Check if meridian condition is met
if (checkMeridianFlip())
// Check if meridian condition is met IF there are more pending jobs in the queue
// Otherwise, no need to check meridian flip is all jobs are over.
if (getPendingJobCount() > 0 && checkMeridianFlip())
return;
// Check if there are more pending jobs and execute them
......@@ -3155,6 +3156,19 @@ int Capture::getActiveJobID()
return -1;
}
int Capture::getPendingJobCount()
{
int completedJobs = 0;
foreach (SequenceJob *job, jobs)
{
if (job->getStatus() == SequenceJob::JOB_DONE)
completedJobs++;
}
return (jobs.count() - completedJobs);
}
QString Capture::getJobState(int id)
{
if (id < jobs.count())
......
......@@ -206,6 +206,11 @@ class Capture : public QWidget, public Ui::Capture
*/
Q_SCRIPTABLE int getJobCount() { return jobs.count(); }
/** DBUS interface function.
* @return Returns the number of pending uncompleted jobs in the sequence queue.
*/
Q_SCRIPTABLE int getPendingJobCount();
/** DBUS interface function.
* @return Returns ID of current active job if any, or -1 if there are no active jobs.
*/
......
......@@ -51,6 +51,9 @@
<method name="getJobCount">
<arg type="i" direction="out"/>
</method>
<method name="getPendingJobCount">
<arg type="i" direction="out"/>
</method>
<method name="getJobState">
<arg type="s" direction="out"/>
<arg name="id" type="i" direction="in"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment