summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/vobject.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/backend/vobject.cpp b/library/backend/vobject.cpp
index 592d116..28b8bae 100644
--- a/library/backend/vobject.cpp
+++ b/library/backend/vobject.cpp
@@ -1262,103 +1262,105 @@ static void writeProp(OFile *fp, VObject *o)
if (p) size = LONG_VALUE_OF(p);
appendcOFile(fp,':');
writeValue(fp,o,size,FALSE);
}
appendcOFile(fp,'\n');
}
static void writeVObject_(OFile *fp, VObject *o)
{
if (NAME_OF(o)) {
struct PreDefProp *pi;
pi = lookupPropInfo(NAME_OF(o));
if (pi && ((pi->flags & PD_BEGIN) != 0)) {
VObjectIterator t;
const char *begin = NAME_OF(o);
appendsOFile(fp,"BEGIN:");
appendsOFile(fp,begin);
appendcOFile(fp,'\n');
initPropIterator(&t,o);
while (moreIteration(&t)) {
VObject *eachProp = nextVObject(&t);
writeProp(fp, eachProp);
}
appendsOFile(fp,"END:");
appendsOFile(fp,begin);
appendsOFile(fp,"\n\n");
}
}
}
static void initVObjectEncoding()
{
Config pimConfig( "Beam" );
pimConfig.setGroup("Send");
Config devcfg(pimConfig.readEntry("DeviceConfig"),Config::File);
QString enc = "QP";
QString cs = "UTF-8";
if ( devcfg.isValid() ) {
devcfg.setGroup("Send");
enc = devcfg.readEntry("Encoding","QP");
cs = devcfg.readEntry("CharSet","UTF-8");
}
strncpy(vobj_cs,cs.latin1(),10);
if ( enc == "QP" ) {
vobj_enc = QuotedPrintable;
vobj_enc_s = VCQuotedPrintableProp;
} else if ( enc == "B64" ) {
vobj_enc = Base64;
vobj_enc_s = VCBase64Prop;
} else {
vobj_enc = EightBit;
vobj_enc_s = 0;
}
}
void writeVObject(FILE *fp, VObject *o)
{
initVObjectEncoding();
OFile ofp;
// #####
//_setmode(_fileno(fp), _O_BINARY);
initOFile(&ofp,fp);
writeVObject_(&ofp,o);
}
DLLEXPORT(void) writeVObjectToFile(char *fname, VObject *o)
{
QFileDirect f( fname);
if ( !f.open( IO_WriteOnly ) ) {
qWarning("Unable to open vobject write %s", fname);
return;
}
writeVObject( f.directHandle(),o );
}
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);
}
}
DLLEXPORT(const char *) vObjectTypeInfo(VObject *o)
{
const char *type = vObjectName( o );
- if ( strcmp( type, "TYPE" ) == 0 )
- type = vObjectStringZValue( o );
+ if ( strcmp( type, "type" ) == 0 ||
+ strcmp( type, "TYPE" ) == 0 ||
+ strcmp( type, "Type" ) == 0 )
+ type = vObjectStringZValue( o );
return type;
}
// end of source file vobject.c