-rw-r--r-- | libkcal/sharpformat.cpp | 18 |
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 @@ -481,6 +481,9 @@ int SharpFormat::getNumFromRecord( QString answer, Incidence* inc ) 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); @@ -532,7 +535,20 @@ bool SharpFormat::save( Calendar *calendar) 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 ) ) { |