wargus icon indicating copy to clipboard operation
wargus copied to clipboard

Save/load dialog working with filenames inconsistently

Open side2k opened this issue 3 years ago • 0 comments

Describe the bug

Savegames in save/load dialog are displayed fully, with extensions. But when you click on an existing filename to overwrite it, its full name is put into the save name input, and when user submits it by either clicking on a Save button or double clicking on an existing entry, additional .gz is added to what was in the save name input.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Save' dialog
  2. Enter test name
  3. Click on 'Save'
  4. Do any noticeable change in game (move unit, etc)
  5. Go to Save dialog again
  6. See test.sav.gz in the list, click on it twice
  7. Go to Load dialog.
  8. See a single test.sav.gz in the savegames list, double click it
  9. See that a first save is loaded, with no change from p.4
  10. Look into the savegame directory (~/.stratagus/wc2/save or whatever it is on your platform) - you'll see test.sav.gz with an older timestamp and test.sav.gz.gz with a newer timestamp. The first file is the one that is displayed in the Save/Load dialogs, but the second one is thats actually gets written when you double click on an existing entry in a Save dialog.

Expected behavior

  • filename extensions aren't displayed in the list in Save/Load dialogs
  • when you click on an existing entry to be overwritten, it gets overwritten, and no new obscured file is created

Screenshots and Logs

  • Save dialog after step 6 is performed: Screenshot_20211101_141550

  • Load dialog after step 6 is performed: Screenshot_20211101_141647

  • Filesystem after step 6 is performed:

$ ls -l ~/.stratagus/wc2/save/test*
54609 Nov  1 13:57 test.sav.gz
55279 Nov  1 14:05 test.sav.gz.gz

Desktop (please complete the following information):

  • OS: Kubuntu
  • Version 21.04

side2k avatar Nov 01 '21 11:11 side2k