Пример #1
0
void KCalConversionTest::testTodoConversion_data()
{
    QTest::addColumn<KCalCore::Todo>( "kcal" );
    QTest::addColumn<Kolab::Todo>( "kolab" );
    
    Kolab::cDateTime date(2011,2,2,12,11,10,true);
    Kolab::cDateTime date2(2011,2,2,12,12,10,true);
    
    {
        KCalCore::Todo kcal;
        kcal.setUid("uid");
        kcal.setDtStart(toDate(date));
        kcal.setDtDue(toDate(date2));
        kcal.setRelatedTo("uid2", KCalCore::Incidence::RelTypeParent);
        
        Kolab::Todo kolab;
        kolab.setUid("uid");
        kolab.setStart(date);
        kolab.setDue(date2);
        std::vector<std::string> relateds;
        relateds.push_back("uid2");
        kolab.setRelatedTo(relateds);

        QTest::newRow( "todo" ) << kcal << kolab;
    }
}
Пример #2
0
static void setPriority( const QString &value, KCalCore::Todo &todo )
{
    if ( value == QLatin1String( "High" ) ) {
        todo.setPriority( 1 );
    } else if ( value == QLatin1String( "Medium" ) ) {
        todo.setPriority( 5 );
    } else if ( value == QLatin1String( "Low" ) ) {
        todo.setPriority( 9 );
    } else {
        todo.setPriority( 0 );
    }
}
Пример #3
0
static QString getPriority( const KCalCore::Todo &todo )
{
    if ( todo.priority() == 1 ) {
        return QLatin1String( "High" );
    } else if ( todo.priority() == 5 ) {
        return QLatin1String( "Medium" );
    } else if ( todo.priority() == 9 ) {
        return QLatin1String( "Low" );
    } else {
        return QLatin1String( "None" );
    }
}
Пример #4
0
static QString getStatus( const KCalCore::Todo &todo )
{
    if ( todo.status() == KCalCore::Todo::StatusConfirmed ) {
        return QLatin1String( "Not Started" );
    } else if ( todo.status() == KCalCore::Todo::StatusInProcess ) {
        return QLatin1String( "In Progress" );
    } else if ( todo.status() == KCalCore::Todo::StatusCompleted ) {
        return QLatin1String( "Completed" );
    } else if ( todo.status() == KCalCore::Todo::StatusNeedsAction ) {
        return QLatin1String( "Pending Input" );
    } else if ( todo.customStatus() == "StatusDeferred" ) {
        return QLatin1String( "Deferred" );
    } else {
        return QLatin1String( "None" );
    }
}
Пример #5
0
static void setStatus( const QString &value, KCalCore::Todo &todo )
{
    if ( value == QLatin1String( "Not Started" ) ) {
        todo.setStatus( KCalCore::Todo::StatusConfirmed );
    } else if ( value == QLatin1String( "In Progress" ) ) {
        todo.setStatus( KCalCore::Todo::StatusInProcess );
    } else if ( value == QLatin1String( "Completed" ) ) {
        todo.setStatus( KCalCore::Todo::StatusCompleted );
    } else if ( value == QLatin1String( "Pending Input" ) ) {
        todo.setStatus( KCalCore::Todo::StatusNeedsAction );
    } else if ( value == QLatin1String( "Deferred" ) ) {
        todo.setCustomStatus( QLatin1String( "StatusDeferred" ) );
    } else {
        todo.setStatus( KCalCore::Todo::StatusNone );
    }
}
Пример #6
0
static void setDateStartFlag( const QString &value, KCalCore::Todo &todo )
{
    todo.setCustomProperty( "SugarCRM", "X-DateStartFlag", value );
}
Пример #7
0
static void setContactId( const QString &value, KCalCore::Todo &todo )
{
    todo.setCustomProperty( "SugarCRM", "X-ContactId", value );
}
Пример #8
0
static void setSummary( const QString &value, KCalCore::Todo &todo )
{
    todo.setSummary( value );
}
Пример #9
0
static void setDescription( const QString &value, KCalCore::Todo &todo )
{
    todo.setDescription( value );
}
Пример #10
0
static void setCreatedBy( const QString &value, KCalCore::Todo &todo )
{
    todo.setCustomProperty( "SugarCRM", "X-CreatedBy", value );
}
Пример #11
0
static void setModifiedUserId( const QString &value, KCalCore::Todo &todo )
{
    todo.setCustomProperty( "SugarCRM", "X-ModifiedUserId", value );
}
Пример #12
0
static QString getDateModified( const KCalCore::Todo &todo )
{
    return todo.customProperty( "SugarCRM", "X-DateModified" );
}
Пример #13
0
static QString getDateEntered( const KCalCore::Todo &todo )
{
    return todo.created().toString();
}
Пример #14
0
static QString getDateStartFlag( const KCalCore::Todo &todo )
{
    return todo.customProperty( "SugarCRM", "X-DateStartFlag" );
}
Пример #15
0
static QString getDateDue( const KCalCore::Todo &todo )
{
    KDateTime dateDue = todo.dtDue();
    return dateDue.toString( "%Y-%m-%d %H:%M:%S" );
}
Пример #16
0
static void setAssignedUserName( const QString &value, KCalCore::Todo &todo )
{
    todo.setCustomProperty( "SugarCRM", "X-AssignedUserName", value );
}
Пример #17
0
static QString getAssignedUserName( const KCalCore::Todo &todo )
{
    return todo.customProperty( "SugarCRM", "X-AssignedUserName" );
}
Пример #18
0
static void setDeleted( const QString &value, KCalCore::Todo &todo )
{
    todo.setCustomProperty( "SugarCRM", "X-Deleted", value );
}
Пример #19
0
static void setDateEntered( const QString &value, KCalCore::Todo &todo )
{
    todo.setCreated( KDateTime::fromString(value, "%Y-%m-%d %H:%M:%S") );
}
Пример #20
0
static QString getDateStart( const KCalCore::Todo &todo )
{
    KDateTime dateStart = todo.dtStart();
    return dateStart.toString( "%Y-%m-%d %H:%M:%S" );
}
Пример #21
0
static QString getModifiedUserId( const KCalCore::Todo &todo )
{
    return todo.customProperty( "SugarCRM", "X-ModifiedUserId" );
}
Пример #22
0
static void setDateStart( const QString &value, KCalCore::Todo &todo )
{
    todo.setDtStart( KDateTime::fromString( value, "%Y-%m-%d %H:%M:%S", 0, true ) );
}
Пример #23
0
static QString getCreatedBy( const KCalCore::Todo &todo )
{
    return todo.customProperty( "SugarCRM", "X-CreatedBy" );
}
Пример #24
0
static QString getParentType( const KCalCore::Todo &todo )
{
    return todo.customProperty( "SugarCRM", "X-ParentType" );
}
Пример #25
0
static QString getDescription( const KCalCore::Todo &todo )
{
    return todo.description();
}
Пример #26
0
static void setParentType( const QString &value, KCalCore::Todo &todo )
{
    todo.setCustomProperty( "SugarCRM", "X-ParentType", value );
}
Пример #27
0
static QString getSummary( const KCalCore::Todo &todo )
{
    return todo.summary();
}
Пример #28
0
static QString getContactId( const KCalCore::Todo &todo )
{
    return todo.customProperty( "SugarCRM", "X-ContactId" );
}