summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index a9d42f0..28649d9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -816,49 +816,53 @@ void CalendarView::updateView(const QDate &start, const QDate &end)
816 } 816 }
817#endif 817#endif
818 mTodoList->updateView(); 818 mTodoList->updateView();
819 mViewManager->updateView(start, end); 819 mViewManager->updateView(start, end);
820 //mDateNavigator->updateView(); 820 //mDateNavigator->updateView();
821} 821}
822 822
823 823
824 824
825void CalendarView::checkFiles() 825void CalendarView::checkFiles()
826{ 826{
827 QString message; 827 QString message;
828 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 828 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
829 KopiCalendarFile * cal = calendars.first(); 829 KopiCalendarFile * cal = calendars.first();
830 while ( cal ) { 830 while ( cal ) {
831 if ( cal->mErrorOnLoad ) { 831 if ( cal->mErrorOnLoad ) {
832 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 832 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
833 } 833 }
834 cal = calendars.next(); 834 cal = calendars.next();
835 } 835 }
836 if ( !message.isEmpty() ) { 836 if ( !message.isEmpty() ) {
837 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); 837 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
838 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); 838 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed"));
839 } 839 }
840 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 840 static bool firstTime = true;
841 if ( firstTime ) {
842 firstTime = false;
843 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
844 }
841} 845}
842void CalendarView::checkAlarms() 846void CalendarView::checkAlarms()
843{ 847{
844 848
845 849
846 KConfig *config = KOGlobals::config(); 850 KConfig *config = KOGlobals::config();
847 config->setGroup( "AppRun" ); 851 config->setGroup( "AppRun" );
848 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 852 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
849 int daysto = dt.daysTo( QDate::currentDate() ); 853 int daysto = dt.daysTo( QDate::currentDate() );
850 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 854 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
851 dt = dt.addDays( days ); 855 dt = dt.addDays( days );
852 int secto = dt.secsTo( QDateTime::currentDateTime() ); 856 int secto = dt.secsTo( QDateTime::currentDateTime() );
853 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; 857 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
854 //qDebug("KO: Reading program stop %d ", secs); 858 //qDebug("KO: Reading program stop %d ", secs);
855 //secs -= ( 3600 * 24*3 ); // debug only 859 //secs -= ( 3600 * 24*3 ); // debug only
856 QDateTime latest = dt.addSecs ( secs ); 860 QDateTime latest = dt.addSecs ( secs );
857 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 861 qDebug("KO: Last termination on %s ", latest.toString().latin1());
858 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 862 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
859 QPtrList<Incidence> el = mCalendar->rawIncidences(); 863 QPtrList<Incidence> el = mCalendar->rawIncidences();
860 QPtrList<Incidence> al; 864 QPtrList<Incidence> al;
861 Incidence* inL = el.first(); 865 Incidence* inL = el.first();
862 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 866 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
863 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 867 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
864 while ( inL ) { 868 while ( inL ) {