summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-11 18:34:05 (UTC)
committer zautrix <zautrix>2005-06-11 18:34:05 (UTC)
commitb56d3be87557510285d3381250faf9b7af300680 (patch) (unidiff)
tree887e24db261f56f78dda8397196a6125cc346fc5 /korganizer
parent81370a5f955c2710b6e9336b6c412c8d630ef72a (diff)
downloadkdepimpi-b56d3be87557510285d3381250faf9b7af300680.zip
kdepimpi-b56d3be87557510285d3381250faf9b7af300680.tar.gz
kdepimpi-b56d3be87557510285d3381250faf9b7af300680.tar.bz2
fixxx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp39
1 files changed, 30 insertions, 9 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 8f5de4d..753d81f 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -639,19 +639,22 @@ CalendarView::~CalendarView()
639} 639}
640void CalendarView::checkAlarms() 640void CalendarView::checkAlarms()
641{ 641{
642 KConfig *config = KOGlobals::config(); 642 KConfig *config = KOGlobals::config();
643 config->setGroup( "AppRun" ); 643 config->setGroup( "AppRun" );
644 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 644 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
645 int daysto = dt.daysTo( QDate::currentDate() );
646 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
647 dt = dt.addDays( days );
645 int secto = dt.secsTo( QDateTime::currentDateTime() ); 648 int secto = dt.secsTo( QDateTime::currentDateTime() );
646 int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30; 649 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
647 qDebug("KO: Reading program stop %d ", secs); 650 //qDebug("KO: Reading program stop %d ", secs);
648 //secs -= ( 3600 * 24*3 ); // debug only 651 //secs -= ( 3600 * 24*3 ); // debug only
649 QDateTime latest = dt.addSecs ( secs ); 652 QDateTime latest = dt.addSecs ( secs );
650 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 653 qDebug("KO: Last termination on %s ", latest.toString().latin1());
651 qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 654 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
652 QPtrList<Incidence> el = mCalendar->rawIncidences(); 655 QPtrList<Incidence> el = mCalendar->rawIncidences();
653 QPtrList<Incidence> al; 656 QPtrList<Incidence> al;
654 Incidence* inL = el.first(); 657 Incidence* inL = el.first();
655 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 658 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
656 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 659 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
657 while ( inL ) { 660 while ( inL ) {
@@ -2155,22 +2158,40 @@ void CalendarView::writeSettings()
2155 mDialogManager->writeSettings( config ); 2158 mDialogManager->writeSettings( config );
2156 //KOPrefs::instance()->usrWriteConfig(); 2159 //KOPrefs::instance()->usrWriteConfig();
2157 KOPrefs::instance()->writeConfig(); 2160 KOPrefs::instance()->writeConfig();
2158 2161
2159 writeFilterSettings(config); 2162 writeFilterSettings(config);
2160 config->setGroup( "AppRun" ); 2163 config->setGroup( "AppRun" );
2161 QDateTime dt ( QDate (2005,3,1), QTime( 0,0,0 ) ); 2164 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2165 int days = dt.daysTo( QDate::currentDate() );
2166 dt = dt.addDays( days );
2162 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2167 int secs = dt.secsTo( QDateTime::currentDateTime() );
2163 config->writeEntry( "LatestProgramStop", secs ); 2168 config->writeEntry( "LatestProgramStopDays", days );
2164 qDebug("KO: Writing stop time: %d ", secs); 2169 config->writeEntry( "LatestProgramStopSecs", secs );
2165 qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2170 //qDebug("KO: Writing stop time: %d ", secs);
2166 QDateTime latest = dt.addSecs ( secs ); 2171 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2167 qDebug("KO: Test termination on %s ", latest.toString().latin1()); 2172 //QDateTime latest = dt.addSecs ( secs );
2173 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2168 config->setGroup( "Views" ); 2174 config->setGroup( "Views" );
2169 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2175 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2170 2176
2177#if 0
2178 qDebug("********************* ");
2179 qDebug("Testcode secsto ");
2180 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2181 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2182 int secsto = dt_nodaylight.secsTo( dt_daylight );
2183 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2184 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2185 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
2186 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
2187 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
2188 qDebug("********************* testcode end");
2189
2190#endif
2191
2171 QValueList<int> listINT = mLeftFrame->sizes(); 2192 QValueList<int> listINT = mLeftFrame->sizes();
2172 config->writeEntry("Left Splitter Frame",listINT); 2193 config->writeEntry("Left Splitter Frame",listINT);
2173 QValueList<int> listINT2 = mMainFrame->sizes(); 2194 QValueList<int> listINT2 = mMainFrame->sizes();
2174 config->writeEntry("Main Splitter Frame",listINT2); 2195 config->writeEntry("Main Splitter Frame",listINT2);
2175#ifdef DESKTOP_VERSION 2196#ifdef DESKTOP_VERSION
2176 config->setGroup("WidgetLayout"); 2197 config->setGroup("WidgetLayout");