Fix build for Qt 5

QAbstractFileEngine is in a private header in Qt 5

Change-Id: I2f3317e48274392cda853ebf69ed96a662763094
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Aurindam Jana
2012-11-28 17:32:47 +01:00
committed by hjk
parent 18e0363c71
commit 2b0c1fb376
2 changed files with 4 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ QT += network \
sql
greaterThan(QT_MAJOR_VERSION, 4) {
QT += help printsupport
QT += help printsupport core-private
} else {
CONFIG += help
}

View File

@@ -45,6 +45,8 @@
#if QT_VERSION < 0x050000
#include <QAbstractFileEngine>
#else
#include <private/qabstractfileengine_p.h>
#endif
#ifndef Q_OS_WIN
@@ -193,8 +195,7 @@ void FileUtils::removeFile(const QString &filePath, bool deleteFromFS)
static inline bool fileSystemRenameFile(const QString &orgFilePath,
const QString &newFilePath)
{
QFile f(orgFilePath); // Due to QTBUG-3570
QAbstractFileEngine *fileEngine = f.fileEngine();
QAbstractFileEngine *fileEngine = QAbstractFileEngine::create(orgFilePath); // Due to QTBUG-3570
if (!fileEngine->caseSensitive() && orgFilePath.compare(newFilePath, Qt::CaseInsensitive) == 0)
return fileEngine->rename(newFilePath);
return QFile::rename(orgFilePath, newFilePath);