예제 #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" );
}