summaryrefslogtreecommitdiffabout
path: root/libkcal/sharpformat.cpp
authorzautrix <zautrix>2004-09-14 03:13:52 (UTC)
committer zautrix <zautrix>2004-09-14 03:13:52 (UTC)
commitf1f43030eefa765950cb501aece6cc71fb4e9859 (patch) (side-by-side diff)
treed7396ac13ab052ee38e2e8e139854cc88a289a43 /libkcal/sharpformat.cpp
parent5060b0737c0c279859cac3bcfb73d2ac21c6a79e (diff)
downloadkdepimpi-f1f43030eefa765950cb501aece6cc71fb4e9859.zip
kdepimpi-f1f43030eefa765950cb501aece6cc71fb4e9859.tar.gz
kdepimpi-f1f43030eefa765950cb501aece6cc71fb4e9859.tar.bz2
More fixes
Diffstat (limited to 'libkcal/sharpformat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/sharpformat.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index a53b3f8..e7fc670 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -478,12 +478,15 @@ int SharpFormat::getNumFromRecord( QString answer, Incidence* inc )
if ( ok && newnum > 0) {
retval = newnum;
inc->setID( "Sharp_DTM",templist[0] );
inc->setCsum( "Sharp_DTM", QString::number( getCsum( templist ) ));
inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
}
+ if ( ok && newnum == -1 ) {
+ qDebug("Error writing back %s ", inc->summary().latin1());
+ }
}
}
//qDebug("getNumFromRecord returning : %d ", retval);
return retval;
}
bool SharpFormat::save( Calendar *calendar)
@@ -529,13 +532,26 @@ bool SharpFormat::save( Calendar *calendar)
changeString += eString + "\n";
deleteString += eString + "\n";
deleteEnt = true;
changeEnt = true;
}
else if ( ev->getID("Sharp_DTM").isEmpty() ) { // add new
- command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName;
+ QString fileNameIn = "/tmp/kopitempin";
+ QFile fileIn( fileNameIn );
+ if (!fileIn.open( IO_WriteOnly ) ) {
+ return false;
+ }
+ QTextStream tsIn( &fileIn );
+ tsIn.setCodec( QTextCodec::codecForName("utf8") );
+ tsIn << ePrefix << eString ;
+ fileIn.close();
+ //command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName;
+ command = "(cat /tmp/kopitempin | db2file datebook -w -g -c " + codec+ ") > "+ fileName;
+ qDebug("command ++++++++ ");
+ qDebug("%s ",command.latin1());
+ qDebug("command -------- ");
system ( command.utf8() );
QFile file( fileName );
if (!file.open( IO_ReadOnly ) ) {
return false;
}