Fix regression in which the Save dialog appears as an Open dialog
7bbbd93cd3fc0abdffd3fa7f144cb50a33fafad9 makes the save dialog appear as Open dialog.
Simplify the code in that commit so it does not regress anymore.
Comes with a unit test
New test fails without the patch, works with it. Kate Save As dialog no longer shows as Open dialog.
REVIEW: 129732