mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-08 12:30:20 +08:00
DbViewer: can launch with a directory argument to set current workspace for convenience.
This commit is contained in:
@@ -689,6 +689,8 @@ bool DatabaseViewer::openDatabase(const QString & path)
|
|||||||
{
|
{
|
||||||
UDEBUG("Open database \"%s\"", path.toStdString().c_str());
|
UDEBUG("Open database \"%s\"", path.toStdString().c_str());
|
||||||
if(QFile::exists(path))
|
if(QFile::exists(path))
|
||||||
|
{
|
||||||
|
if(QFileInfo(path).isFile())
|
||||||
{
|
{
|
||||||
std::string driverType = "sqlite3";
|
std::string driverType = "sqlite3";
|
||||||
|
|
||||||
@@ -777,6 +779,16 @@ bool DatabaseViewer::openDatabase(const QString & path)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else // directory
|
||||||
|
{
|
||||||
|
pathDatabase_ = path;
|
||||||
|
if(pathDatabase_.isEmpty() || pathDatabase_.compare(".") == 0)
|
||||||
|
{
|
||||||
|
pathDatabase_ = QDir::currentPath();
|
||||||
|
}
|
||||||
|
ui_->graphViewer->setWorkingDirectory(pathDatabase_);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QMessageBox::warning(this, "Database error", tr("Database \"%1\" does not exist.").arg(path));
|
QMessageBox::warning(this, "Database error", tr("Database \"%1\" does not exist.").arg(path));
|
||||||
|
|||||||
Reference in New Issue
Block a user