-rw-r--r-- | korganizer/mainwindow.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 9ad0694..eed023c 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1754,36 +1754,35 @@ void MainWindow::saveOnClose() p->mToolBarUpV = viewToolBar->y() > height()/2; else p->mToolBarUpV = viewToolBar->x() > width()/2 ; if ( p->mToolBarHorN ) p->mToolBarUpN = navigatorToolBar->y() > height()/2; else p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; if ( filterToolBar ) { if ( p->mToolBarHorF ) p->mToolBarUpF = filterToolBar->y() > height()/2; else p->mToolBarUpF = filterToolBar->x() > width()/2 ; } #endif - - mView->writeSettings(); if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) save(); + mView->writeSettings(); } void MainWindow::slotModifiedChanged( bool changed ) { if ( mBlockAtStartup ) return; int msec; // we store the changes after 1 minute, // and for safety reasons after 10 minutes again if ( !mSyncManager->blockSave() ) msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; else msec = 1000 * 600; mSaveTimer.start( msec, true ); // 1 minute qDebug("KO: Saving File in %d secs!", msec/1000); mCalendarModifiedFlag = true; @@ -1799,33 +1798,33 @@ void MainWindow::save() return; } if ( mSyncManager->blockSave() ) return; mSyncManager->setBlockSave(true); if ( mView->checkFileVersion( defaultFileName()) ) { if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ QDate reference ( 2000,1,1); int daysTo = reference.daysTo ( QDate::currentDate() ); if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { setCaption(i18n("KO/Pi:Creating backup ... please wait ..." )); qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); // we need the file path, the backup dir and the number of bups as param QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) bupDir = KGlobalSettings::backupDataDir(); - int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );//55;//call backup + int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); if ( retval == 0 ) { qDebug("KO: Backup cancelled. Will try again tomorrow "); // retval == 0 : backup skipped for today, try again tomorrow KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; } else if ( retval == 1 ){ qDebug("KO: Backup created."); // backup ok KOPrefs::instance()->mLastBackupDate = daysTo; } else if ( retval == 2 ){ qDebug("KO: Backup globally cancelled."); // backup globally cancelled KPimGlobalPrefs::instance()->mBackupEnabled = false; } // retval == 3: do nothing, try again later } |