summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koimportoldialog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp
index cc13395..c4d5f06 100644
--- a/korganizer/koimportoldialog.cpp
+++ b/korganizer/koimportoldialog.cpp
@@ -207,98 +207,98 @@ void KOImportOLdialog::readCalendarData( DWORD folder )
MAPIFolder mf(dispItem);
mf.m_lpDispatch->AddRef();
_Items folderItems;
_variant_t indx((long)0);
LPDISPATCH itm;
int i;
folderItems = mf.GetItems();
QProgressBar bar( folderItems.GetCount(),0 );
bar.setCaption (i18n("Importing - close to abort!") );
int h = bar.sizeHint().height() ;
int w = 300;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
bar.show();
for(i=1; i <= folderItems.GetCount(); ++i)
{
qApp->processEvents();
if ( ! bar.isVisible() )
return ;
bar.setProgress( i );
indx = (long)i;
itm = folderItems.Item(indx.Detach());
_AppointmentItem * pItem = (_AppointmentItem *)&itm;
ol2kopiCalendar( pItem );
itm->Release();
}
}
void KOImportOLdialog::slotOk()
{
QDialog::accept();
}
void KOImportOLdialog::ol2kopiCalendar( _AppointmentItem * aItem, bool computeRecurrence )
{
KCal::Event* event = new KCal::Event();
if ( aItem->GetAllDayEvent() ){
event->setDtStart( QDateTime( mDdate2Qdtr( aItem->GetStart()).date(),QTime(0,0,0 ) ));
event->setDtEnd( QDateTime( mDdate2Qdtr( aItem->GetEnd()) .date(),QTime(0,0,0 )).addDays(-1));
event->setFloats( true );
} else {
event->setDtStart( mDdate2Qdtr( aItem->GetStart()) );
event->setDtEnd( mDdate2Qdtr( aItem->GetEnd()) );
event->setFloats( false );
}
event->setSummary( QString::fromUcs2( aItem->GetSubject().GetBuffer()) );
event->setLocation( QString::fromUcs2( aItem->GetLocation().GetBuffer()) );
event->setDescription( QString::fromUcs2( aItem->GetBody().GetBuffer()).replace( QRegExp("\\r"), "") );
- QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer());
- event->setCategories( QStringList::split( ";", cat ));
+ QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()).replace( QRegExp("; "), ";");
+ event->setCategories( QStringList::split( ";", cat ) );
if ( aItem->GetReminderSet() ) {
event->clearAlarms();
Alarm* alarm = event->newAlarm();
alarm->setStartOffset( -aItem->GetReminderMinutesBeforeStart()*60 );
alarm->setEnabled( true );
if ( aItem->GetReminderPlaySound() ) {
alarm->setType( Alarm::Audio );
alarm->setAudioFile( QString::fromUcs2( aItem->GetReminderSoundFile().GetBuffer()));
}
else
alarm->setType( Alarm::Display );
alarm->setRepeatCount( aItem->GetReplyTime() );
}
// OL :pub 0 - pers 1 - priv 2 - conf 3
// KO : pub 0 - priv 1 - conf 2
int sec = aItem->GetSensitivity() ;
if ( sec > 1 )// mapping pers -> private
--sec;
event->setSecrecy( sec );
if ( aItem->GetBusyStatus() == 0 )
event->setTransparency( Event::Transparent);// OL free
else
event->setTransparency( Event::Opaque);//OL all other
if ( aItem->GetIsRecurring() && computeRecurrence ) { //recur
RecurrencePattern recpat = aItem->GetRecurrencePattern();
QDate startDate = mDdate2Qdtr(recpat.GetPatternStartDate()).date();
int freq = recpat.GetInterval();
bool hasEndDate = !recpat.GetNoEndDate();
QDate endDate = mDdate2Qdtr(recpat.GetPatternEndDate()).date();
QBitArray weekDays( 7 );
weekDays.fill(false );
uint weekDaysNum = recpat.GetDayOfWeekMask();
int i;
int bb = 2;
for( i = 1; i <= 6; ++i ) {
weekDays.setBit( i - 1, ( bb & weekDaysNum ));
bb = 4 << (i-1);
//qDebug(" %d bit %d ",i-1,weekDays.at(i-1) );
}
if ( 1 & weekDaysNum)
weekDays.setBit( 6 );
// int pos = 1;// pending
Recurrence *r = event->recurrence();