summaryrefslogtreecommitdiffabout
path: root/libkcal/sharpformat.cpp
authorzautrix <zautrix>2004-09-14 01:03:08 (UTC)
committer zautrix <zautrix>2004-09-14 01:03:08 (UTC)
commit30762fe125216362e1a6c1d5ec5d22d9525aa336 (patch) (unidiff)
tree4ff0fbf43efa921c86d64ff3f50baa9e59d207d9 /libkcal/sharpformat.cpp
parent8ce7eae438dcd20f9c79fc0a36dfef0a6d3931eb (diff)
downloadkdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.zip
kdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.tar.gz
kdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.tar.bz2
Many bugfixes
Diffstat (limited to 'libkcal/sharpformat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/sharpformat.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index defdb09..89eb72f 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -171,26 +171,27 @@ class SharpParser : public QObject
171 171
172 QString categoryList = attList[1] ; 172 QString categoryList = attList[1] ;
173 event->setCategories( lookupCategories( categoryList ) ); 173 event->setCategories( lookupCategories( categoryList ) );
174 174
175 // strange 0 semms to mean: alarm enabled 175 // strange 0 semms to mean: alarm enabled
176 if ( attList[8] == "0" ) { 176 if ( attList[8] == "0" ) {
177 Alarm *alarm; 177 Alarm *alarm;
178 if ( event->alarms().count() > 0 ) 178 if ( event->alarms().count() > 0 )
179 alarm = event->alarms().first(); 179 alarm = event->alarms().first();
180 else { 180 else {
181 alarm = new Alarm( event ); 181 alarm = new Alarm( event );
182 event->addAlarm( alarm ); 182 event->addAlarm( alarm );
183 alarm->setType( Alarm::Audio );
183 } 184 }
184 alarm->setType( Alarm::Audio ); 185 //alarm->setType( Alarm::Audio );
185 alarm->setEnabled( true ); 186 alarm->setEnabled( true );
186 int alarmOffset = attList[9].toInt(); 187 int alarmOffset = attList[9].toInt();
187 alarm->setStartOffset( alarmOffset * -60 ); 188 alarm->setStartOffset( alarmOffset * -60 );
188 } else { 189 } else {
189 Alarm *alarm; 190 Alarm *alarm;
190 if ( event->alarms().count() > 0 ) { 191 if ( event->alarms().count() > 0 ) {
191 alarm = event->alarms().first(); 192 alarm = event->alarms().first();
192 alarm->setType( Alarm::Audio ); 193 alarm->setType( Alarm::Audio );
193 alarm->setStartOffset( -60*15 ); 194 alarm->setStartOffset( -60*15 );
194 alarm->setEnabled( false ); 195 alarm->setEnabled( false );
195 } 196 }
196 } 197 }
@@ -359,31 +360,31 @@ ulong SharpFormat::getCsum( const QStringList & attList)
359 add = s[k].unicode (); 360 add = s[k].unicode ();
360 if ( k < 16 ) 361 if ( k < 16 )
361 mul = mul * mul; 362 mul = mul * mul;
362 add = add * mul *i*i*i; 363 add = add * mul *i*i*i;
363 cSum += add; 364 cSum += add;
364 } 365 }
365 } 366 }
366 } 367 }
367 return cSum; 368 return cSum;
368 369
369} 370}
370#include <stdlib.h> 371#include <stdlib.h>
371#define DEBUGMODE false 372//#define DEBUGMODE false
373#define DEBUGMODE true
372bool SharpFormat::load( Calendar *calendar, Calendar *existngCal ) 374bool SharpFormat::load( Calendar *calendar, Calendar *existngCal )
373{ 375{
374 376
375 377
376 bool debug = DEBUGMODE; 378 bool debug = DEBUGMODE;
377 //debug = true;
378 QString text; 379 QString text;
379 QString codec = "utf8"; 380 QString codec = "utf8";
380 QLabel status ( i18n("Reading events ..."), 0 ); 381 QLabel status ( i18n("Reading events ..."), 0 );
381 382
382 int w = status.sizeHint().width()+20 ; 383 int w = status.sizeHint().width()+20 ;
383 if ( w < 200 ) w = 200; 384 if ( w < 200 ) w = 200;
384 int h = status.sizeHint().height()+20 ; 385 int h = status.sizeHint().height()+20 ;
385 int dw = QApplication::desktop()->width(); 386 int dw = QApplication::desktop()->width();
386 int dh = QApplication::desktop()->height(); 387 int dh = QApplication::desktop()->height();
387 status.setCaption(i18n("Reading DTM Data") ); 388 status.setCaption(i18n("Reading DTM Data") );
388 status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 389 status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
389 status.show(); 390 status.show();