Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do not attempt to open empty image path
  • Loading branch information
matthewvogt authored and rburchell committed Jul 23, 2013
1 parent d2f9a69 commit 1f6bcfe
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/meego/themedaemon/mlocalthemedaemonclient.cpp
Expand Up @@ -144,19 +144,23 @@ QPixmap MLocalThemeDaemonClient::requestPixmap(const QString &id, const QSize &r

QImage MLocalThemeDaemonClient::readImage(const QString &id) const
{
foreach (const ImageDirNode &imageDirNode, m_imageDirNodes) {
foreach (const QString &suffix, imageDirNode.suffixList) {

QString imageFilePathString = m_filenameHash.value(id + suffix);
if (!imageFilePathString.isNull()) {
imageFilePathString.append(QDir::separator() + id + suffix);
}

QImage image(imageFilePathString);
if (!image.isNull()) {
return image;
if (!id.isEmpty()) {
foreach (const ImageDirNode &imageDirNode, m_imageDirNodes) {
foreach (const QString &suffix, imageDirNode.suffixList) {

QString imageFilePathString = m_filenameHash.value(id + suffix);
if (!imageFilePathString.isNull()) {
imageFilePathString.append(QDir::separator() + id + suffix);

QImage image(imageFilePathString);
if (!image.isNull()) {
return image;
}
}
}
}

qDebug() << "Unknown theme image:" << id;
}

return QImage();
Expand Down

0 comments on commit 1f6bcfe

Please sign in to comment.