summaryrefslogtreecommitdiff
path: root/libopie/todovcalresource.cpp
Side-by-side diff
Diffstat (limited to 'libopie/todovcalresource.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie/todovcalresource.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libopie/todovcalresource.cpp b/libopie/todovcalresource.cpp
index 75f2197..80f8c60 100644
--- a/libopie/todovcalresource.cpp
+++ b/libopie/todovcalresource.cpp
@@ -21,78 +21,83 @@
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qfile.h>
#include <qvaluelist.h>
#include <opie/todoevent.h>
#include <opie/todovcalresource.h>
#include "../library/backend/vobject_p.h"
#include "../library/backend/timeconversion.h"
#include "../library/backend/qfiledirect_p.h"
static VObject *vobjByEvent( const ToDoEvent &event )
{
VObject *task = newVObject( VCTodoProp );
if( task == 0 )
return 0l;
if( event.hasDate() )
addPropValue( task, VCDueProp, TimeConversion::toISO8601( event.date() ) );
if( event.isCompleted() )
addPropValue( task, VCStatusProp, "COMPLETED");
QString string = QString::number(event.priority() );
addPropValue( task, VCPriorityProp, string.local8Bit() );
addPropValue( task, VCCategoriesProp, event.allCategories().join(";").local8Bit() );
addPropValue( task, VCDescriptionProp, event.description().local8Bit() );
- addPropValue( task, VCSummaryProp, event.description().left(15).local8Bit() );
+ addPropValue( task, VCSummaryProp, event.summary().left(15).local8Bit() );
return task;
};
static ToDoEvent eventByVObj( VObject *obj ){
ToDoEvent event;
VObject *ob;
QCString name;
// no uid, attendees, ... and no fun
// description
if( ( ob = isAPropertyOf( obj, VCDescriptionProp )) != 0 ){
name = vObjectStringZValue( ob );
event.setDescription( name );
}
+ // summary
+ if ( ( ob = isAPropertyOf( obj, VCSummaryProp ) ) != 0 ) {
+ name = vObjectStringZValue( ob );
+ event.setSummary( name );
+ }
// completed
if( ( ob = isAPropertyOf( obj, VCStatusProp )) != 0 ){
name = vObjectStringZValue( ob );
if( name == "COMPLETED" ){
event.setCompleted( true );
}else{
event.setCompleted( false );
}
}else
event.setCompleted( false );
// priority
if ((ob = isAPropertyOf(obj, VCPriorityProp))) {
name = vObjectStringZValue( ob );
bool ok;
event.setPriority(name.toInt(&ok) );
}
//due date
if((ob = isAPropertyOf(obj, VCDueProp)) ){
event.setHasDate( true );
name = vObjectStringZValue( ob );
event.setDate( TimeConversion::fromISO8601( name).date() );
}
// categories
if((ob = isAPropertyOf( obj, VCCategoriesProp )) != 0 ){
name = vObjectStringZValue( ob );
qWarning("Categories:%s", name.data() );
}
return event;
};