From 30fad998a6795752911e69906f414bd52c6aa2ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 3 Dec 2017 02:38:53 +0100 Subject: NOISSUE normalize instances path in FolderInstanceProvider This resolves some issues with the instance export dialog when the instances folder path contains '..' and '.', or involves symlinks. --- api/logic/FolderInstanceProvider.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'api/logic') diff --git a/api/logic/FolderInstanceProvider.cpp b/api/logic/FolderInstanceProvider.cpp index 53618439..296b366e 100644 --- a/api/logic/FolderInstanceProvider.cpp +++ b/api/logic/FolderInstanceProvider.cpp @@ -34,7 +34,8 @@ struct WatchLock FolderInstanceProvider::FolderInstanceProvider(SettingsObjectPtr settings, const QString& instDir) : BaseInstanceProvider(settings) { - m_instDir = instDir; + // Normalize path + m_instDir = QDir(instDir).canonicalPath(); if (!QDir::current().exists(m_instDir)) { QDir::current().mkpath(m_instDir); @@ -281,7 +282,7 @@ void FolderInstanceProvider::instanceDirContentsChanged(const QString& path) void FolderInstanceProvider::on_InstFolderChanged(const Setting &setting, QVariant value) { - QString newInstDir = value.toString(); + QString newInstDir = QDir(value.toString()).canonicalPath(); if(newInstDir != m_instDir) { if(m_groupsLoaded) -- cgit v1.2.3