While exporting a divelog to xml/ssrf, if given filename containsa dot it 
doesnt get saved as intended. 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 commit solves this 
issue.

Signed-off-by: Abhinav Agarwal <[email protected]>
---
 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..1636c4b 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.contains('.')) || 
(filename.contains('.') && !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

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to