[PATCH 2/2] Avoid std::string: QByteArray is enough and already compiled in

Thiago Macieira thiago at macieira.org
Thu Nov 14 17:58:09 UTC 2013


No need to add more code to Subsurface by bringing in std::string too.

Signed-off-by: Thiago Macieira <thiago at macieira.org>
---
 qt-ui/divelistview.cpp | 2 +-
 qt-ui/mainwindow.cpp   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index c1dde08..b0816e7 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -567,5 +567,5 @@ void DiveListView::exportSelectedDivesAsUDDF()
 	filename = QFileDialog::getSaveFileName(this, tr("Save File as"), fi.absolutePath(),
 						tr("UDDF files (*.uddf *.UDDF)"));
 	if (!filename.isNull() && !filename.isEmpty())
-		export_dives_uddf((const char *)filename.toStdString().c_str(), true);
+		export_dives_uddf(filename.toUtf8(), true);
 }
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 3fe6d23..231a285 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -196,7 +196,7 @@ void MainWindow::on_actionExportUDDF_triggered()
 	filename = QFileDialog::getSaveFileName(this, tr("Save File as"), fi.absolutePath(),
 						tr("UDDF files (*.uddf *.UDDF)"));
 	if (!filename.isNull() && !filename.isEmpty())
-		export_dives_uddf((const char *)filename.toStdString().c_str(), false);
+		export_dives_uddf(filename.toUtf8(), false);
 }
 
 void MainWindow::on_actionPrint_triggered()
-- 
1.7.11.7



More information about the subsurface mailing list