When exporting poses, set txt extension by default if not set

This commit is contained in:
matlabbe
2018-03-12 20:26:34 -04:00
parent dc289ba635
commit ffe50dad22
2 changed files with 32 additions and 0 deletions

View File

@@ -2238,6 +2238,22 @@ void DatabaseViewer::exportPoses(int format)
if(!path.isEmpty())
{
if(QFileInfo(path).suffix() == "")
{
if(format == 3)
{
path += ".graph";
}
else if(format==4)
{
path += ".g2o";
}
else
{
path += ".txt";
}
}
bool saved = graph::exportPoses(path.toStdString(), format, poses, links, stamps);
if(saved)

View File

@@ -5217,6 +5217,22 @@ void MainWindow::exportPoses(int format)
if(!path.isEmpty())
{
if(QFileInfo(path).suffix() == "")
{
if(format == 3)
{
path += ".graph";
}
else if(format==4)
{
path += ".g2o";
}
else
{
path += ".txt";
}
}
_exportPosesFileName[format] = path;
bool saved = graph::exportPoses(path.toStdString(), format, poses, links, stamps);