- Status Closed
- Percent Complete
- Task Type Bug Report
- Category QCAD (main)
-
Assigned To
Andrew - Operating System All
- Severity Low
- Priority Very Low
- Reported Version 3.20.1
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
Attached to Project: QCAD Bugtracker
Opened by BlackFox - 26.04.2018
Last edited by Andrew - 26.04.2018
Opened by BlackFox - 26.04.2018
Last edited by Andrew - 26.04.2018
FS#1746 - File > Bitmap Export: File base name cut off in file save dialog
A file with name of 1234.56.78.0001.00 Something blah blah.dxf
will not export to bitmap correctly. The save dialog will suggest filename of 1234.56.78.0001.jpg
instead, truncating everything after last dot.
This bug existed in older versions too because of incorrect handling of file names. As a result, at some point File.getSaveFileName
incorrectly truncates the extension (which is empty at the time) and replaces it with jpg
. Appending a null extension fixes this, though obviously it’s not a correct fix.
Here is a temporary workaround in File.js
:
File.getInitialSaveAsPath = function(filePath, extension) { var ret = ""; var fi; if (isNull(filePath) || filePath.length === 0) { var mdiChild = EAction.getMdiChild(); var fn; if (!isNull(mdiChild)) { fn = stripDirtyFlag(EAction.getMdiChild().windowTitle) } else { fn = "File"; } fi = new QFileInfo(QDir.homePath()); ret = fi.absoluteFilePath() + QDir.separator + fn + "." + extension + ".nothing"; // Workaround here } else { fi = new QFileInfo(filePath); ret = fi.path() + QDir.separator + fi.completeBaseName() + "." + extension + ".nothing"; // Workaround here } return ret; };
Closed by Andrew
26.04.2018 09:00
Reason for closing: Fixed
Additional comments about closing:
26.04.2018 09:00
Reason for closing: Fixed
Additional comments about closing:
https://github.com/qcad/qcad/commit /e07bb8879395e359b72f07fe248e46726cfb440 2
Are you on the Linux OS?
I can reproduce on Linux / Qt 5.8 only.
No, I am on Windows (2012 R2), system dialogs off (if I'm not mistaken, not that it should matter?).
The exact order of actions that brings me to this issue is:
1) Open drawing.dxf (any drawing)
2) Press X, B for export bitmap
3) Press enter to accept whatever settings
4) Save dialog shows incorrect filename
Thanks. That seems to be the issue indeed. This looks like a bug in the Qt file dialog which is used when system dialogs are switched off (default under Linux).
Also affects File > Advanced SVG Export and other uses of File.getSaveFileName