-rw-r--r-- | pwmanager/pwmanager/pwmdoc.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp index 36b0df5..1f3c58b 100644 --- a/pwmanager/pwmanager/pwmdoc.cpp +++ b/pwmanager/pwmanager/pwmdoc.cpp @@ -431,17 +431,17 @@ PwMerror PwMDoc::saveDoc(char compress, const QString *file) } int mLastBackupDate = 0; KConfig configGlobal (locateLocal("config","pwmanagerbuprc")); QFileInfo fileInfo ( filename ); mLastBackupDate = configGlobal.readNumEntry( "LastBackupDate-"+ fileInfo.fileName (), 0 ); KConfig config (locateLocal("config","microkdeglobalrc")); config.setGroup( "BackupSettings" ); bool b_enabled = config.readBoolEntry( "BackupEnabled" ); - if ( b_enabled ) { + if ( b_enabled && QFile::exists(filename)) { int num = config.readNumEntry( "BackupNumbers" ); int d_count = config.readNumEntry( "BackupDayCount" ); bool stdDir = config.readBoolEntry( "BackupUseDefaultDir" ); QString bupDir = config.readEntry( "BackupDatadir" ); QDate reference ( 2000,1,1 ); int daysTo = reference.daysTo ( QDate::currentDate() ); bool saveDate = false; if ( daysTo - d_count >= mLastBackupDate ) { |