QUniqueId QGoogleCalendarContext::addAppointment(const QAppointment &appointment, const QPimSource &source) { if (!mAccounts.keys().contains(source.identity) || source.context != id()) return QUniqueId(); if (mAccess) return mAccess->addAppointment(appointment, source, true); return QUniqueId(); }
/*! \internal */ void DialerControl::readCachedCall() { QSettings setting( "Trolltech", "qpe" ); setting.beginGroup( "CallControl" ); QStringList groupList = setting.childGroups(); foreach ( QString group, groupList ) { setting.beginGroup( group ); QCallListItem::CallType ct = (QCallListItem::CallType)setting.value( "CallType" ).toInt(); if ( ct == QCallListItem::Missed ) missedCalls++; QString fullNumber = setting.value( "FullNumber" ).toString(); QDateTime startTime = setting.value( "StartTime" ).toDateTime(); QDateTime endTime = setting.value( "EndTime" ).toDateTime(); QUniqueId contact = QUniqueId( setting.value( "Contact" ).toString() ); QString serviceType = setting.value( "ServiceType" ).toString(); QCallListItem item( ct, fullNumber, startTime, endTime, contact, serviceType ); mCallList.record( item ); setting.endGroup(); setting.remove( group ); }
QUniqueId QGoogleCalendarContext::replaceRemaining(const QUniqueId &original, const QAppointment &r, const QDate& date) { if (mAccess) return mAccess->replaceRemaining(original, r, date); return QUniqueId(); }
QUniqueId QGoogleCalendarContext::replaceOccurrence(const QUniqueId &original, const QOccurrence &occurrence, const QDate& date) { if (mAccess) return mAccess->replaceOccurrence(original, occurrence, date); return QUniqueId(); }
/*? Data for ctor() test function. */ void tst_QCallListItem::ctor_data() { QTest::addColumn<QString>("number"); QTest::addColumn<QUniqueId>("contact"); QTest::addColumn<QDateTime>("start"); QTest::addColumn<QDateTime>("end"); QTest::addColumn<int>("type"); // typical data QTest::newRow("simple") << "0" << QUniqueId() << QDateTime::currentDateTime() << QDateTime::currentDateTime().addSecs(60*5) << (int)QCallListItem::Dialed; // A null phone number QTest::newRow("null number") << QString() << QUniqueId() << QDateTime::currentDateTime() << QDateTime::currentDateTime().addSecs(60*5) << (int)QCallListItem::Dialed; // Dates the wrong way around (call ends before it begins). // Currently QCallListItem allows this with no complaint. QTest::newRow("bad dates") << "1234" << QUniqueId() << QDateTime::currentDateTime().addSecs(60*5) << QDateTime::currentDateTime() << (int)QCallListItem::Received; // Null date start. // Currently QCallListItem allows this with no complaint. QTest::newRow("null dates 1") << "1234" << QUniqueId() << QDateTime() << QDateTime::currentDateTime() << (int)QCallListItem::Received; // Null date end. // Currently QCallListItem allows this with no complaint. QTest::newRow("null dates 2") << "1234" << QUniqueId() << QDateTime::currentDateTime() << QDateTime() << (int)QCallListItem::Missed; // Non-null unique id, constructed with QByteArray QTest::newRow("unique id 1") << "1234" << QUniqueId(QByteArray("foobar")) << QDateTime::currentDateTime() << QDateTime::currentDateTime().addSecs(5*60) << (int)QCallListItem::Missed; // Non-null unique id, constructed with QString QTest::newRow("unique id 2") << "1234" << QUniqueId(QString("foobar")) << QDateTime::currentDateTime() << QDateTime::currentDateTime().addSecs(5*60) << (int)QCallListItem::Dialed; }