[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: should KSaveFile::simpleBackupFile overwrite old backups?
From:       Allen Winter <winter () kde ! org>
Date:       2008-12-23 21:59:01
Message-ID: 200812231659.02716.winter () kde ! org
[Download RAW message or body]

On Tuesday 23 December 2008 10:33:58 am Robby Stephenson wrote:
> Hi,
>
> I've run into some behavior with the KSaveFile::simpleBackupFile()
> functionality that I wanted to ask about. Essentially, the function doesn't
> do much more than append a backup extension (default is '~'), optionally
> modify the path, and then call QFile::copy().
>
> What I've run into is that QFile::copy returns false if the file exists. So
> while I would have expected repeated calls to simpleBackupFile() to
> repeatedly copy the existing file to the backup, it actually fails if the
> backup already exists. Am I reading that right?
>
> Is that the intended behavior? If so, perhaps we could add a note to the
> API saying the developer is expected to call QFile::remove() before backing
> up the file?
>
I don't think this should be the intended behavior.
I think repeated simpleBackupFile() should just work, without having
to call QFile::remove() in between.

> The KSaveFile::numberedBackupFile() function _does_ remove old copies
> first.
>
Good.  I think I worked on that. :)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic