Skip to content
Snippets Groups Projects
Commit e4c1cbaf authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[DE] Use unique_ptr's for boreholes in loadFiles.

parent 206cbf91
No related branches found
No related tags found
No related merge requests found
...@@ -545,11 +545,14 @@ void MainWindow::loadFile(ImportFileType::type t, const QString &fileName) ...@@ -545,11 +545,14 @@ void MainWindow::loadFile(ImportFileType::type t, const QString &fileName)
{ {
if (fi.suffix().toLower() == "txt") // GMS borehole files if (fi.suffix().toLower() == "txt") // GMS borehole files
{ {
std::vector<GeoLib::Point*>* boreholes = new std::vector<GeoLib::Point*>(); auto boreholes = std::unique_ptr<std::vector<GeoLib::Point*>>(
new std::vector<GeoLib::Point*>());
std::string name = fi.baseName().toStdString(); std::string name = fi.baseName().toStdString();
if (GMSInterface::readBoreholesFromGMS(boreholes, fileName.toStdString())) if (GMSInterface::readBoreholesFromGMS(boreholes.get(),
_project.getGEOObjects()->addStationVec(boreholes, name); fileName.toStdString()))
_project.getGEOObjects()->addStationVec(std::move(boreholes),
name);
else else
OGSError::box("Error reading GMS file."); OGSError::box("Error reading GMS file.");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment