/*! \internal */ void DialerControl::updateCachedCall( const QPhoneCall &call ) { QSettings setting( "Trolltech", "qpe" ); setting.beginGroup( "CallControl" ); setting.beginGroup( call.identifier() ); setting.setValue( "CallType", call.dialed() ? QCallListItem::Dialed : QCallListItem::Received ); setting.setValue( "EndTime", QDateTime::currentDateTime() ); setting.endGroup(); setting.endGroup(); setting.sync(); ::sync(); }
/*! Record the \a call in the call list. */ void DialerControl::recordCall( const QPhoneCall &call ) { QCallListItem::CallType ct; if( call.dialed() ) ct = QCallListItem::Dialed; else if( call.hasBeenConnected() || call.state() == QPhoneCall::HangupLocal ) ct = QCallListItem::Received; else { ct = QCallListItem::Missed; // increase missed call count missedCall( call ); } // QPhoneCall::connectTime() in case call has been connected // QPhoneCall::startTime() in other cases QDateTime startTime = call.hasBeenConnected() ? call.connectTime() : call.startTime(); QCallListItem listItem( ct, call.fullNumber(), startTime, call.endTime(), call.contact(), call.callType() ); mCallList.record( listItem ); removeCachedCall( call ); }