void Log::insert(int typeLog, string message){ if(correspondsToLog(typeLog)){ string date, time; getDateAndTime(date, time); writeLog(date, time, typeLog, message); } }
void ktvschedule::tvgrabXML(TvItem* tv,QDomElement node_element,QDomNode subnode) { if (node_element.tagName()=="programme") { tv->StartTime = getDateAndTime( node_element.attribute("start","") ); // Add Start time of show //qDebug("after"+tv->StartTime.toString("yyyyMMddhhmm")); tv->StopTime = getDateAndTime( node_element.attribute("stop","") ); // Add Stop time of show //qDebug("before"+tv->StartTime.toString("yyyyMMddhhmm")); // This permits to see the validity of the XML file the same time we are parsing the XML file if (tv->StartTime.date()<FirstInput ) {FirstInput = tv->StartTime.date();} if (tv->StartTime.date()>LastInput ) {LastInput = tv->StartTime.date();} // Only continue if the date of the show is the same as the showing date. This will make it faster if ( (tv->StartTime.date() == date_show->date() ) || (tv->StopTime.date() == date_show->date() ) ) { tv->ChannelId=node_element.attribute("channel",""); //.latin1(); // Channel Id tv->ChannelName=Channels.find(tv->ChannelId).data().ChannelName; tv->ShowView=node_element.attribute("showview","").toInt(); // Showview while (!subnode.isNull()) { QDomElement subnode_element=subnode.toElement(); if (subnode_element.tagName()=="title") // Title of the show { tv->Title=subnode_element.text(); //.latin1(); } if (subnode_element.tagName()=="sub-title") //SubTitle { tv->SubTitle=subnode_element.text(); //.latin1(); } if (subnode_element.tagName()=="category") // Category { tv->Lang=subnode_element.attribute("lang",""); //.latin1(); QString Cat = subnode_element.text(); tv->Category << Cat; //.latin1(); // This enters a new category to the ComboBox. Check for duplicate if (! this->checkExistingCat(Cat.lower() ) ) { Categories+=Cat.lower(); } } if (subnode_element.tagName()=="star-rating") // Rating { tv->Stars=subnode_element.text().left(1).toInt(); } if (subnode_element.tagName()=="desc") // Description. This exists only if full update has been choosen { tv->Description=subnode_element.text(); //.latin1(); } if (subnode_element.tagName()=="rating") // Rating { tv->RatingSystem=subnode_element.attribute("system",""); tv->RatingValue=subnode_element.text(); } if (subnode_element.tagName()=="episode-num") { if ( subnode_element.attribute("system","") == "dd_progid") { tv->EpisodeNum_ddProgid=subnode_element.text(); } if (subnode_element.attribute("system","") == "onscreen") { tv->EpisodeNum_onscreen=subnode_element.text().toInt(); } } if (subnode_element.tagName()=="credits") { QDomNode creditnode = subnode.firstChild(); while ( !creditnode.isNull() ) { QDomElement creditnode_element=creditnode.toElement(); if (creditnode_element.tagName()=="actor") { tv->Actors << creditnode_element.text(); } if (creditnode_element.tagName()=="producer") { tv->Producers << creditnode_element.text(); } if (creditnode_element.tagName()=="guest") { tv->Guests << creditnode_element.text(); } creditnode = creditnode.nextSibling(); } } subnode=subnode.nextSibling(); } } } }