From c3a148833bdfdca6e631e635a9a5415aa18a7cc4 Mon Sep 17 00:00:00 2001 From: Andreas Stallinger Date: Tue, 26 Apr 2016 08:51:46 +0200 Subject: [PATCH] src: string replace fix in filepath --- src/lib/utility/file/FilePath.cpp | 2 +- .../qt/window/project_wizzard/QtProjectWizzardContentData.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/utility/file/FilePath.cpp b/src/lib/utility/file/FilePath.cpp index 98044eb9..4f90f663 100644 --- a/src/lib/utility/file/FilePath.cpp +++ b/src/lib/utility/file/FilePath.cpp @@ -123,7 +123,7 @@ FilePath FilePath::expandEnvironmentVariables() const LOG_ERROR(match[1].str() + " is no a environment variable"); return FilePath(); } - text.replace( match[0].first, match[0].second, s); + text.replace( match.position(0), match.length(0), s); } return FilePath(text); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentData.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentData.cpp index cb85a850..bd6247a0 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentData.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentData.cpp @@ -159,7 +159,7 @@ bool QtProjectWizzardContentData::check() return false; } - if (!FilePath(m_projectFileLocation->getText().toStdString()).exists()) + if (!FilePath(m_projectFileLocation->getText().toStdString()).expandEnvironmentVariables().exists()) { QMessageBox msgBox; msgBox.setText("The specified location does not exist.");