+ fix flaws found with code analyzer tool

This commit is contained in:
wmayer
2014-05-07 13:09:44 +02:00
parent 86278597e8
commit 55984a200f
22 changed files with 111 additions and 119 deletions

View File

@@ -240,14 +240,12 @@ QPixmap BitmapFactoryInst::pixmap(const char* name) const
// try to find it in the given directories
if (icon.isNull()) {
bool found = false;
QList<QByteArray> formats = QImageReader::supportedImageFormats();
formats.prepend("SVG"); // check first for SVG to use special import mechanism
for (QStringList::ConstIterator pt = d->paths.begin(); pt != d->paths.end() && !found; ++pt) {
for (QStringList::ConstIterator pt = d->paths.begin(); pt != d->paths.end(); ++pt) {
QDir d(*pt);
QString fileName = d.filePath(fn);
if (loadPixmap(fileName, icon)) {
found = true;
break;
}
else {
@@ -256,7 +254,6 @@ QPixmap BitmapFactoryInst::pixmap(const char* name) const
QString path = QString::fromAscii("%1.%2").arg(fileName).
arg(QString::fromAscii((*fm).toLower().constData()));
if (loadPixmap(path, icon)) {
found = true;
break;
}
}