From ffe4affcbffc7a71f6979dacaaebf788b8b135f6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 28 Sep 2017 16:05:55 +0300 Subject: [PATCH] Retrieve canonical file path if possible. --HG-- branch : feature --- src/app/valentina/mainwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 960a1700b..797994915 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -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(); } }