check if directories exist
This commit is contained in:
parent
d0c692902a
commit
5fca096252
1 changed files with 6 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue