Fix "Save As" in failed-save message box
ClosedPublic

Authored by muhlenpfordt on Apr 20 2018, 8:31 AM.

Details

Summary

After saving a file failed and clicking Save As will lead to
an error message "Gwenview cannot save this kind of documents" in
some situations though saving should be possible.
This is caused by passing the wrong source URL for saveAs().

FIXED-IN: 18.04.1

Test Plan
  1. Start Gwenview in View or Browse Mode
  2. FileSave As or Ctrl++S
  3. Try to save in a folder you don't have write permission (e.g. Root)
  4. Click Save As in the warning dialog
  5. Try to save in a writable folder
  6. Saving should not fail with "Cannot save this kind of documents"

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
muhlenpfordt requested review of this revision.Apr 20 2018, 8:31 AM
muhlenpfordt created this revision.

The "Save As" dialog always starts in the source file's directory now and not in the previously selected but failed one.
Is it desirable to restart in the previous folder?

rkflx added a subscriber: rkflx.Apr 20 2018, 8:40 AM

The "Save As" dialog always starts in the source file's directory now and not in the previously selected but failed one.
Is it desirable to restart in the previous folder?

As we are talking about a recovery mechanism here, I'd say going all the way back to the location you started out from might be preferable. After all, the failure to save might also relate to a problem with the directory selection, if I'm not mistaken. Thus, in this case it's probably best to favour bullet-proof recovery over speedy recovery.

rkflx accepted this revision.Apr 20 2018, 9:29 PM

…and another fix done in slotSaveResult. LGTM

This revision is now accepted and ready to land.Apr 20 2018, 9:29 PM
This revision was automatically updated to reflect the committed changes.