mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-03 08:37:44 -08:00
check if directories exist
This commit is contained in:
@@ -112,8 +112,11 @@ QPixmap *CardInfo::loadPixmap()
|
||||
{
|
||||
if (pixmap)
|
||||
return pixmap;
|
||||
QString picsPath = db->getPicsPath();
|
||||
pixmap = new QPixmap();
|
||||
QString picsPath = db->getPicsPath();
|
||||
if (!QDir(picsPath).exists())
|
||||
return pixmap;
|
||||
|
||||
if (getName().isEmpty()) {
|
||||
pixmap->load(QString("%1/back.jpg").arg(picsPath));
|
||||
return pixmap;
|
||||
@@ -395,6 +398,8 @@ int CardDatabase::loadFromFile(const QString &fileName)
|
||||
{
|
||||
QFile file(fileName);
|
||||
file.open(QIODevice::ReadOnly);
|
||||
if (!file.isOpen())
|
||||
return -1;
|
||||
QXmlStreamReader xml(&file);
|
||||
clear();
|
||||
while (!xml.atEnd()) {
|
||||
|
||||
Reference in New Issue
Block a user