Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
5fca0962
Commit
5fca0962
authored
Sep 07, 2009
by
Max-Wilhelm Bruker
Browse files
check if directories exist
parent
d0c69290
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carddatabase.cpp
View file @
5fca0962
...
@@ -112,8 +112,11 @@ QPixmap *CardInfo::loadPixmap()
...
@@ -112,8 +112,11 @@ QPixmap *CardInfo::loadPixmap()
{
{
if
(
pixmap
)
if
(
pixmap
)
return
pixmap
;
return
pixmap
;
QString
picsPath
=
db
->
getPicsPath
();
pixmap
=
new
QPixmap
();
pixmap
=
new
QPixmap
();
QString
picsPath
=
db
->
getPicsPath
();
if
(
!
QDir
(
picsPath
).
exists
())
return
pixmap
;
if
(
getName
().
isEmpty
())
{
if
(
getName
().
isEmpty
())
{
pixmap
->
load
(
QString
(
"%1/back.jpg"
).
arg
(
picsPath
));
pixmap
->
load
(
QString
(
"%1/back.jpg"
).
arg
(
picsPath
));
return
pixmap
;
return
pixmap
;
...
@@ -395,6 +398,8 @@ int CardDatabase::loadFromFile(const QString &fileName)
...
@@ -395,6 +398,8 @@ int CardDatabase::loadFromFile(const QString &fileName)
{
{
QFile
file
(
fileName
);
QFile
file
(
fileName
);
file
.
open
(
QIODevice
::
ReadOnly
);
file
.
open
(
QIODevice
::
ReadOnly
);
if
(
!
file
.
isOpen
())
return
-
1
;
QXmlStreamReader
xml
(
&
file
);
QXmlStreamReader
xml
(
&
file
);
clear
();
clear
();
while
(
!
xml
.
atEnd
())
{
while
(
!
xml
.
atEnd
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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