From fd97a4b8bc4d06accf3dcb60f28ace1621f579d7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Date: Mon, 4 Apr 2011 15:34:04 +0200 Subject: [PATCH] remove redundant error check no point in checking for file's existence before opening it - the errorString is verbose enough. --- src/plugins/qt4projectmanager/qt-maemo/qt4maemotarget.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt-maemo/qt4maemotarget.cpp b/src/plugins/qt4projectmanager/qt-maemo/qt4maemotarget.cpp index 6f0c02d26de..55d000d127e 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/qt4maemotarget.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/qt4maemotarget.cpp @@ -246,11 +246,7 @@ QSharedPointer<QFile> AbstractQt4MaemoTarget::openFile(const QString &filePath, { const QString nativePath = QDir::toNativeSeparators(filePath); QSharedPointer<QFile> file(new QFile(filePath)); - if (mode == QIODevice::ReadOnly && !file->exists()) { - if (error) - *error = tr("File '%1' does not exist").arg(nativePath); - file.clear(); - } else if (!file->open(mode)) { + if (!file->open(mode)) { if (error) { *error = tr("Cannot open file '%1': %2") .arg(nativePath, file->errorString()); -- GitLab