string CTodo::toString() { CAlarm *pAlarm; CRecurrence *cRec; string szRet; string szTemp; time_t temp = 0; std::stringstream ss; ss << "ID="; if (getId().c_str()){ szTemp= getId().substr(0,100); ss << szTemp; szTemp.clear(); } else ss << NULL_STRING; ss << ",CalendarId="; ss << getCalendarId(); ss << ",summary="; if (getSummary().c_str()){ szTemp= getSummary().substr(0,100); ss << szTemp; szTemp.clear(); } else ss << NULL_STRING; ss << ",description="; if (getDescription().c_str()){ szTemp= getDescription().substr(0,100); ss << szTemp; szTemp.clear(); } else ss << NULL_STRING; ss << ",location="; if (getLocation().c_str()){ szTemp= getLocation().substr(0,100); ss << szTemp; szTemp.clear(); } else ss << NULL_STRING; ss << ",UId="; if (getGUid().c_str()){ szTemp= getGUid().substr(0,100); ss << szTemp; szTemp.clear(); } else ss << NULL_STRING; ss << ",TimeZone="; if (getTzid().c_str()){ szTemp= getTzid().substr(0,100); ss << szTemp; szTemp.clear(); } else ss << NULL_STRING; ss << ",Type="; ss << getType() ; ss << ",Flags="; switch (getFlags()){ case HAS_ATTENDEE: ss << "Has Attendee"; break; case HAS_ORGANIZER: ss << "Has Organizer"; break; case HAS_RECURRENCE: ss << "Has Recurrence"; break; case HAS_ALARM: ss << "Has Alarm"; break; case HAS_RECURRENCE_ALARM : ss << "Has Recurrent Alarm"; break; case HAS_PARTICIPANT : ss << "Has Participant"; break; case HAS_CATEGORIES : ss << "Has Categories"; break; case HAS_COMMENT: ss << "Has Comment "; break; case HAS_EXTRA: ss << "Has Extra "; break; default: break; } ss << ",Status="; ss << getStatus(); ss << ",Start date="; temp = getDateStart(); ss << ctime(&temp); ss << ",End date="; temp = getDateEnd(); ss << ctime(&temp); ss << ",Last modified="; temp = getLastModified(); ss << ctime(&temp); ss << ",created="; temp = getCreatedTime(); ss << ctime(&temp); ss << ",until="; temp = getUntil(); ss << ctime(&temp); ss << ",All day="; ss << getAllDay(); ss << ",Geo="; if (szGeo.c_str()){ szTemp= szGeo.substr(0,100); ss << szTemp; szTemp.clear(); } else ss << NULL_STRING; ss << ",TodoDue="; ss << iDue; ss << ",Completed="; ss << iCompleted; ss << ",Percent"; ss << iPercentComplete; ss << ",Priority"; ss << iPriority; pAlarm=getAlarm(); if(pAlarm) ss << pAlarm->toString(); else ss << ",Alarm=NULL"; cRec=getRecurrence(); if(cRec) ss << cRec->toString(); else ss << ",Rec=NULL"; szRet.append(ss.str()); return szRet; }
void PromoEditor::checkValid() { qDebug()<<"Selected Product Code:"<<getSelectedProductCode(); if ((isProductSelected()) && ((ui->spinboxDiscount->value() > 0.0) || (ui->spinboxPrice->value() > 0.0)) && (getDateStart() < getDateEnd()) && (getDateStart() >= QDate::currentDate()) ) enableButtonOk(true); else enableButtonOk(false); }
/** * getDue * @param none * @return due time int * * This function will be used to due time for a todo * which has been previously set using setTodoDue() * returns due time */ int CTodo::getDue() { this->iDue = getDateStart(); return this->iDue; }