Git commit cef0227c16d98eadb17c5111198003f8cbd427bd by Kevin Krammer. Committed on 25/01/2012 at 17:06. Pushed by krake into branch 'master'. Preliminary Todo diff handling M +14 -56 taskshandler.cpp http://commits.kde.org/akonadi-sugarcrm/cef0227c16d98eadb17c5111198003f8cbd= 427bd diff --git a/taskshandler.cpp b/taskshandler.cpp index 37717b2..bcac7bf 100644 --- a/taskshandler.cpp +++ b/taskshandler.cpp @@ -265,31 +265,31 @@ TasksHandler::TasksHandler( SugarSession *session ) mAccessors->insert( QLatin1String( "id" ), new TaskAccessorPair( getId, setId, QString() ) ); mAccessors->insert( QLatin1String( "name" ), - new TaskAccessorPair( getSummary, setSummary, QStr= ing() ) ); + new TaskAccessorPair( getSummary, setSummary, i18n= c( "@item:intable TODO title", "Title" ) ) ); mAccessors->insert( QLatin1String( "date_entered" ), - new TaskAccessorPair( getDateEntered, setDateEnter= ed, QString() ) ); + new TaskAccessorPair( getDateEntered, setDateEnter= ed, i18nc( "@item:intable", "Creation Date" ) ) ); mAccessors->insert( QLatin1String( "date_modififed" ), - new TaskAccessorPair( getDateModified, setDateModi= fied, QString() ) ); + new TaskAccessorPair( getDateModified, setDateModi= fied, i18nc( "@item:intable", "Modification Date" ) ) ); mAccessors->insert( QLatin1String( "modified_user_id" ), new TaskAccessorPair( getModifiedUserId, setModifi= edUserId, QString() ) ); mAccessors->insert( QLatin1String( "created_by" ), new TaskAccessorPair( getCreatedBy, setCreatedBy, = QString() ) ); mAccessors->insert( QLatin1String( "description" ), - new TaskAccessorPair( getDescription, setDescripti= on, QString() ) ); + new TaskAccessorPair( getDescription, setDescripti= on, i18nc( "@item:intable", "Description" ) ) ); mAccessors->insert( QLatin1String( "deleted" ), new TaskAccessorPair( getDeleted, setDeleted, QStr= ing() ) ); mAccessors->insert( QLatin1String( "assigned_user_id" ), new TaskAccessorPair( getAssignedUserId, setAssign= edUserId, QString() ) ); mAccessors->insert( QLatin1String( "status" ), - new TaskAccessorPair( getStatus, setStatus, QStrin= g() ) ); + new TaskAccessorPair( getStatus, setStatus, i18nc(= "@item:intable", "Status" ) ) ); mAccessors->insert( QLatin1String( "date_due_flag" ), new TaskAccessorPair( getDateDueFlag, setDateDueFl= ag, QString() ) ); mAccessors->insert( QLatin1String( "date_due" ), - new TaskAccessorPair( getDateDue, setDateDue, QStr= ing() ) ); + new TaskAccessorPair( getDateDue, setDateDue, i18n= c( "@item:intable", "Due Date" ) ) ); mAccessors->insert( QLatin1String( "date_start_flag" ), new TaskAccessorPair( getDateStartFlag, setDateSta= rtFlag, QString() ) ); mAccessors->insert( QLatin1String( "date_start" ), - new TaskAccessorPair( getDateStart, setDateStart, = QString() ) ); + new TaskAccessorPair( getDateStart, setDateStart, = i18nc( "@item:intable", "Start Date" ) ) ); mAccessors->insert( QLatin1String( "parent_type" ), new TaskAccessorPair( getParentType, setParentType= , QString() ) ); mAccessors->insert( QLatin1String( "parent_id" ), @@ -297,7 +297,7 @@ TasksHandler::TasksHandler( SugarSession *session ) mAccessors->insert( QLatin1String( "contact_id" ), new TaskAccessorPair( getContactId, setContactId, = QString() ) ); mAccessors->insert( QLatin1String( "priority" ), - new TaskAccessorPair( getPriority, setPriority, QS= tring() ) ); + new TaskAccessorPair( getPriority, setPriority, i1= 8nc( "@item:intable", "Priority" ) ) ); } = TasksHandler::~TasksHandler() @@ -440,8 +440,6 @@ void TasksHandler::compare( Akonadi::AbstractDifference= sReporter *reporter, i18nc( "@title:column", "Serverside Task: modified by %1 on %2", modifiedBy, modifiedOn ) ); = - /*bool seenPrimaryAddress =3D false; - bool seenOtherAddress =3D false; AccessorHash::const_iterator it =3D mAccessors->constBegin(); AccessorHash::const_iterator endIt =3D mAccessors->constEnd(); for ( ; it !=3D endIt; ++it ) { @@ -450,54 +448,14 @@ void TasksHandler::compare( Akonadi::AbstractDifferen= cesReporter *reporter, continue; } = - QString leftValue =3D (*it)->getter( leftContact ); - QString rightValue =3D (*it)->getter( rightContact ); + QString leftValue =3D (*it)->getter( *leftTask ); + QString rightValue =3D (*it)->getter( *rightTask ); = QString diffName =3D (*it)->diffName; if ( diffName.isEmpty() ) { - // check for special fields - if ( isAddressValue( it.key() ) ) { - if ( isPrimaryAddressValue( it.key() ) ) { - if ( !seenPrimaryAddress ) { - diffName =3D i18nc( "item:intable", "Primary Addre= ss" ); - seenPrimaryAddress =3D true; - const KABC::Address leftAddress =3D - leftContact.address( KABC::Address::Work | KAB= C::Address::Pref ); - const KABC::Address rightAddress =3D - rightContact.address( KABC::Address::Work | KA= BC::Address::Pref ); - - leftValue =3D leftAddress.formattedAddress(); - rightValue =3D rightAddress.formattedAddress(); - } else { - // already printed, skip - continue; - } - } else { - if ( !seenOtherAddress ) { - seenOtherAddress =3D true; - diffName =3D i18nc( "item:intable", "Other Address= " ); - const KABC::Address leftAddress =3D - leftContact.address( KABC::Address::Home ); - const KABC::Address rightAddress =3D - rightContact.address( KABC::Address::Home ); - - leftValue =3D leftAddress.formattedAddress(); - rightValue =3D rightAddress.formattedAddress(); - } else { - // already printed, skip - continue; - } - } - } else if ( it.key() =3D=3D "do_not_call" ) { - diffName =3D i18nc( "@item:intable", "Do Not Call" ); - leftValue =3D getDoNotCall( leftContact ) =3D=3D QLatin1St= ring( "1" ) - ? QLatin1String( "Yes" ) : QLatin1String( = "No" ); - rightValue =3D getDoNotCall( rightContact ) =3D=3D QLatin1= String( "1" ) - ? QLatin1String( "Yes" ) : QLatin1String( = "No" ); - } else { - // internal field, skip - continue; - } + // TODO might need override for Status and Priority + // internal field, skip + continue; } = if ( leftValue.isEmpty() && rightValue.isEmpty() ) { @@ -514,5 +472,5 @@ void TasksHandler::compare( Akonadi::AbstractDifference= sReporter *reporter, reporter->addProperty( Akonadi::AbstractDifferencesReporter::C= onflictMode, diffName, leftValue, rightValue ); } - }*/ + } }