From ea895eb4ecbc76e8bcb46dd8108200ccaf939b2b Mon Sep 17 00:00:00 2001 From: "Marcus D. Hanwell" Date: Tue, 21 Aug 2018 11:39:26 -0400 Subject: [PATCH] Fix a bug with file paths and movies The canonicalPath method returns an empty string if the file does not exist, causing a number of issues when used in the context of saving a movie. Switch to use absolutePath which does not care whether the file exists or not. Signed-off-by: Marcus D. Hanwell --- avogadro/qtplugins/playertool/playertool.cpp | 2 +- avogadro/qtplugins/surfaces/surfaces.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/avogadro/qtplugins/playertool/playertool.cpp b/avogadro/qtplugins/playertool/playertool.cpp index f0006a9b98..743e45e909 100644 --- a/avogadro/qtplugins/playertool/playertool.cpp +++ b/avogadro/qtplugins/playertool/playertool.cpp @@ -248,7 +248,7 @@ void PlayerTool::recordMovie() QFileInfo fileInfo(baseName); if (!fileInfo.suffix().isEmpty()) - baseName = fileInfo.canonicalPath() + "/" + fileInfo.baseName(); + baseName = fileInfo.absolutePath() + "/" + fileInfo.baseName(); bool bonding = m_dynamicBonding->isChecked(); int numberLength = static_cast( diff --git a/avogadro/qtplugins/surfaces/surfaces.cpp b/avogadro/qtplugins/surfaces/surfaces.cpp index 4a41173f81..8642aa20dd 100644 --- a/avogadro/qtplugins/surfaces/surfaces.cpp +++ b/avogadro/qtplugins/surfaces/surfaces.cpp @@ -392,7 +392,7 @@ void Surfaces::recordMovie() QFileInfo fileInfo(baseName); if (!fileInfo.suffix().isEmpty()) - baseName = fileInfo.canonicalPath() + "/" + fileInfo.baseName(); + baseName = fileInfo.absolutePath() + "/" + fileInfo.baseName(); m_baseFileName = baseName; m_numberLength = static_cast(