Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
56607655
Commit
56607655
authored
Nov 04, 2021
by
Volker Krause
Browse files
Fix reading SVG aspect ratios from qrc: URLs
parent
ec141c75
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/app/util.cpp
View file @
56607655
...
...
@@ -15,6 +15,7 @@
#include
<QDateTime>
#include
<QFile>
#include
<QTimeZone>
#include
<QUrl>
#include
<QXmlStreamReader>
#include
<cmath>
...
...
@@ -85,9 +86,13 @@ float Util::svgAspectRatio(const QString &svgFilePath) const
return
1.0
f
;
}
QFile
file
(
svgFilePath
);
QString
localFilePath
(
svgFilePath
);
if
(
svgFilePath
.
startsWith
(
QLatin1String
(
"qrc:"
)))
{
localFilePath
=
QLatin1Char
(
':'
)
+
QUrl
(
svgFilePath
).
path
();
}
QFile
file
(
localFilePath
);
if
(
!
file
.
open
(
QFile
::
ReadOnly
))
{
qCWarning
(
Log
)
<<
file
.
errorString
()
<<
svg
FilePath
;
qCWarning
(
Log
)
<<
file
.
errorString
()
<<
local
FilePath
;
return
1.0
f
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment