Commit a712417
committed
Update save dialog suffix when the format filter changes
ShowSaveFileDialog set the default suffix once from the configured
extension and never listened to QFileDialog::filterSelected. Picking
another image format in the file type dropdown therefore had no effect
on the saved file: a name typed without an extension still got the
configured suffix, and with a native dialog such as GTK's the extension
already present in the name was not swapped either, so it had to be
edited by hand.
Connect filterSelected, derive the suffix from the selected mime type
and make it the new default suffix. If the current name already ends in
one of the offered image formats, rename it to the new suffix as well;
the Qt widget dialog does that on its own, native dialogs do not.
Fixes #47081 parent 24ce091 commit a712417
1 file changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
107 | 135 | | |
108 | 136 | | |
109 | 137 | | |
| |||
0 commit comments