Hello all, using Qt 4.3.3 and Open Suse 10.3

I'm trying to use the static function QFileDialog::getSaveFileName and I notice that the file name returned doesn't have the file extension that is specified in the selected filter appended to it. This renders the overwrite check useless as it's looking for the filename without an extenstion when the filename should have one.

Some code to illustrate:

Qt Code:
  1. QString fileName;
  2. QString filter = tr("My Files (*.ggg)");
  3.  
  4. fileName = QFileDialog::getSaveFileName(this, tr("Dlg title"), tr("/home/temp/"), filter);
  5. qDebug() << fileName;
To copy to clipboard, switch view to plain text mode 

now when this code is executed I would expect fileName to have a .ggg extenstion but it's only the path + the text the user entered in the lineEdit for the filename. So if the user didn't type in the extension (in this case .ggg) it's not included in the filename returned. The overwrite check is looking for the filename with no extenstion, so it doesn't complain. I've tried setting the selectedFilter in the function call and this makes no change in my result.

Am I doing something incorrectly or is this just how it works?
Obviously I can check the filename and add the extension, but I'd like to use the overwrite check so I don't have to close the dialog and reopen it just so the user can pick another name.