remove redundant error check

no point in checking for file's existence before opening it - the
errorString is verbose enough.
This commit is contained in:
Oswald Buddenhagen
2011-04-04 15:34:04 +02:00
parent 0ebc901c2b
commit fd97a4b8bc

View File

@@ -246,11 +246,7 @@ QSharedPointer<QFile> AbstractQt4MaemoTarget::openFile(const QString &filePath,
{ {
const QString nativePath = QDir::toNativeSeparators(filePath); const QString nativePath = QDir::toNativeSeparators(filePath);
QSharedPointer<QFile> file(new QFile(filePath)); QSharedPointer<QFile> file(new QFile(filePath));
if (mode == QIODevice::ReadOnly && !file->exists()) { if (!file->open(mode)) {
if (error)
*error = tr("File '%1' does not exist").arg(nativePath);
file.clear();
} else if (!file->open(mode)) {
if (error) { if (error) {
*error = tr("Cannot open file '%1': %2") *error = tr("Cannot open file '%1': %2")
.arg(nativePath, file->errorString()); .arg(nativePath, file->errorString());