Skip to content

Commit

Permalink
Fix a bug with file paths and movies
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cryos committed Aug 21, 2018
1 parent 06aa7d7 commit ea895eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion avogadro/qtplugins/playertool/playertool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(
Expand Down
2 changes: 1 addition & 1 deletion avogadro/qtplugins/surfaces/surfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(
Expand Down

0 comments on commit ea895eb

Please sign in to comment.