From 92a91a38f64f37474a26ffefa1e611269030bcd0 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 24 Nov 2017 11:59:40 +0100 Subject: [PATCH 1/5] Bump version Change-Id: Ie823825b9dd4092f9997716790bfc3fbe138dd46 Reviewed-by: Eike Ziller --- qbs/modules/qtc/qtc.qbs | 10 +++++----- qtcreator.pri | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 18951cb2d39..d719e527e0a 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,16 +4,16 @@ import qbs.FileInfo import "qtc.js" as HelperFunctions Module { - property string qtcreator_display_version: '4.5.0-rc1' + property string qtcreator_display_version: '4.5.0' property string ide_version_major: '4' - property string ide_version_minor: '4' - property string ide_version_release: '83' + property string ide_version_minor: '5' + property string ide_version_release: '0' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release property string ide_compat_version_major: '4' - property string ide_compat_version_minor: '4' - property string ide_compat_version_release: '83' + property string ide_compat_version_minor: '5' + property string ide_compat_version_release: '0' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release diff --git a/qtcreator.pri b/qtcreator.pri index 03fd4bc16b9..afcf99ea333 100644 --- a/qtcreator.pri +++ b/qtcreator.pri @@ -1,10 +1,10 @@ !isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included") QTCREATOR_PRI_INCLUDED = 1 -QTCREATOR_VERSION = 4.4.83 -QTCREATOR_COMPAT_VERSION = 4.4.83 +QTCREATOR_VERSION = 4.5.0 +QTCREATOR_COMPAT_VERSION = 4.5.0 VERSION = $$QTCREATOR_VERSION -QTCREATOR_DISPLAY_VERSION = 4.5.0-rc1 +QTCREATOR_DISPLAY_VERSION = 4.5.0 QTCREATOR_COPYRIGHT_YEAR = 2017 BINARY_ARTIFACTS_BRANCH = master From dfcd5734278e9e9fc48f4784465cfa4b85dcef4b Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 24 Nov 2017 13:32:20 +0100 Subject: [PATCH 2/5] Qmake: Do not crash when closing a project while it is parsing * Fix crashes and resource leaks in qmake project. Task-number: QTCREATORBUG-19358 Change-Id: I3b383640cdf994b4014ccbfc4278be48f9e5fd3f Reviewed-by: Orgad Shaneh --- .../qmakeprojectmanager/qmakeparsernodes.cpp | 12 ++++++++--- .../qmakeprojectmanager/qmakeproject.cpp | 20 +++++++++++++------ .../qmakeprojectmanager/qmakeproject.h | 2 +- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp index 74faaf0cb06..8cda1a64233 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp @@ -1087,9 +1087,12 @@ QmakeProFile::QmakeProFile(QmakeProject *project, const FileName &filePath) : QmakeProFile::~QmakeProFile() { qDeleteAll(m_extraCompilers); + m_parseFutureWatcher.cancel(); m_parseFutureWatcher.waitForFinished(); if (m_readerExact) applyAsyncEvaluate(); + + cleanupProFileReaders(); } bool QmakeProFile::isParent(QmakeProFile *node) @@ -1489,7 +1492,8 @@ void QmakeProFile::asyncEvaluate(QFutureInterface &fi, QmakeE void QmakeProFile::applyAsyncEvaluate() { - applyEvaluate(m_parseFutureWatcher.result()); + if (m_parseFutureWatcher.isFinished()) + applyEvaluate(m_parseFutureWatcher.result()); m_project->decrementPendingEvaluateFutures(); } @@ -1625,8 +1629,10 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult) void QmakeProFile::cleanupProFileReaders() { - m_project->destroyProFileReader(m_readerExact); - m_project->destroyProFileReader(m_readerCumulative); + if (m_readerExact) + m_project->destroyProFileReader(m_readerExact); + if (m_readerCumulative) + m_project->destroyProFileReader(m_readerCumulative); m_readerExact = nullptr; m_readerCumulative = nullptr; diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index b8e9ffb77f9..8124b9d98cf 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -202,6 +202,12 @@ QmakeProject::~QmakeProject() m_cancelEvaluate = true; Q_ASSERT(m_qmakeGlobalsRefCnt == 0); delete m_qmakeVfs; + + if (m_asyncUpdateFutureInterface) { + m_asyncUpdateFutureInterface->reportCanceled(); + m_asyncUpdateFutureInterface->reportFinished(); + delete m_asyncUpdateFutureInterface; + } } QmakeProFile *QmakeProject::rootProFile() const @@ -508,6 +514,9 @@ void QmakeProject::decrementPendingEvaluateFutures() { --m_pendingEvaluateFuturesCount; + if (!rootProFile()) + return; // We are closing the project! + m_asyncUpdateFutureInterface->setProgressValue(m_asyncUpdateFutureInterface->progressValue() + 1); if (m_pendingEvaluateFuturesCount == 0) { // We are done! @@ -640,7 +649,7 @@ void QmakeProject::proFileParseError(const QString &errorMessage) QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFile *qmakeProFile) { if (!m_qmakeGlobals) { - m_qmakeGlobals = new QMakeGlobals; + m_qmakeGlobals = std::make_unique(); m_qmakeGlobalsRefCnt = 0; Kit *k = KitManager::defaultKit(); @@ -664,7 +673,7 @@ QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFile * if (qtVersion && qtVersion->isValid()) { m_qmakeGlobals->qmake_abslocation = QDir::cleanPath(qtVersion->qmakeCommand().toString()); - qtVersion->applyProperties(m_qmakeGlobals); + qtVersion->applyProperties(m_qmakeGlobals.get()); } m_qmakeGlobals->setDirectories(rootProFile()->sourceDir().toString(), rootProFile()->buildDir().toString()); @@ -693,7 +702,7 @@ QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFile * } ++m_qmakeGlobalsRefCnt; - auto reader = new QtSupport::ProFileReader(m_qmakeGlobals, m_qmakeVfs); + auto reader = new QtSupport::ProFileReader(m_qmakeGlobals.get(), m_qmakeVfs); reader->setOutputDir(qmakeProFile->buildDir().toString()); @@ -702,7 +711,7 @@ QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFile * QMakeGlobals *QmakeProject::qmakeGlobals() { - return m_qmakeGlobals; + return m_qmakeGlobals.get(); } QMakeVfs *QmakeProject::qmakeVfs() @@ -725,8 +734,7 @@ void QmakeProject::destroyProFileReader(QtSupport::ProFileReader *reader) QtSupport::ProFileCacheManager::instance()->discardFiles(dir); QtSupport::ProFileCacheManager::instance()->decRefCount(); - delete m_qmakeGlobals; - m_qmakeGlobals = nullptr; + m_qmakeGlobals.reset(); } } diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h index 717c11951bf..8ded09a1851 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.h +++ b/src/plugins/qmakeprojectmanager/qmakeproject.h @@ -184,7 +184,7 @@ private: QMakeVfs *m_qmakeVfs = nullptr; // cached data during project rescan - QMakeGlobals *m_qmakeGlobals = nullptr; + std::unique_ptr m_qmakeGlobals; int m_qmakeGlobalsRefCnt = 0; QString m_qmakeSysroot; From 23ccfc4b36a6a7c44cf1a4eb8973dfb7946df7f9 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 27 Nov 2017 09:12:14 +0100 Subject: [PATCH 3/5] Utils: Delay saving of treeview column sizes while resizing As discussed in the linked report, QSettings behavior was changed to aggressively attempt to sync on each ::setValue() call, therefore causing excessive disk thrashing when used regularly. This is arguably a regression on the QSettings side, specifically as the documentation suggests some kind of delay and therefore merging of quick sequences of setValue calls (as implemented previously), but since this opinion is not generally shared, Qt applications need to implement that behavior now by themselves. This patch here does that for the reported case in Creator (and uses the opportunity to delay to 2 secs, which should be sufficient for the case) Change-Id: I04af0cd1a042abcf7113b5dde5c36e0338f7acb3 Task-number: QTCREATORBUG-15594 Reviewed-by: Eike Ziller --- src/libs/utils/basetreeview.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/basetreeview.cpp b/src/libs/utils/basetreeview.cpp index 29c531e1cc5..98b997c5c84 100644 --- a/src/libs/utils/basetreeview.cpp +++ b/src/libs/utils/basetreeview.cpp @@ -51,7 +51,11 @@ class BaseTreeViewPrivate : public QObject public: explicit BaseTreeViewPrivate(BaseTreeView *parent) : q(parent), m_settings(0), m_expectUserChanges(false), m_progressIndicator(0) - {} + { + m_settingsTimer.setSingleShot(true); + connect(&m_settingsTimer, &QTimer::timeout, + this, &BaseTreeViewPrivate::doSaveState); + } bool eventFilter(QObject *, QEvent *event) { @@ -102,6 +106,12 @@ public: void saveState() { + m_settingsTimer.start(2000); // Once per 2 secs should be enough. + } + + void doSaveState() + { + m_settingsTimer.stop(); if (m_settings && !m_settingsKey.isEmpty()) { m_settings->beginGroup(m_settingsKey); QVariantList l; @@ -210,6 +220,7 @@ public: BaseTreeView *q; QMap m_userHandled; // column -> width, "not present" means "automatic" QSettings *m_settings; + QTimer m_settingsTimer; QString m_settingsKey; bool m_expectUserChanges; ProgressIndicator *m_progressIndicator; From 8bc3ac9177e6f8f05c2c64a400d244a5cc82aa0a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 24 Nov 2017 12:57:33 +0100 Subject: [PATCH 4/5] Update qbs submodule To HEAD of 1.10 branch. Change-Id: I4d73b84f845cccc0363673100681c74f51dd695a Reviewed-by: Jake Petroules --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index acf142851ae..08ce978733b 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit acf142851aeec850083811afb012a3fbcba793c6 +Subproject commit 08ce978733b33c1b1a64e5e1e62dea22cde6148c From 63861c44c1e4f9d4cf6a7a48fe9534b4f73d0ad7 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 26 Nov 2017 10:24:32 +0200 Subject: [PATCH 5/5] DiffEditor: Fix parsing of mode-only change in patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If one of the files has mode-only change, the entire patch fails as a git patch, and is parsed as a text patch. Because of that, the prefixes (a/, b/) are not stripped and jumping to a change by double-clicking does not work. Change-Id: Ib54ce4fa7aad02cb956af1f7de73d3c732ac5a89 Reviewed-by: André Hartmann Reviewed-by: Jarek Kobus --- src/plugins/diffeditor/diffeditorplugin.cpp | 34 +++++++++++++++------ src/plugins/diffeditor/diffutils.cpp | 18 ++++++----- src/plugins/diffeditor/diffutils.h | 1 + 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index f906fdb0277..6004f935156 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -1347,6 +1347,22 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data() QTest::newRow("Binary files") << patch << fileDataList8; + ////////////// + patch = _("diff --git a/script.sh b/script.sh\n" + "old mode 100644\n" + "new mode 100755\n" + ); + + fileData1 = FileData(); + fileData1.leftFileInfo = DiffFileInfo("script.sh"); + fileData1.rightFileInfo = DiffFileInfo("script.sh"); + fileData1.fileOperation = FileData::ChangeMode; + + QList fileDataList9; + fileDataList9 << fileData1; + + QTest::newRow("Mode change") << patch << fileDataList9; + ////////////// // Subversion New @@ -1362,10 +1378,10 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data() chunkData1.leftStartingLineNumber = -1; chunkData1.rightStartingLineNumber = 124; fileData1.chunks << chunkData1; - QList fileDataList9; - fileDataList9 << fileData1; + QList fileDataList21; + fileDataList21 << fileData1; QTest::newRow("Subversion New") << patch - << fileDataList9; + << fileDataList21; ////////////// @@ -1382,10 +1398,10 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data() chunkData1.leftStartingLineNumber = 0; chunkData1.rightStartingLineNumber = -1; fileData1.chunks << chunkData1; - QList fileDataList10; - fileDataList10 << fileData1; + QList fileDataList22; + fileDataList22 << fileData1; QTest::newRow("Subversion Deleted") << patch - << fileDataList10; + << fileDataList22; ////////////// @@ -1402,10 +1418,10 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data() chunkData1.leftStartingLineNumber = 119; chunkData1.rightStartingLineNumber = 119; fileData1.chunks << chunkData1; - QList fileDataList11; - fileDataList11 << fileData1; + QList fileDataList23; + fileDataList23 << fileData1; QTest::newRow("Subversion Normal") << patch - << fileDataList11; + << fileDataList23; } void DiffEditor::Internal::DiffEditorPlugin::testReadPatch() diff --git a/src/plugins/diffeditor/diffutils.cpp b/src/plugins/diffeditor/diffutils.cpp index a9d9b11ae24..69ddbb9ba96 100644 --- a/src/plugins/diffeditor/diffutils.cpp +++ b/src/plugins/diffeditor/diffutils.cpp @@ -1025,10 +1025,16 @@ static bool detectIndexAndBinary(QStringRef patch, bool hasNewLine; *remainingPatch = patch; - if (remainingPatch->isEmpty() && (fileData->fileOperation == FileData::CopyFile - || fileData->fileOperation == FileData::RenameFile)) { - // in case of 100% similarity we don't have more lines in the patch - return true; + if (remainingPatch->isEmpty()) { + switch (fileData->fileOperation) { + case FileData::CopyFile: + case FileData::RenameFile: + case FileData::ChangeMode: + // in case of 100% similarity we don't have more lines in the patch + return true; + default: + break; + } } QStringRef afterNextLine; @@ -1151,8 +1157,6 @@ static bool detectFileData(QStringRef patch, QStringRef afterSecondLine; const QStringRef secondLine = readLine(afterDiffGit, &afterSecondLine, &hasNewLine); - if (!hasNewLine) - return false; // we need to have at least one more line if (secondLine.startsWith(QStringLiteral("new file mode "))) { fileData->fileOperation = FileData::NewFile; @@ -1165,7 +1169,7 @@ static bool detectFileData(QStringRef patch, // new mode readLine(afterSecondLine, &afterThirdLine, &hasNewLine); if (!hasNewLine) - return false; // we need to have at least one more line + fileData->fileOperation = FileData::ChangeMode; // TODO: validate new mode line *remainingPatch = afterThirdLine; diff --git a/src/plugins/diffeditor/diffutils.h b/src/plugins/diffeditor/diffutils.h index 46a8bb40b0f..ed0130bfbdf 100644 --- a/src/plugins/diffeditor/diffutils.h +++ b/src/plugins/diffeditor/diffutils.h @@ -104,6 +104,7 @@ class DIFFEDITOR_EXPORT FileData { public: enum FileOperation { ChangeFile, + ChangeMode, NewFile, DeleteFile, CopyFile,