コード例 #1
0
ファイル: vobject.cpp プロジェクト: opieproject/opie
DLLEXPORT(void) cleanVObjects(VObject *list)
{
    while (list) {
	VObject *t = list;
	list = nextVObjectInList(list);
	cleanVObject(t);
	}
}
コード例 #2
0
ファイル: vobject.c プロジェクト: pvuorela/kcalcore
void printVObjectsToFile(char *fname,VObject *list)
{
    FILE *fp = fopen(fname,"w");
    if (fp) {
	while (list) {
	    printVObject(fp,list);
	    list = nextVObjectInList(list);
	    }
	fclose(fp);
	}
}
コード例 #3
0
ファイル: vobject.c プロジェクト: pvuorela/kcalcore
char* writeMemVObjects(char *s, int *len, VObject *list)
{
    OFile ofp;
    initMemOFile(&ofp,s,len?*len:0);
    while (list) {
	writeVObject_(&ofp,list);
	list = nextVObjectInList(list);
	}
    if (len) *len = ofp.len;
    appendcOFile(&ofp,0);
    return ofp.s;
}
コード例 #4
0
ファイル: vobject.cpp プロジェクト: opieproject/opie
DLLEXPORT(void) writeVObjectsToFile(char *fname, VObject *list)
{
	QFileDirect f( fname);
	if ( !f.open( IO_WriteOnly ) ) {
		qWarning("Unable to open vobject write %s", fname);
		return;
	}

	while (list) {
	    writeVObject(f.directHandle(),list);
	    list = nextVObjectInList(list);
	    }
}
コード例 #5
0
bool OContactAccessBackend_VCard::load ()
{
    m_map.clear();
    m_dirty = false;

    VObject* obj = 0l;

    if ( QFile::exists(m_file) ) {
        obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() );
        if ( !obj )
            return false;
    } else {
        qWarning("File \"%s\" not found !", m_file.latin1() );
        return false;
    }

    while ( obj ) {
        OContact con = parseVObject( obj );
        /*
         * if uid is 0 assign a new one
         * this at least happens on
         * Nokia6210
         */
        if ( con.uid() == 0 ) {
            con.setUid( 1 );
            qWarning("assigned new uid %d",con.uid() );
        }

        m_map.insert( con.uid(), con );

        VObject *t = obj;
        obj = nextVObjectInList(obj);
        cleanVObject( t );
    }

    return true;

}