summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-28 13:13:08 (UTC)
committer zautrix <zautrix>2004-10-28 13:13:08 (UTC)
commit12068392f1d131c3f599b8854fe131dd9291a5ea (patch) (unidiff)
treebd49e43036eefde4aa2bdaa9b167b6b8d0e216b0
parent849ad402a00e2fe7bfd37c4c452b205767dab3d2 (diff)
downloadkdepimpi-12068392f1d131c3f599b8854fe131dd9291a5ea.zip
kdepimpi-12068392f1d131c3f599b8854fe131dd9291a5ea.tar.gz
kdepimpi-12068392f1d131c3f599b8854fe131dd9291a5ea.tar.bz2
fixed todo DTM sync
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/sharpformat.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index d56eab6..b88e729 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -629,22 +629,33 @@ bool SharpFormat::save( Calendar *calendar)
629 // we write first and x and then delete the record with the x 629 // we write first and x and then delete the record with the x
630 eString = eString.replace( QRegExp(",\"\""),",\"x\"" ); 630 eString = eString.replace( QRegExp(",\"\""),",\"x\"" );
631 changeString += eString + "\n"; 631 changeString += eString + "\n";
632 deleteString += eString + "\n"; 632 deleteString += eString + "\n";
633 deleteEnt = true; 633 deleteEnt = true;
634 changeEnt = true; 634 changeEnt = true;
635 } 635 }
636 else if ( to->getID("Sharp_DTM").isEmpty() ) { // add new 636 else if ( to->getID("Sharp_DTM").isEmpty() ) { // add new
637 command = "(echo \"" + tPrefix + eString + "\" ) | db2file todo -w -g -c " + codec+ " > "+ fileName; 637
638
639
640 QString fileNameIn = "/tmp/kopitempin";
641 QFile fileIn( fileNameIn );
642 if (!fileIn.open( IO_WriteOnly ) ) {
643 return false;
644 }
645 QTextStream tsIn( &fileIn );
646 tsIn.setCodec( QTextCodec::codecForName("utf8") );
647 tsIn << tPrefix << eString ;
648 fileIn.close();
649 command = "(cat /tmp/kopitempin | db2file todo -w -g -c " + codec+ ") > "+ fileName;
638 system ( command.utf8() ); 650 system ( command.utf8() );
639 QFile file( fileName ); 651 QFile file( fileName );
640 if (!file.open( IO_ReadOnly ) ) { 652 if (!file.open( IO_ReadOnly ) ) {
641 return false; 653 return false;
642
643 } 654 }
644 QTextStream ts( &file ); 655 QTextStream ts( &file );
645 ts.setCodec( QTextCodec::codecForName("utf8") ); 656 ts.setCodec( QTextCodec::codecForName("utf8") );
646 answer = ts.read(); 657 answer = ts.read();
647 file.close(); 658 file.close();
648 //qDebug("answer \n%s ", answer.latin1()); 659 //qDebug("answer \n%s ", answer.latin1());
649 getNumFromRecord( answer, to ) ; 660 getNumFromRecord( answer, to ) ;
650 661