KcoreAddons

Oswald Buddenhagen ossi at kde.org
Fri Oct 21 10:36:27 UTC 2011


On Fri, Oct 21, 2011 at 11:22:42AM +0200, David Faure wrote:
> Yes, truncated writes were exactly what I was thinking about, and the
> whole reason for putting this into QFile. I'm not really sure I
> understand the setLatchErrors() API idea though. Can't QFile "remember
> that there was an error" in all cases, and QSaveFile asks it, and
> other users might not, end of story? What's the setter for?
> 
two reasons:
- setting the error code involves translating a string. of course that's
  minor, and it would be possible to actually delay it (at the cost of
  some complexity)
- more importantly, i don't want any followup writes to get through once
  an error was noted (imagine disk space becomes available again - then
  you get a file with stuff missing in the middle. that's not important
  for the savefile case (it would just discard the temp file anyway),
  but the mode could be used for something else, too) - that's why i
  called it "latch"


More information about the Kde-frameworks-devel mailing list