From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'libkcal/sharpformat.cpp') diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index 9b757f7..b8c2aa7 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp @@ -22,12 +22,12 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include @@ -366,11 +366,11 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal ) } QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); text = ts.read(); file.close(); @@ -388,7 +388,7 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal ) fileName = "/tmp/todo.txt"; } file.setName( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } @@ -475,7 +475,7 @@ bool SharpFormat::save( Calendar *calendar) QString ePrefix = "CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY\n"; QString tPrefix = "CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1\n"; QString command; - QPtrList er = calendar->rawEvents(); + Q3PtrList er = calendar->rawEvents(); Event* ev = er.first(); QString fileName = "/tmp/kopitempout"; int i = 0; @@ -503,10 +503,10 @@ bool SharpFormat::save( Calendar *calendar) else if ( ev->getID("Sharp_DTM").isEmpty() ) { // add new QString fileNameIn = "/tmp/kopitempin"; QFile fileIn( fileNameIn ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << ePrefix << eString ; fileIn.close(); @@ -517,11 +517,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("command -------- "); system ( command.utf8() ); QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); answer = ts.read(); file.close(); @@ -544,11 +544,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("changing... "); if ( changeEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << changeString ; file.close(); @@ -562,11 +562,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("deleting... "); if ( deleteEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << deleteString; file.close(); @@ -580,7 +580,7 @@ bool SharpFormat::save( Calendar *calendar) deleteString = tPrefix; status.setText ( i18n("Processing todos ...") ); qApp->processEvents(); - QPtrList tl = calendar->rawTodos(); + Q3PtrList tl = calendar->rawTodos(); Todo* to = tl.first(); i = 0; message = i18n("Processing todo # "); @@ -605,20 +605,20 @@ bool SharpFormat::save( Calendar *calendar) QString fileNameIn = "/tmp/kopitempin"; QFile fileIn( fileNameIn ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << tPrefix << eString ; fileIn.close(); command = "(cat /tmp/kopitempin | db2file todo -w -g -c " + codec+ ") > "+ fileName; system ( command.utf8() ); QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); answer = ts.read(); file.close(); @@ -642,11 +642,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("changing... "); if ( changeEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << changeString ; file.close(); @@ -660,11 +660,11 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("deleting... "); if ( deleteEnt ) { QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return false; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); ts << deleteString; file.close(); @@ -783,7 +783,7 @@ QString SharpFormat::getEventString( Event* event ) writeEndDate = true; { int count = 1; - QPtrList rmp; + Q3PtrList rmp; rmp = rec->monthPositions(); if ( rmp.first()->negative ) count = 5 - rmp.first()->rPos - 1; -- cgit v0.9.0.2