void CRuleManager::AutoLunch() { CSHModel* model = SHModel(); for(TInt i=0; i<iRules->Count(); i++) { CRule* rule = (*iRules)[i]; if (rule->IsLunchRun()) { TInt type = rule->GetType(); // TTime time; // if (type == 0) // { // time.HomeTime(); // time += TTimeIntervalMinutes(rule->GetCountDown()); // } // else // { // TTime now; // now.HomeTime(); // time = rule->GetClock(); // if (time <= now) // continue; // } // // model->GetTaskInfoManager()->AppendTask(rule->GetUid(),rule->GetName(),time); TInt err = model->GetTaskInfoManager()->AppendTask(rule->GetName(),rule->GetUid(),type, rule->GetCountDown(),rule->GetClock()); } } }
TBool CRuleManager::LunchRun(const TInt& aIndex) { if (aIndex >=0 && aIndex < iRules->Count()) { CRule* rule = (*iRules)[aIndex]; if (rule->IsLunchRun()) rule->SetLunchRun(0); else rule->SetLunchRun(1); WriteToFile(iRules); return ETrue; } return EFalse; }