author | zautrix <zautrix> | 2005-01-14 11:37:40 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-14 11:37:40 (UTC) |
commit | 61c95ce0295f1397db6499c5b468a9fb3d32a0f4 (patch) (unidiff) | |
tree | 2bceecc46d42a572adfad7d8e5000d1534642cbd /kde2file/caldump | |
parent | a46ecf5ed81460ec9a4e457798e1bf0fb74c5624 (diff) | |
download | kdepimpi-61c95ce0295f1397db6499c5b468a9fb3d32a0f4.zip kdepimpi-61c95ce0295f1397db6499c5b468a9fb3d32a0f4.tar.gz kdepimpi-61c95ce0295f1397db6499c5b468a9fb3d32a0f4.tar.bz2 |
made kapi saving faster
-rw-r--r-- | kde2file/caldump/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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[] ) | |||
108 | qDebug("read "); | 108 | qDebug("read "); |
109 | } | 109 | } |
110 | QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; | 110 | QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; |
111 | CalendarResources *calendarResource = 0; | 111 | CalendarResources *calendarResource = 0; |
112 | CalendarLocal *localCalendar = 0; | 112 | CalendarLocal *localCalendar = 0; |
113 | KConfig c( locate( "config", "korganizerrc" ) ); | 113 | KConfig c( locate( "config", "korganizerrc" ) ); |
114 | c.setGroup( "Time & Date" ); | 114 | c.setGroup( "Time & Date" ); |
115 | QString tz = c.readEntry( "TimeZoneId" ); | 115 | QString tz = c.readEntry( "TimeZoneId" ); |
116 | calendarResource = new CalendarResources( tz ); | 116 | calendarResource = new CalendarResources( tz ); |
117 | calendarResource->readConfig(); | 117 | calendarResource->readConfig(); |
118 | calendarResource->load(); | 118 | calendarResource->load(); |
119 | qDebug("************************************* "); | 119 | qDebug("************************************* "); |
120 | qDebug("**************kdecaldump************* "); | 120 | qDebug("**************kdecaldump************* "); |
121 | qDebug("************************************* "); | 121 | qDebug("************************************* "); |
122 | qDebug("Using timezone ID: %s", calendarResource->timeZoneId().latin1()); | 122 | qDebug("Using timezone ID: %s", calendarResource->timeZoneId().latin1()); |
123 | 123 | ||
124 | if ( !read ) { | 124 | if ( !read ) { |
125 | localCalendar = new CalendarLocal(); | 125 | localCalendar = new CalendarLocal(); |
126 | localCalendar->setTimeZoneId( calendarResource->timeZoneId()); | 126 | localCalendar->setTimeZoneId( calendarResource->timeZoneId()); |
127 | KCal::Incidence::List allInc = calendarResource->rawIncidences(); | 127 | KCal::Incidence::List allInc = calendarResource->rawIncidences(); |
128 | Incidence::List::ConstIterator it; | 128 | Incidence::List::ConstIterator it; |
129 | int num = 0; | 129 | int num = 0; |
130 | for( it = allInc.begin(); it != allInc.end(); ++it ) { | 130 | for( it = allInc.begin(); it != allInc.end(); ++it ) { |
131 | ResourceCalendar * re = calendarResource->resource( (*it) ); | 131 | ResourceCalendar * re = calendarResource->resource( (*it) ); |
132 | if ( re && !re->readOnly() ) { | 132 | if ( re && /*!re->readOnly() now readonly syncing possible */) { |
133 | ++num; | 133 | ++num; |
134 | Incidence* cl = (*it)->clone(); | 134 | Incidence* cl = (*it)->clone(); |
135 | cl->setLastModified( (*it)->lastModified() ); | 135 | cl->setLastModified( (*it)->lastModified() ); |
136 | if ( cl->type() == "Journal" ) | 136 | if ( cl->type() == "Journal" ) |
137 | localCalendar->addJournal( (Journal *) cl ); | 137 | localCalendar->addJournal( (Journal *) cl ); |
138 | else if ( cl->type() == "Todo" ) | 138 | else if ( cl->type() == "Todo" ) |
139 | localCalendar->addTodo( (Todo *) cl ); | 139 | localCalendar->addTodo( (Todo *) cl ); |
140 | else if ( cl->type() == "Event" ) | 140 | else if ( cl->type() == "Event" ) |
141 | localCalendar->addEvent( (Event *) cl ); | 141 | localCalendar->addEvent( (Event *) cl ); |
142 | } | 142 | } |
143 | } | 143 | } |
144 | 144 | ||
145 | FileStorage* storage = new FileStorage( calendarResource ); | 145 | FileStorage* storage = new FileStorage( calendarResource ); |
146 | storage->setFileName( fileName ); | 146 | storage->setFileName( fileName ); |
147 | storage->setSaveFormat( new ICalFormat() ); | 147 | storage->setSaveFormat( new ICalFormat() ); |
148 | storage->save(); | 148 | storage->save(); |
149 | delete storage; | 149 | delete storage; |
150 | qDebug("************************************* "); | 150 | qDebug("************************************* "); |
151 | qDebug("************kdecaldump*************** "); | 151 | qDebug("************kdecaldump*************** "); |
152 | qDebug("************************************* "); | 152 | qDebug("************************************* "); |
153 | qDebug("%d calendar entries dumped to file %s", num, fileName.latin1()); | 153 | qDebug("%d calendar entries dumped to file %s", num, fileName.latin1()); |
154 | 154 | ||
155 | } else { | 155 | } else { |
156 | qDebug("************load"); | 156 | qDebug("************load"); |