summaryrefslogtreecommitdiffabout
path: root/libkcal/sharpformat.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /libkcal/sharpformat.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'libkcal/sharpformat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/sharpformat.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index 9b757f7..b8c2aa7 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -19,18 +19,18 @@
Boston, MA 02111-1307, USA.
*/
#include <qdatetime.h>
#include <qstring.h>
#include <qapplication.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <qregexp.h>
#include <qmessagebox.h>
#include <qclipboard.h>
#include <qfile.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qtextcodec.h>
#include <qxml.h>
#include <qlabel.h>
#include <kdebug.h>
#include <klocale.h>
@@ -363,17 +363,17 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal )
system ( command.latin1() );
} else {
fileName = "/tmp/events.txt";
}
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();
status.setText( i18n("Processing events ...") );
status.raise();
qApp->processEvents();
@@ -385,13 +385,13 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal )
QString command = "db2file todo -r -c " + codec+ " > " + fileName;
system ( command.latin1() );
} else {
fileName = "/tmp/todo.txt";
}
file.setName( fileName );
- if (!file.open( IO_ReadOnly ) ) {
+ if (!file.open( QIODevice::ReadOnly ) ) {
return false;
}
ts.setDevice( &file );
text = ts.read();
file.close();
@@ -472,13 +472,13 @@ bool SharpFormat::save( Calendar *calendar)
bool debug = DEBUGMODE;
QString codec = "utf8";
QString answer;
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<Event> er = calendar->rawEvents();
+ Q3PtrList<Event> er = calendar->rawEvents();
Event* ev = er.first();
QString fileName = "/tmp/kopitempout";
int i = 0;
QString changeString = ePrefix;
QString deleteString = ePrefix;
bool deleteEnt = false;
@@ -500,31 +500,31 @@ bool SharpFormat::save( Calendar *calendar)
deleteEnt = true;
changeEnt = true;
}
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();
//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 ) ) {
+ if (!file.open( QIODevice::ReadOnly ) ) {
return false;
}
- QTextStream ts( &file );
+ Q3TextStream ts( &file );
ts.setCodec( QTextCodec::codecForName("utf8") );
answer = ts.read();
file.close();
//qDebug("answer \n%s ", answer.latin1());
getNumFromRecord( answer, ev ) ;
@@ -541,17 +541,17 @@ bool SharpFormat::save( Calendar *calendar)
}
status.setText ( i18n("Changing events ...") );
qApp->processEvents();
//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();
command = "db2file datebook -w -g -c " + codec+ " < "+ fileName;
system ( command.latin1() );
//qDebug("command %s file :\n%s ", command.latin1(), changeString.latin1());
@@ -559,17 +559,17 @@ bool SharpFormat::save( Calendar *calendar)
}
status.setText ( i18n("Deleting events ...") );
qApp->processEvents();
//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();
command = "db2file datebook -d -c " + codec+ " < "+ fileName;
system ( command.latin1() );
// qDebug("command %s file :\n%s ", command.latin1(), deleteString.latin1());
@@ -577,13 +577,13 @@ bool SharpFormat::save( Calendar *calendar)
changeString = tPrefix;
deleteString = tPrefix;
status.setText ( i18n("Processing todos ...") );
qApp->processEvents();
- QPtrList<Todo> tl = calendar->rawTodos();
+ Q3PtrList<Todo> tl = calendar->rawTodos();
Todo* to = tl.first();
i = 0;
message = i18n("Processing todo # ");
procCount = 0;
while ( to ) {
if ( to->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) {
@@ -602,26 +602,26 @@ bool SharpFormat::save( Calendar *calendar)
else if ( to->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 << 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();
//qDebug("answer \n%s ", answer.latin1());
getNumFromRecord( answer, to ) ;
@@ -639,17 +639,17 @@ bool SharpFormat::save( Calendar *calendar)
}
status.setText ( i18n("Changing todos ...") );
qApp->processEvents();
//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();
command = "db2file todo -w -g -c " + codec+ " < "+ fileName;
system ( command.latin1() );
//qDebug("command %s file :\n%s ", command.latin1(), changeString.latin1());
@@ -657,17 +657,17 @@ bool SharpFormat::save( Calendar *calendar)
}
status.setText ( i18n("Deleting todos ...") );
qApp->processEvents();
//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();
command = "db2file todo -d -c " + codec+ " < "+ fileName;
system ( command.latin1() );
// qDebug("command %s file :\n%s ", command.latin1(), deleteString.latin1());
@@ -780,13 +780,13 @@ QString SharpFormat::getEventString( Event* event )
list.append( "2" );
list.append( QString::number( rec->frequency()) );//12
writeEndDate = true;
{
int count = 1;
- QPtrList<Recurrence::rMonthPos> rmp;
+ Q3PtrList<Recurrence::rMonthPos> rmp;
rmp = rec->monthPositions();
if ( rmp.first()->negative )
count = 5 - rmp.first()->rPos - 1;
else
count = rmp.first()->rPos - 1;
list.append( QString::number( count ) );