Retrieve canonical file path if possible.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-09-28 16:05:55 +03:00
parent b673ec0fc7
commit ffe4affcbf

View file

@ -4209,11 +4209,11 @@ bool MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
{
qCDebug(vMainWindow, "Loading new file %s.", qUtf8Printable(fileName));
{ // Convert to absolute path is need
{ // Convert to absolute path if need
QFileInfo info(fileName);
if (info.isRelative())
if (info.exists() && info.isRelative())
{
fileName = QDir::currentPath() + QLatin1Char('/') + fileName;
fileName = QFileInfo(QDir::currentPath() + QLatin1Char('/') + fileName).canonicalFilePath();
}
}