Diffstat (limited to 'korganizer/koimportoldialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koimportoldialog.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp index 0a3c2d5..c0bde0d 100644 --- a/korganizer/koimportoldialog.cpp +++ b/korganizer/koimportoldialog.cpp | |||
@@ -10,48 +10,49 @@ | |||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qframe.h> | 25 | #include <qframe.h> |
26 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qprogressbar.h> | 28 | #include <qprogressbar.h> |
29 | #include <qwidgetstack.h> | 29 | #include <qwidgetstack.h> |
30 | #include <qdatetime.h> | 30 | #include <qdatetime.h> |
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #include <qhbox.h> | 33 | #include <qhbox.h> |
34 | #include <qregexp.h> | ||
34 | #include <qheader.h> | 35 | #include <qheader.h> |
35 | #include <qdatetime.h> | 36 | #include <qdatetime.h> |
36 | #include <qlistview.h> | 37 | #include <qlistview.h> |
37 | 38 | ||
38 | #include <kdebug.h> | 39 | #include <kdebug.h> |
39 | #include <klocale.h> | 40 | #include <klocale.h> |
40 | #include <kstandarddirs.h> | 41 | #include <kstandarddirs.h> |
41 | #include <kmessagebox.h> | 42 | #include <kmessagebox.h> |
42 | #include <kfiledialog.h> | 43 | #include <kfiledialog.h> |
43 | 44 | ||
44 | #include <libkdepim/categoryselectdialog.h> | 45 | #include <libkdepim/categoryselectdialog.h> |
45 | #include <libkdepim/kinputdialog.h> | 46 | #include <libkdepim/kinputdialog.h> |
46 | 47 | ||
47 | #include <libkcal/calendarlocal.h> | 48 | #include <libkcal/calendarlocal.h> |
48 | #include <libkcal/icalformat.h> | 49 | #include <libkcal/icalformat.h> |
49 | #include <kabc/stdaddressbook.h> | 50 | #include <kabc/stdaddressbook.h> |
50 | 51 | ||
51 | #include "koprefs.h" | 52 | #include "koprefs.h" |
52 | #include "koglobals.h" | 53 | #include "koglobals.h" |
53 | 54 | ||
54 | #include "koimportoldialog.h" | 55 | #include "koimportoldialog.h" |
55 | 56 | ||
56 | #include "../outport/msoutl9.h" | 57 | #include "../outport/msoutl9.h" |
57 | #include <ole2.h> | 58 | #include <ole2.h> |
@@ -229,49 +230,49 @@ void KOImportOLdialog::readCalendarData( DWORD folder ) | |||
229 | _AppointmentItem * pItem = (_AppointmentItem *)&itm; | 230 | _AppointmentItem * pItem = (_AppointmentItem *)&itm; |
230 | ol2kopiCalendar( pItem ); | 231 | ol2kopiCalendar( pItem ); |
231 | itm->Release(); | 232 | itm->Release(); |
232 | } | 233 | } |
233 | } | 234 | } |
234 | void KOImportOLdialog::slotOk() | 235 | void KOImportOLdialog::slotOk() |
235 | { | 236 | { |
236 | QDialog::accept(); | 237 | QDialog::accept(); |
237 | } | 238 | } |
238 | 239 | ||
239 | void KOImportOLdialog::ol2kopiCalendar( _AppointmentItem * aItem, bool computeRecurrence ) | 240 | void KOImportOLdialog::ol2kopiCalendar( _AppointmentItem * aItem, bool computeRecurrence ) |
240 | { | 241 | { |
241 | KCal::Event* event = new KCal::Event(); | 242 | KCal::Event* event = new KCal::Event(); |
242 | if ( aItem->GetAllDayEvent() ){ | 243 | if ( aItem->GetAllDayEvent() ){ |
243 | event->setDtStart( QDateTime( mDdate2Qdtr( aItem->GetStart()).date(),QTime(0,0,0 ) )); | 244 | event->setDtStart( QDateTime( mDdate2Qdtr( aItem->GetStart()).date(),QTime(0,0,0 ) )); |
244 | event->setDtEnd( QDateTime( mDdate2Qdtr( aItem->GetEnd()) .date(),QTime(0,0,0 )).addDays(-1)); | 245 | event->setDtEnd( QDateTime( mDdate2Qdtr( aItem->GetEnd()) .date(),QTime(0,0,0 )).addDays(-1)); |
245 | event->setFloats( true ); | 246 | event->setFloats( true ); |
246 | } else { | 247 | } else { |
247 | event->setDtStart( mDdate2Qdtr( aItem->GetStart()) ); | 248 | event->setDtStart( mDdate2Qdtr( aItem->GetStart()) ); |
248 | event->setDtEnd( mDdate2Qdtr( aItem->GetEnd()) ); | 249 | event->setDtEnd( mDdate2Qdtr( aItem->GetEnd()) ); |
249 | event->setFloats( false ); | 250 | event->setFloats( false ); |
250 | } | 251 | } |
251 | event->setSummary( QString::fromUcs2( aItem->GetSubject().GetBuffer()) ); | 252 | event->setSummary( QString::fromUcs2( aItem->GetSubject().GetBuffer()) ); |
252 | event->setLocation( QString::fromUcs2( aItem->GetLocation().GetBuffer()) ); | 253 | event->setLocation( QString::fromUcs2( aItem->GetLocation().GetBuffer()) ); |
253 | event->setDescription( QString::fromUcs2( aItem->GetBody().GetBuffer()) ); | 254 | event->setDescription( QString::fromUcs2( aItem->GetBody().GetBuffer()).replace( QRegExp("\\r"), "") ); |
254 | QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()); | 255 | QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()); |
255 | event->setCategories( QStringList::split( ";", cat )); | 256 | event->setCategories( QStringList::split( ";", cat )); |
256 | if ( aItem->GetReminderSet() ) { | 257 | if ( aItem->GetReminderSet() ) { |
257 | event->clearAlarms(); | 258 | event->clearAlarms(); |
258 | Alarm* alarm = event->newAlarm(); | 259 | Alarm* alarm = event->newAlarm(); |
259 | alarm->setStartOffset( -aItem->GetReminderMinutesBeforeStart()*60 ); | 260 | alarm->setStartOffset( -aItem->GetReminderMinutesBeforeStart()*60 ); |
260 | alarm->setEnabled( true ); | 261 | alarm->setEnabled( true ); |
261 | if ( aItem->GetReminderPlaySound() ) { | 262 | if ( aItem->GetReminderPlaySound() ) { |
262 | alarm->setType( Alarm::Audio ); | 263 | alarm->setType( Alarm::Audio ); |
263 | alarm->setAudioFile( QString::fromUcs2( aItem->GetReminderSoundFile().GetBuffer())); | 264 | alarm->setAudioFile( QString::fromUcs2( aItem->GetReminderSoundFile().GetBuffer())); |
264 | } | 265 | } |
265 | else | 266 | else |
266 | alarm->setType( Alarm::Display ); | 267 | alarm->setType( Alarm::Display ); |
267 | alarm->setRepeatCount( aItem->GetReplyTime() ); | 268 | alarm->setRepeatCount( aItem->GetReplyTime() ); |
268 | } | 269 | } |
269 | // OL :pub 0 - pers 1 - priv 2 - conf 3 | 270 | // OL :pub 0 - pers 1 - priv 2 - conf 3 |
270 | // KO : pub 0 - priv 1 - conf 2 | 271 | // KO : pub 0 - priv 1 - conf 2 |
271 | int sec = aItem->GetSensitivity() ; | 272 | int sec = aItem->GetSensitivity() ; |
272 | if ( sec > 1 )// mapping pers -> private | 273 | if ( sec > 1 )// mapping pers -> private |
273 | --sec; | 274 | --sec; |
274 | event->setSecrecy( sec ); | 275 | event->setSecrecy( sec ); |
275 | if ( aItem->GetBusyStatus() == 0 ) | 276 | if ( aItem->GetBusyStatus() == 0 ) |
276 | event->setTransparency( Event::Transparent);// OL free | 277 | event->setTransparency( Event::Transparent);// OL free |
277 | else | 278 | else |