Force extension to the file and check save type by filter and not by filename.
This commit is contained in:
parent
777790ebc7
commit
799252e8f2
|
@ -454,8 +454,22 @@ void MainWindow::Save()
|
|||
|
||||
if (list.size() > 0)
|
||||
{
|
||||
bool xml = (dialog.selectedNameFilter() == filters[0] && list[0].endsWith(".xml", Qt::CaseInsensitive));
|
||||
mResults.Save(list[0], xml);
|
||||
QString filename = list[0];
|
||||
|
||||
//Check if xml file type was selected
|
||||
bool xml = (dialog.selectedNameFilter() == filters[0]);
|
||||
|
||||
//Force xml extension to the file
|
||||
if (xml && !filename.endsWith(".xml", Qt::CaseInsensitive)) {
|
||||
filename+=".xml";
|
||||
}
|
||||
|
||||
//Force .txt extension
|
||||
if (!xml && !filename.endsWith(".txt", Qt::CaseInsensitive)) {
|
||||
filename+=".txt";
|
||||
}
|
||||
|
||||
mResults.Save(filename, xml);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue