-rw-r--r-- | korganizer/kojournalview.cpp | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 6 |
2 files changed, 2 insertions, 5 deletions
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index 51ae0a0..7a96aa5 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp | |||
@@ -91,65 +91,64 @@ JournalEntry* KOJournalView::getNewEntry() | |||
91 | Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); | 91 | Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); |
92 | connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; | 92 | connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; |
93 | connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; | 93 | connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; |
94 | connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; | 94 | connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; |
95 | return Entry; | 95 | return Entry; |
96 | } | 96 | } |
97 | 97 | ||
98 | QPtrList<Incidence> KOJournalView::selectedIncidences() | 98 | QPtrList<Incidence> KOJournalView::selectedIncidences() |
99 | { | 99 | { |
100 | QPtrList<Incidence> eventList; | 100 | QPtrList<Incidence> eventList; |
101 | 101 | ||
102 | return eventList; | 102 | return eventList; |
103 | } | 103 | } |
104 | void KOJournalView::updateConfig() | 104 | void KOJournalView::updateConfig() |
105 | { | 105 | { |
106 | JournalEntry* mEntry = jEntries.first(); | 106 | JournalEntry* mEntry = jEntries.first(); |
107 | while ( mEntry ) { | 107 | while ( mEntry ) { |
108 | mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); | 108 | mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); |
109 | mEntry = jEntries.next(); | 109 | mEntry = jEntries.next(); |
110 | } | 110 | } |
111 | } | 111 | } |
112 | void KOJournalView::updateView() | 112 | void KOJournalView::updateView() |
113 | { | 113 | { |
114 | JournalEntry* mEntry = jEntries.first(); | 114 | JournalEntry* mEntry = jEntries.first(); |
115 | while ( mEntry ) { | 115 | while ( mEntry ) { |
116 | mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); | 116 | mEntry->setFont ( KOPrefs::instance()->mJornalViewFont ); |
117 | mEntry = jEntries.next(); | 117 | mEntry = jEntries.next(); |
118 | } | 118 | } |
119 | showDates( mDate, QDate() ); | 119 | showDates( mDate, QDate() ); |
120 | } | 120 | } |
121 | void KOJournalView::checkModified() | 121 | void KOJournalView::checkModified() |
122 | { | 122 | { |
123 | qDebug("checkmod "); | ||
124 | flushView(); | 123 | flushView(); |
125 | } | 124 | } |
126 | void KOJournalView::flushView() | 125 | void KOJournalView::flushView() |
127 | { | 126 | { |
128 | static bool ff = false; | 127 | static bool ff = false; |
129 | if ( ff ) return; | 128 | if ( ff ) return; |
130 | ff = true; | 129 | ff = true; |
131 | JournalEntry* mEntry = jEntries.first(); | 130 | JournalEntry* mEntry = jEntries.first(); |
132 | while ( mEntry ) { | 131 | while ( mEntry ) { |
133 | mEntry->flushEntry(); | 132 | mEntry->flushEntry(); |
134 | mEntry = jEntries.next(); | 133 | mEntry = jEntries.next(); |
135 | } | 134 | } |
136 | ff = false; | 135 | ff = false; |
137 | } | 136 | } |
138 | 137 | ||
139 | void KOJournalView::clearList() | 138 | void KOJournalView::clearList() |
140 | { | 139 | { |
141 | JournalEntry* mEntry = jEntries.first(); | 140 | JournalEntry* mEntry = jEntries.first(); |
142 | while ( mEntry ) { | 141 | while ( mEntry ) { |
143 | mEntry->clear(); | 142 | mEntry->clear(); |
144 | mEntry = jEntries.next(); | 143 | mEntry = jEntries.next(); |
145 | } | 144 | } |
146 | } | 145 | } |
147 | void KOJournalView::newJournal() | 146 | void KOJournalView::newJournal() |
148 | { | 147 | { |
149 | //qDebug(" KOJournalView::newJournal()"); | 148 | //qDebug(" KOJournalView::newJournal()"); |
150 | flushView(); | 149 | flushView(); |
151 | Journal* mJournal = new Journal; | 150 | Journal* mJournal = new Journal; |
152 | mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); | 151 | mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); |
153 | mCalendar->addJournal(mJournal); | 152 | mCalendar->addJournal(mJournal); |
154 | showDates( mDate, QDate() ); | 153 | showDates( mDate, QDate() ); |
155 | } | 154 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index fb6d6ec..23537a6 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1806,68 +1806,66 @@ void MainWindow::saveOnClose() | |||
1806 | if ( p->mToolBarHorN ) | 1806 | if ( p->mToolBarHorN ) |
1807 | p->mToolBarUpN = myP.y() > height()/2; | 1807 | p->mToolBarUpN = myP.y() > height()/2; |
1808 | else | 1808 | else |
1809 | p->mToolBarUpN = myP.x() > width()/2 ; | 1809 | p->mToolBarUpN = myP.x() > width()/2 ; |
1810 | if ( filterToolBar ) { | 1810 | if ( filterToolBar ) { |
1811 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1811 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1812 | if ( p->mToolBarHorF ) | 1812 | if ( p->mToolBarHorF ) |
1813 | p->mToolBarUpF = myP.y() > height()/2; | 1813 | p->mToolBarUpF = myP.y() > height()/2; |
1814 | else | 1814 | else |
1815 | p->mToolBarUpF = myP.x() > width()/2 ; | 1815 | p->mToolBarUpF = myP.x() > width()/2 ; |
1816 | } | 1816 | } |
1817 | #else | 1817 | #else |
1818 | if ( p->mToolBarHor ) | 1818 | if ( p->mToolBarHor ) |
1819 | p->mToolBarUp = iconToolBar->y() > height()/2; | 1819 | p->mToolBarUp = iconToolBar->y() > height()/2; |
1820 | else | 1820 | else |
1821 | p->mToolBarUp = iconToolBar->x() > width()/2; | 1821 | p->mToolBarUp = iconToolBar->x() > width()/2; |
1822 | if ( p->mToolBarHorV ) | 1822 | if ( p->mToolBarHorV ) |
1823 | p->mToolBarUpV = viewToolBar->y() > height()/2; | 1823 | p->mToolBarUpV = viewToolBar->y() > height()/2; |
1824 | else | 1824 | else |
1825 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; | 1825 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; |
1826 | 1826 | ||
1827 | if ( p->mToolBarHorN ) | 1827 | if ( p->mToolBarHorN ) |
1828 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; | 1828 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; |
1829 | else | 1829 | else |
1830 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; | 1830 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; |
1831 | if ( filterToolBar ) { | 1831 | if ( filterToolBar ) { |
1832 | if ( p->mToolBarHorF ) | 1832 | if ( p->mToolBarHorF ) |
1833 | p->mToolBarUpF = filterToolBar->y() > height()/2; | 1833 | p->mToolBarUpF = filterToolBar->y() > height()/2; |
1834 | else | 1834 | else |
1835 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; | 1835 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; |
1836 | } | 1836 | } |
1837 | #endif | 1837 | #endif |
1838 | if ( mView->viewManager()->journalView() ) | 1838 | |
1839 | mView->viewManager()->journalView()->checkModified(); | 1839 | save(); |
1840 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | ||
1841 | save(); | ||
1842 | mView->writeSettings(); | 1840 | mView->writeSettings(); |
1843 | } | 1841 | } |
1844 | void MainWindow::slotModifiedChanged( bool changed ) | 1842 | void MainWindow::slotModifiedChanged( bool changed ) |
1845 | { | 1843 | { |
1846 | if ( mBlockAtStartup ) | 1844 | if ( mBlockAtStartup ) |
1847 | return; | 1845 | return; |
1848 | 1846 | ||
1849 | int msec; | 1847 | int msec; |
1850 | // we store the changes after 1 minute, | 1848 | // we store the changes after 1 minute, |
1851 | // and for safety reasons after 10 minutes again | 1849 | // and for safety reasons after 10 minutes again |
1852 | if ( !mSyncManager->blockSave() ) | 1850 | if ( !mSyncManager->blockSave() ) |
1853 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1851 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1854 | else | 1852 | else |
1855 | msec = 1000 * 600; | 1853 | msec = 1000 * 600; |
1856 | mSaveTimer.start( msec, true ); // 1 minute | 1854 | mSaveTimer.start( msec, true ); // 1 minute |
1857 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1855 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1858 | mCalendarModifiedFlag = true; | 1856 | mCalendarModifiedFlag = true; |
1859 | } | 1857 | } |
1860 | void MainWindow::saveStopTimer() | 1858 | void MainWindow::saveStopTimer() |
1861 | { | 1859 | { |
1862 | mSaveTimer.stop(); | 1860 | mSaveTimer.stop(); |
1863 | } | 1861 | } |
1864 | void MainWindow::backupAllFiles() | 1862 | void MainWindow::backupAllFiles() |
1865 | { | 1863 | { |
1866 | QDate reference ( 2000,1,1); | 1864 | QDate reference ( 2000,1,1); |
1867 | int daysTo = reference.daysTo ( QDate::currentDate() ); | 1865 | int daysTo = reference.daysTo ( QDate::currentDate() ); |
1868 | setCaption(i18n("Creating backup ... please wait ..." )); | 1866 | setCaption(i18n("Creating backup ... please wait ..." )); |
1869 | qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); | 1867 | qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); |
1870 | // we need the file path, the backup dir and the number of bups as param | 1868 | // we need the file path, the backup dir and the number of bups as param |
1871 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 1869 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
1872 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 1870 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
1873 | bupDir = KGlobalSettings::backupDataDir(); | 1871 | bupDir = KGlobalSettings::backupDataDir(); |