[PATCH] Better solves Bug#860

Abhinav Agarwal aagarwal.gtr at gmail.com
Fri Mar 20 13:40:12 PDT 2015


While exporting a divelog to xml/ssrf, if given filename contains a dot it doesnt get saved as intended. for eg: if given filename is 'divelog.first' it should get saved as 'divelog.first.ssrf' but it gets saved as 'divelog.first'. This happens only on linux and not on windows. If you were to do the same on windows it would get saved as 'divelog.first.xml'. This patch solves the issue. It is syntactically better than the previous patch I submitted.

Signed-off-by: Abhinav Agarwal <aagarwal.gtr at gmail.com>
---
 qt-ui/divelogexportdialog.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp
index 12a8c32..1c78440 100644
--- a/qt-ui/divelogexportdialog.cpp
+++ b/qt-ui/divelogexportdialog.cpp
@@ -295,7 +295,7 @@ void DiveLogExportDialog::on_buttonBox_accepted()
 			filename = QFileDialog::getSaveFileName(this, tr("Export Subsurface XML"), lastDir,
 								tr("XML files (*.xml *.ssrf)"));
 			if (!filename.isNull() && !filename.isEmpty()) {
-				if (!filename.contains('.'))
+				if (!filename.endsWith(".xml") && !filename.endsWith(".ssrf"))
 					filename.append(".ssrf");
 				QByteArray bt = QFile::encodeName(filename);
 				save_dives_logic(bt.data(), ui->exportSelected->isChecked());
-- 
2.1.0



More information about the subsurface mailing list