From 850c277dac3d3bdc7510bbc7234b5d058faf0dcd Mon Sep 17 00:00:00 2001 From: matlabbe Date: Tue, 28 Oct 2014 04:25:15 +0000 Subject: [PATCH] updated default Source database directory to working directory when empty. git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1934 f169173b-cf89-36c8-b27e-44dbe73f0c83 --- guilib/src/PreferencesDialog.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guilib/src/PreferencesDialog.cpp b/guilib/src/PreferencesDialog.cpp index 7393547f..911115f8 100644 --- a/guilib/src/PreferencesDialog.cpp +++ b/guilib/src/PreferencesDialog.cpp @@ -1713,7 +1713,12 @@ void PreferencesDialog::selectSourceDatabase(bool user) { ULOGGER_DEBUG(""); - QString path = QFileDialog::getOpenFileName(this, tr("Select file"), _ui->source_database_lineEdit_path->text(), tr("RTAB-Map database files (*.db)")); + QString dir = _ui->source_database_lineEdit_path->text(); + if(dir.isEmpty()) + { + dir = getWorkingDirectory(); + } + QString path = QFileDialog::getOpenFileName(this, tr("Select file"), dir, tr("RTAB-Map database files (*.db)")); QFile file(path); if(!path.isEmpty() && file.exists()) {