Permalink
Browse files

Fix scheduler output ordering.

Backport of 8b9c595 and 20abad4 to fixes/0.24.
  • Loading branch information...
1 parent 515171d commit c502e0d2b17482f75847b78a19c12eaa7fcb77d1 @gigem gigem committed Aug 16, 2011
Showing with 5 additions and 14 deletions.
  1. +5 −14 mythtv/programs/mythbackend/scheduler.cpp
@@ -279,7 +279,11 @@ static bool comp_recstart(RecordingInfo *a, RecordingInfo *b)
return a->GetRecordingEndTime() < b->GetRecordingEndTime();
if (a->GetChannelSchedulingID() != b->GetChannelSchedulingID())
return a->GetChannelSchedulingID() < b->GetChannelSchedulingID();
- return a->GetRecordingStatus() < b->GetRecordingStatus();
+ if (a->GetRecordingStatus() != b->GetRecordingStatus())
+ return a->GetRecordingStatus() < b->GetRecordingStatus();
+ if (a->GetChanNum() != b->GetChanNum())
+ return a->GetChanNum() < b->GetChanNum();
+ return a->GetChanID() < b->GetChanID();
}
static QDateTime schedTime;
@@ -325,17 +329,6 @@ static bool comp_priority(RecordingInfo *a, RecordingInfo *b)
return a->GetRecordingRuleID() < b->GetRecordingRuleID();
}
-static bool comp_timechannel(RecordingInfo *a, RecordingInfo *b)
-{
- if (a->GetRecordingStartTime() != b->GetRecordingStartTime())
- return a->GetRecordingStartTime() < b->GetRecordingStartTime();
- if (a->GetChanNum() == b->GetChanNum())
- return a->GetChanID() < b->GetChanID();
- if (a->GetChanNum().toInt() > 0 && b->GetChanNum().toInt() > 0)
- return a->GetChanNum().toInt() < b->GetChanNum().toInt();
- return a->GetChanNum() < b->GetChanNum();
-}
-
bool Scheduler::FillRecordList(bool doLock)
{
schedMoveHigher = (bool)gCoreContext->GetNumSetting("SchedMoveHigher");
@@ -1519,8 +1512,6 @@ bool Scheduler::getAllPending(RecList *retList)
retList->push_back(new RecordingInfo(**it));
}
- SORT_RECLIST(*retList, comp_timechannel);
-
return hasconflicts;
}

0 comments on commit c502e0d

Please sign in to comment.