forked from qt-creator/qt-creator
optimize GdbMacrosBuildStep: don't copy files which are already current
This commit is contained in:
@@ -37,6 +37,8 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
#include <QFileInfo>
|
||||||
|
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
|
|
||||||
@@ -72,10 +74,15 @@ void GdbMacrosBuildStep::run(QFutureInterface<bool> & fi)
|
|||||||
QDir dir;
|
QDir dir;
|
||||||
dir.mkpath(destDir);
|
dir.mkpath(destDir);
|
||||||
foreach (const QString &file, files) {
|
foreach (const QString &file, files) {
|
||||||
QFile destination(destDir + file);
|
QString source = dumperPath + file;
|
||||||
if (destination.exists())
|
QString dest = destDir + file;
|
||||||
destination.remove();
|
QFileInfo destInfo(dest);
|
||||||
QFile::copy(dumperPath + file, destDir + file);
|
if (destInfo.exists()) {
|
||||||
|
if (destInfo.lastModified() >= QFileInfo(source).lastModified())
|
||||||
|
continue;
|
||||||
|
QFile::remove(dest);
|
||||||
|
}
|
||||||
|
QFile::copy(source, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4Project *qt4Project = static_cast<Qt4Project *>(project());
|
Qt4Project *qt4Project = static_cast<Qt4Project *>(project());
|
||||||
|
Reference in New Issue
Block a user