summaryrefslogtreecommitdiffabout
path: root/kde2file
Side-by-side diff
Diffstat (limited to 'kde2file') (more/less context) (ignore whitespace changes)
-rw-r--r--kde2file/abdump/main.cpp2
-rw-r--r--kde2file/caldump/main.cpp2
2 files changed, 1 insertions, 3 deletions
diff --git a/kde2file/abdump/main.cpp b/kde2file/abdump/main.cpp
index 1ee64f5..9ad78e5 100644
--- a/kde2file/abdump/main.cpp
+++ b/kde2file/abdump/main.cpp
@@ -83,50 +83,48 @@ int main( int argc, char *argv[] )
KInstance ins ( progName );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
bool read = false;
if ( args->isSet( "read" ) ) {
read = true;
qDebug("read ");
}
QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf";
KABC::StdAddressBook* standardAddressBook = KABC::StdAddressBook::self();
standardAddressBook->setAutomaticSave( false );
qDebug("************************************* ");
qDebug("***************kdeABdump************* ");
qDebug("************************************* ");
if ( !read ) {
KABC::AddressBook::Iterator it;
KABC::VCardConverter converter;
QString datastream;
for( it = standardAddressBook->begin(); it != standardAddressBook->end(); ++it ) {
if ( (*it).isEmpty() || ! (*it).resource() )
continue;
- if ( (*it).resource()->readOnly() )
- continue;
KABC::Addressee a = ( *it );
QString vcard = converter.createVCard( a );
vcard += QString("\r\n");
datastream += vcard;
}
QFile outFile(fileName);
if ( outFile.open(IO_WriteOnly) ) {
QTextStream t( &outFile ); // use a text stream
t.setEncoding( QTextStream::UnicodeUTF8 );
t <<datastream;
t << "\r\n\r\n";
outFile.close();
}
} else {
//Addressee::List aList;//parseVCards( const QString& vcard );
KABC::Addressee::List list;
int added = 0, changedC = 0, deleted = 0;
QFile file( fileName );
if ( file.open( IO_ReadOnly ) ) {
QTextStream t( &file ); // use a text stream
t.setEncoding( QTextStream::UnicodeUTF8 );
QString data;
data = t.read();
file.close();
diff --git a/kde2file/caldump/main.cpp b/kde2file/caldump/main.cpp
index be1735b..08ccafb 100644
--- a/kde2file/caldump/main.cpp
+++ b/kde2file/caldump/main.cpp
@@ -108,49 +108,49 @@ int main( int argc, char *argv[] )
qDebug("read ");
}
QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics";
CalendarResources *calendarResource = 0;
CalendarLocal *localCalendar = 0;
KConfig c( locate( "config", "korganizerrc" ) );
c.setGroup( "Time & Date" );
QString tz = c.readEntry( "TimeZoneId" );
calendarResource = new CalendarResources( tz );
calendarResource->readConfig();
calendarResource->load();
qDebug("************************************* ");
qDebug("**************kdecaldump************* ");
qDebug("************************************* ");
qDebug("Using timezone ID: %s", calendarResource->timeZoneId().latin1());
if ( !read ) {
localCalendar = new CalendarLocal();
localCalendar->setTimeZoneId( calendarResource->timeZoneId());
KCal::Incidence::List allInc = calendarResource->rawIncidences();
Incidence::List::ConstIterator it;
int num = 0;
for( it = allInc.begin(); it != allInc.end(); ++it ) {
ResourceCalendar * re = calendarResource->resource( (*it) );
- if ( re && !re->readOnly() ) {
+ if ( re && /*!re->readOnly() now readonly syncing possible */) {
++num;
Incidence* cl = (*it)->clone();
cl->setLastModified( (*it)->lastModified() );
if ( cl->type() == "Journal" )
localCalendar->addJournal( (Journal *) cl );
else if ( cl->type() == "Todo" )
localCalendar->addTodo( (Todo *) cl );
else if ( cl->type() == "Event" )
localCalendar->addEvent( (Event *) cl );
}
}
FileStorage* storage = new FileStorage( calendarResource );
storage->setFileName( fileName );
storage->setSaveFormat( new ICalFormat() );
storage->save();
delete storage;
qDebug("************************************* ");
qDebug("************kdecaldump*************** ");
qDebug("************************************* ");
qDebug("%d calendar entries dumped to file %s", num, fileName.latin1());
} else {
qDebug("************load");