author | zautrix <zautrix> | 2005-06-11 18:34:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-11 18:34:05 (UTC) |
commit | b56d3be87557510285d3381250faf9b7af300680 (patch) (unidiff) | |
tree | 887e24db261f56f78dda8397196a6125cc346fc5 | |
parent | 81370a5f955c2710b6e9336b6c412c8d630ef72a (diff) | |
download | kdepimpi-b56d3be87557510285d3381250faf9b7af300680.zip kdepimpi-b56d3be87557510285d3381250faf9b7af300680.tar.gz kdepimpi-b56d3be87557510285d3381250faf9b7af300680.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/calendarview.cpp | 39 | ||||
-rw-r--r-- | microkde/kfiledialog.cpp | 2 |
2 files changed, 31 insertions, 10 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8f5de4d..753d81f 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -629,39 +629,42 @@ CalendarView::~CalendarView() | |||
629 | { | 629 | { |
630 | // kdDebug() << "~CalendarView()" << endl; | 630 | // kdDebug() << "~CalendarView()" << endl; |
631 | //qDebug("CalendarView::~CalendarView() "); | 631 | //qDebug("CalendarView::~CalendarView() "); |
632 | delete mDialogManager; | 632 | delete mDialogManager; |
633 | delete mViewManager; | 633 | delete mViewManager; |
634 | delete mStorage; | 634 | delete mStorage; |
635 | delete mDateFrame ; | 635 | delete mDateFrame ; |
636 | delete beamDialog; | 636 | delete beamDialog; |
637 | delete mEventViewerDialog; | 637 | delete mEventViewerDialog; |
638 | //kdDebug() << "~CalendarView() done" << endl; | 638 | //kdDebug() << "~CalendarView() done" << endl; |
639 | } | 639 | } |
640 | void CalendarView::checkAlarms() | 640 | void 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 ) { |
658 | bool ok = false; | 661 | bool ok = false; |
659 | int offset = 0; | 662 | int offset = 0; |
660 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; | 663 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; |
661 | if ( ok ) { | 664 | if ( ok ) { |
662 | //qDebug("OK %s",next.toString().latin1()); | 665 | //qDebug("OK %s",next.toString().latin1()); |
663 | if ( next < cur ) { | 666 | if ( next < cur ) { |
664 | al.append( inL ); | 667 | al.append( inL ); |
665 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); | 668 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); |
666 | } | 669 | } |
667 | } | 670 | } |
@@ -2145,42 +2148,60 @@ void CalendarView::readSettings() | |||
2145 | 2148 | ||
2146 | 2149 | ||
2147 | void CalendarView::writeSettings() | 2150 | void CalendarView::writeSettings() |
2148 | { | 2151 | { |
2149 | // kdDebug() << "CalendarView::writeSettings" << endl; | 2152 | // kdDebug() << "CalendarView::writeSettings" << endl; |
2150 | 2153 | ||
2151 | KConfig *config = KOGlobals::config(); | 2154 | KConfig *config = KOGlobals::config(); |
2152 | 2155 | ||
2153 | mViewManager->writeSettings( config ); | 2156 | mViewManager->writeSettings( config ); |
2154 | mTodoList->saveLayout(config,QString("Todo Layout")); | 2157 | mTodoList->saveLayout(config,QString("Todo Layout")); |
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"); |
2177 | QStringList list ;//= config->readListEntry("MainLayout"); | 2198 | QStringList list ;//= config->readListEntry("MainLayout"); |
2178 | int x,y,w,h; | 2199 | int x,y,w,h; |
2179 | QWidget* wid; | 2200 | QWidget* wid; |
2180 | wid = topLevelWidget(); | 2201 | wid = topLevelWidget(); |
2181 | x = wid->geometry().x(); | 2202 | x = wid->geometry().x(); |
2182 | y = wid->geometry().y(); | 2203 | y = wid->geometry().y(); |
2183 | w = wid->width(); | 2204 | w = wid->width(); |
2184 | h = wid->height(); | 2205 | h = wid->height(); |
2185 | list.clear(); | 2206 | list.clear(); |
2186 | list << QString::number( x ); | 2207 | list << QString::number( x ); |
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index c64f325..383e711 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp | |||
@@ -49,33 +49,33 @@ QString KFileDialog::getOpenFileName( const QString & fn, | |||
49 | if ( file.isEmpty() ) | 49 | if ( file.isEmpty() ) |
50 | file = QDir::homeDirPath()+"/*";; | 50 | file = QDir::homeDirPath()+"/*";; |
51 | QFileInfo fi ( file ); | 51 | QFileInfo fi ( file ); |
52 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); | 52 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); |
53 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); | 53 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); |
54 | lay.addWidget( &o); | 54 | lay.addWidget( &o); |
55 | dia.showMaximized(); | 55 | dia.showMaximized(); |
56 | dia.setCaption( cap ); | 56 | dia.setCaption( cap ); |
57 | int res = dia.exec(); | 57 | int res = dia.exec(); |
58 | if ( res ) | 58 | if ( res ) |
59 | retfile = o.selectedName(); | 59 | retfile = o.selectedName(); |
60 | return retfile; | 60 | return retfile; |
61 | } | 61 | } |
62 | QString KFileDialog::getExistingDirectory( const QString & fn, | 62 | QString KFileDialog::getExistingDirectory( const QString & fn, |
63 | const QString & cap, QWidget * par ) | 63 | const QString & cap, QWidget * par ) |
64 | { | 64 | { |
65 | return KFileDialog::getSaveFileName( fn, cap, pr ); | 65 | return KFileDialog::getSaveFileName( fn, cap, par ); |
66 | } | 66 | } |
67 | #else | 67 | #else |
68 | 68 | ||
69 | #include <qfiledialog.h> | 69 | #include <qfiledialog.h> |
70 | 70 | ||
71 | QString KFileDialog::getSaveFileName( const QString & fn, | 71 | QString KFileDialog::getSaveFileName( const QString & fn, |
72 | const QString & cap , QWidget * par ) | 72 | const QString & cap , QWidget * par ) |
73 | { | 73 | { |
74 | return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); | 74 | return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); |
75 | } | 75 | } |
76 | QString KFileDialog::getOpenFileName( const QString & fn, | 76 | QString KFileDialog::getOpenFileName( const QString & fn, |
77 | const QString & cap, QWidget * par ) | 77 | const QString & cap, QWidget * par ) |
78 | { | 78 | { |
79 | 79 | ||
80 | return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); | 80 | return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); |
81 | } | 81 | } |