diff --git a/doc/images/qtcreator-filesystem-view.png b/doc/images/qtcreator-filesystem-view.png index cd730fc925b..407f39a2b24 100644 Binary files a/doc/images/qtcreator-filesystem-view.png and b/doc/images/qtcreator-filesystem-view.png differ diff --git a/doc/src/analyze/cpu-usage-analyzer.qdoc b/doc/src/analyze/cpu-usage-analyzer.qdoc index a43d8ac1dc5..3a6019295dd 100644 --- a/doc/src/analyze/cpu-usage-analyzer.qdoc +++ b/doc/src/analyze/cpu-usage-analyzer.qdoc @@ -405,6 +405,13 @@ The CPU Usage Analyzer might fail to record data for the following reasons: \list 1 + \li Perf events may be globally disabled on your system. The + preconfigured Boot to Qt images come with perf events enabled. For + a custom configuration you need to make sure that the file + \c {/proc/sys/kernel/perf_event_paranoid} contains a value smaller + than \c {2}. For maximum flexibility in recording traces you can + set the value to \c {-1}. This allows any user to record any kind + of trace, even using raw kernel trace points. \li The connection between the target device and the host may not be fast enough to transfer the data produced by Perf. Try modifying the values of the \uicontrol {Stack snapshot size} or diff --git a/doc/src/howto/creator-ui.qdoc b/doc/src/howto/creator-ui.qdoc index f436ae54eb7..268a5d75a6b 100644 --- a/doc/src/howto/creator-ui.qdoc +++ b/doc/src/howto/creator-ui.qdoc @@ -219,7 +219,11 @@ \li To stop synchronizing the position in the project tree with the file currently opened in the editor, deselect \inlineimage linkicon.png - (\uicontrol {Synchronize with Editor}). + (\uicontrol {Synchronize with Editor}). You can specify a keyboard + shortcut to use when synchronization is needed. Select + \uicontrol Tools > \uicontrol Options > \uicontrol Environment > + \uicontrol Keyboard, and then search for + \uicontrol {Show in Explorer}. \li To see the absolute path of a file, move the mouse pointer over the file name. @@ -263,7 +267,10 @@ \image qtcreator-filesystem-view.png By default, the contents of the directory that contains the file currently - active in the editor are displayed. The path to the active file is displayed + active in the editor are displayed. To stop the synchronization, delesect + the \uicontrol {Synchronize Root Directory with Editor} button. + + The path to the active file is displayed as bread crumbs. You can move to any directory along the path by clicking it. To hide the bread crumbs, select \inlineimage filtericon.png (\uicontrol Options) and then deselect the \uicontrol {Show Bread Crumbs} diff --git a/src/libs/3rdparty/botan/botan.cpp b/src/libs/3rdparty/botan/botan.cpp index 87736d5fe3b..0d912062b32 100644 --- a/src/libs/3rdparty/botan/botan.cpp +++ b/src/libs/3rdparty/botan/botan.cpp @@ -465,7 +465,7 @@ inline V search_map(const std::map& mapping, * Function adaptor for delete operation */ template -class del_fun : public std::unary_function +class del_fun { public: void operator()(T* ptr) { delete ptr; } diff --git a/src/libs/3rdparty/cplusplus/Name.h b/src/libs/3rdparty/cplusplus/Name.h index 200ccac75d4..460f0bca11b 100644 --- a/src/libs/3rdparty/cplusplus/Name.h +++ b/src/libs/3rdparty/cplusplus/Name.h @@ -59,7 +59,7 @@ public: bool match(const Name *other, Matcher *matcher = 0) const; public: - struct Compare: std::binary_function { + struct Compare { bool operator()(const Name *name, const Name *other) const; }; diff --git a/src/libs/3rdparty/cplusplus/Names.h b/src/libs/3rdparty/cplusplus/Names.h index 41f3e761b41..b8d090da2fe 100644 --- a/src/libs/3rdparty/cplusplus/Names.h +++ b/src/libs/3rdparty/cplusplus/Names.h @@ -101,7 +101,7 @@ public: bool isSpecialization() const { return _isSpecialization; } // Comparator needed to distinguish between two different TemplateNameId(e.g.:used in std::map) - struct Compare: std::binary_function { + struct Compare { bool operator()(const TemplateNameId *name, const TemplateNameId *other) const; }; diff --git a/src/libs/clangsupport/clangcodemodelconnectionclient.cpp b/src/libs/clangsupport/clangcodemodelconnectionclient.cpp index 1938d063537..56186e24dc6 100644 --- a/src/libs/clangsupport/clangcodemodelconnectionclient.cpp +++ b/src/libs/clangsupport/clangcodemodelconnectionclient.cpp @@ -25,6 +25,7 @@ #include "clangcodemodelconnectionclient.h" +#include #include #include @@ -50,6 +51,11 @@ ClangCodeModelConnectionClient::ClangCodeModelConnectionClient( m_processCreator.setTemporaryDirectoryPattern("clangbackend-XXXXXX"); m_processCreator.setArguments({connectionName()}); + Utils::Environment environment; + environment.set(QStringLiteral("LIBCLANG_NOTHREADS"), QString()); + environment.set(QStringLiteral("LIBCLANG_DISABLE_CRASH_RECOVERY"), QString()); + m_processCreator.setEnvironment(environment); + stdErrPrefixer().setPrefix("clangbackend.stderr: "); stdOutPrefixer().setPrefix("clangbackend.stdout: "); } diff --git a/src/libs/clangsupport/processcreator.cpp b/src/libs/clangsupport/processcreator.cpp index dfc7f56d9fd..22b52793e30 100644 --- a/src/libs/clangsupport/processcreator.cpp +++ b/src/libs/clangsupport/processcreator.cpp @@ -56,6 +56,11 @@ void ProcessCreator::setArguments(const QStringList &arguments) m_arguments = arguments; } +void ProcessCreator::setEnvironment(const Utils::Environment &environment) +{ + m_environment = environment; +} + std::future ProcessCreator::createProcess() const { return std::async(std::launch::async, [&] { @@ -167,6 +172,10 @@ QProcessEnvironment ProcessCreator::processEnvironment() const processEnvironment.insert("TEMP", temporaryDirectoryPath); } + const Utils::Environment &env = m_environment; + for (auto it = env.constBegin(); it != env.constEnd(); ++it) + processEnvironment.insert(it.key(), it.value()); + return processEnvironment; } diff --git a/src/libs/clangsupport/processcreator.h b/src/libs/clangsupport/processcreator.h index 97429921751..928857319b7 100644 --- a/src/libs/clangsupport/processcreator.h +++ b/src/libs/clangsupport/processcreator.h @@ -29,6 +29,7 @@ #include "processhandle.h" +#include #include #include @@ -51,6 +52,7 @@ public: void setTemporaryDirectoryPattern(const QString &temporaryDirectoryPattern); void setProcessPath(const QString &m_processPath); void setArguments(const QStringList &m_arguments); + void setEnvironment(const Utils::Environment &environment); void setObserver(QObject *m_observer); std::future createProcess() const; @@ -72,6 +74,7 @@ private: QString m_processPath; QString m_temporaryDirectoryPattern; QStringList m_arguments; + Utils::Environment m_environment; QObject *m_observer = nullptr; }; diff --git a/src/libs/glsl/glslengine.h b/src/libs/glsl/glslengine.h index 6b126111f66..7cf6e2d1644 100644 --- a/src/libs/glsl/glslengine.h +++ b/src/libs/glsl/glslengine.h @@ -71,7 +71,7 @@ template class TypeTable { public: - struct Compare: std::binary_function { + struct Compare { bool operator()(const Type &value, const Type &other) const { return value.isLessThan(&other); } diff --git a/src/libs/qtcreatorcdbext/containers.cpp b/src/libs/qtcreatorcdbext/containers.cpp index 1248fca175c..128f450cafa 100644 --- a/src/libs/qtcreatorcdbext/containers.cpp +++ b/src/libs/qtcreatorcdbext/containers.cpp @@ -245,7 +245,7 @@ AbstractSymbolGroupNodePtrVector linkedListChildList(SymbolGroupValue headNode, } // Helper function for linkedListChildList that returns a member by name -class MemberByName : public std::unary_function +class MemberByName { public: explicit MemberByName(const char *name) : m_name(name) {} diff --git a/src/libs/qtcreatorcdbext/stringutils.h b/src/libs/qtcreatorcdbext/stringutils.h index 89316d7e9ad..e8297d44a44 100644 --- a/src/libs/qtcreatorcdbext/stringutils.h +++ b/src/libs/qtcreatorcdbext/stringutils.h @@ -52,7 +52,7 @@ void split(const std::string &s, char sep, Iterator it) // A boolean predicate that can be used for grepping sequences // of strings for a 'needle' substring. -class SubStringPredicate : public std::unary_function +class SubStringPredicate { public: explicit SubStringPredicate(const char *needle) : m_needle(needle) {} diff --git a/src/libs/qtcreatorcdbext/symbolgroup.cpp b/src/libs/qtcreatorcdbext/symbolgroup.cpp index 5ea3e8930e1..8404f0d77c0 100644 --- a/src/libs/qtcreatorcdbext/symbolgroup.cpp +++ b/src/libs/qtcreatorcdbext/symbolgroup.cpp @@ -251,7 +251,7 @@ std::string SymbolGroup::debug(const std::string &iname, typedef std::pair InamePathEntry; -struct InamePathEntryLessThan : public std::binary_function { +struct InamePathEntryLessThan { bool operator()(const InamePathEntry &i1, const InamePathEntry& i2) const { if (i1.first < i2.first) diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index 776d7aa66fd..001dd70a05d 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -801,7 +801,7 @@ QTextStream &operator<<(QTextStream &s, const FileName &fn) #ifdef Q_OS_WIN template <> -void withNTFSPermissions(const std::function &task) +void withNtfsPermissions(const std::function &task) { qt_ntfs_permission_lookup++; task(); diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h index b0068f43418..011069e1180 100644 --- a/src/libs/utils/fileutils.h +++ b/src/libs/utils/fileutils.h @@ -51,7 +51,7 @@ class QWidget; QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug dbg, const Utils::FileName &c); -// for withNTFSPermissions +// for withNtfsPermissions #ifdef Q_OS_WIN extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; #endif @@ -135,7 +135,7 @@ public: #ifdef Q_OS_WIN template -T withNTFSPermissions(const std::function &task) +T withNtfsPermissions(const std::function &task) { qt_ntfs_permission_lookup++; T result = task(); @@ -144,12 +144,12 @@ T withNTFSPermissions(const std::function &task) } template <> -QTCREATOR_UTILS_EXPORT void withNTFSPermissions(const std::function &task); +QTCREATOR_UTILS_EXPORT void withNtfsPermissions(const std::function &task); #else // Q_OS_WIN template -T withNTFSPermissions(const std::function &task) +T withNtfsPermissions(const std::function &task) { return task(); } diff --git a/src/libs/utils/smallstringview.h b/src/libs/utils/smallstringview.h index 0d8600e5dee..7881500ce68 100644 --- a/src/libs/utils/smallstringview.h +++ b/src/libs/utils/smallstringview.h @@ -39,9 +39,7 @@ using enable_if_has_char_data_pointer = typename std::enable_if_t< std::is_same< std::remove_const_t< std::remove_pointer_t< - std::result_of_t< - decltype(&String::data)(String) - > + decltype(std::declval().data()) > >, char>::value , int>; diff --git a/src/plugins/clangtools/clangtidyclazyruncontrol.cpp b/src/plugins/clangtools/clangtidyclazyruncontrol.cpp index 12f158ae68c..42a0af5cdf5 100644 --- a/src/plugins/clangtools/clangtidyclazyruncontrol.cpp +++ b/src/plugins/clangtools/clangtidyclazyruncontrol.cpp @@ -48,11 +48,10 @@ ClangTidyClazyRunControl::ClangTidyClazyRunControl( ClangToolRunner *ClangTidyClazyRunControl::createRunner() { QTC_ASSERT(!m_clangExecutable.isEmpty(), return 0); - QTC_ASSERT(!m_clangLogFileDir.isEmpty(), return 0); auto runner = new ClangTidyClazyRunner(m_diagnosticConfig, m_clangExecutable, - m_clangLogFileDir, + m_temporaryDir.path(), m_environment, this); connect(runner, &ClangTidyClazyRunner::finishedWithSuccess, diff --git a/src/plugins/clangtools/clangtoolruncontrol.cpp b/src/plugins/clangtools/clangtoolruncontrol.cpp index 7e53fe3818a..707ccccfa3e 100644 --- a/src/plugins/clangtools/clangtoolruncontrol.cpp +++ b/src/plugins/clangtools/clangtoolruncontrol.cpp @@ -60,7 +60,6 @@ #include #include #include -#include #include #include @@ -232,6 +231,7 @@ ClangToolRunControl::ClangToolRunControl(RunControl *runControl, : RunWorker(runControl) , m_projectBuilder(new ProjectBuilder(runControl, target->project(), this)) , m_clangExecutable(CppTools::clangExecutable(CLANG_BINDIR)) + , m_temporaryDir("clangtools-XXXXXX") , m_target(target) , m_fileInfos(fileInfos) { @@ -299,9 +299,7 @@ void ClangToolRunControl::start() Utils::NormalMessageFormat); // Create log dir - Utils::TemporaryDirectory temporaryDir("qtc-clangtools-XXXXXX"); - temporaryDir.setAutoRemove(false); - if (!temporaryDir.isValid()) { + if (!m_temporaryDir.isValid()) { const QString errorMessage = toolName + tr(": Failed to create temporary dir, stop."); appendMessage(errorMessage, Utils::ErrorMessageFormat); @@ -310,7 +308,6 @@ void ClangToolRunControl::start() reportFailure(errorMessage); return; } - m_clangLogFileDir = temporaryDir.path(); // Collect files const AnalyzeUnits unitsToProcess = unitsToAnalyze(CLANG_VERSION); @@ -388,13 +385,15 @@ void ClangToolRunControl::analyzeNextFile() Utils::StdOutFormat); } -void ClangToolRunControl::onRunnerFinishedWithSuccess(const QString &filePath, - const QString &logFilePath) +void ClangToolRunControl::onRunnerFinishedWithSuccess(const QString &filePath) { + const QString logFilePath = qobject_cast(sender())->logFilePath(); qCDebug(LOG) << "onRunnerFinishedWithSuccess:" << logFilePath; QString errorMessage; const QList diagnostics = tool()->read(filePath, logFilePath, &errorMessage); + QFile::remove(logFilePath); // Clean-up. + if (!errorMessage.isEmpty()) { qCDebug(LOG) << "onRunnerFinishedWithSuccess: Error reading log file:" << errorMessage; const QString filePath = qobject_cast(sender())->filePath(); @@ -415,6 +414,9 @@ void ClangToolRunControl::onRunnerFinishedWithFailure(const QString &errorMessag qCDebug(LOG).noquote() << "onRunnerFinishedWithFailure:" << errorMessage << '\n' << errorDetails; + // Even in the error case the log file was created, so clean it up here, too. + QFile::remove(qobject_cast(sender())->logFilePath()); + ++m_filesNotAnalyzed; m_success = false; const QString filePath = qobject_cast(sender())->filePath(); diff --git a/src/plugins/clangtools/clangtoolruncontrol.h b/src/plugins/clangtools/clangtoolruncontrol.h index dae3521bc1a..65f4bf35d0d 100644 --- a/src/plugins/clangtools/clangtoolruncontrol.h +++ b/src/plugins/clangtools/clangtoolruncontrol.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -69,7 +70,7 @@ protected: virtual ClangToolRunner *createRunner() = 0; - void onRunnerFinishedWithSuccess(const QString &filePath, const QString &logFilePath); + void onRunnerFinishedWithSuccess(const QString &filePath); void onRunnerFinishedWithFailure(const QString &errorMessage, const QString &errorDetails); private: @@ -90,7 +91,7 @@ protected: ProjectBuilder *m_projectBuilder; Utils::Environment m_environment; QString m_clangExecutable; - QString m_clangLogFileDir; + Utils::TemporaryDirectory m_temporaryDir; private: QPointer m_target; diff --git a/src/plugins/clangtools/clangtoolrunner.cpp b/src/plugins/clangtools/clangtoolrunner.cpp index 79b027a9303..f7b48a1d6a5 100644 --- a/src/plugins/clangtools/clangtoolrunner.cpp +++ b/src/plugins/clangtools/clangtoolrunner.cpp @@ -105,11 +105,6 @@ bool ClangToolRunner::run(const QString &filePath, const QStringList &compilerOp return true; } -QString ClangToolRunner::filePath() const -{ - return m_filePath; -} - void ClangToolRunner::onProcessStarted() { emit started(); @@ -121,10 +116,11 @@ void ClangToolRunner::onProcessFinished(int exitCode, QProcess::ExitStatus exitS if (exitCode == 0) { qCDebug(LOG).noquote() << "Output:\n" << Utils::SynchronousProcess::normalizeNewlines( QString::fromLocal8Bit(m_processOutput)); - emit finishedWithSuccess(m_filePath, actualLogFile()); + emit finishedWithSuccess(m_filePath); + } else { + emit finishedWithFailure(finishedWithBadExitCode(m_name, exitCode), + processCommandlineAndOutput()); } - else - emit finishedWithFailure(finishedWithBadExitCode(m_name, exitCode), processCommandlineAndOutput()); } else { // == QProcess::CrashExit emit finishedWithFailure(finishedDueToCrash(m_name), processCommandlineAndOutput()); } @@ -147,7 +143,7 @@ QString ClangToolRunner::createLogFile(const QString &filePath) const { const QString fileName = QFileInfo(filePath).fileName(); const QString fileTemplate = m_clangLogFileDir - + QLatin1String("/report-") + fileName + QLatin1String("-XXXXXX.plist"); + + QLatin1String("/report-") + fileName + QLatin1String("-XXXXXX"); Utils::TemporaryFile temporaryFile("clangtools"); temporaryFile.setAutoRemove(false); @@ -170,15 +166,5 @@ QString ClangToolRunner::processCommandlineAndOutput() const QString::fromLocal8Bit(m_processOutput))); } -QString ClangToolRunner::actualLogFile() const -{ - if (QFileInfo(m_logFile).size() == 0) { - // Current clang-cl ignores -o, always putting the log file into the working directory. - return m_clangLogFileDir + QLatin1Char('/') + QFileInfo(m_filePath).completeBaseName() - + QLatin1String(".plist"); - } - return m_logFile; -} - } // namespace Internal } // namespace ClangTools diff --git a/src/plugins/clangtools/clangtoolrunner.h b/src/plugins/clangtools/clangtoolrunner.h index 5473890dd8c..01585a8ca77 100644 --- a/src/plugins/clangtools/clangtoolrunner.h +++ b/src/plugins/clangtools/clangtoolrunner.h @@ -52,11 +52,12 @@ public: // (2) -o output-file bool run(const QString &filePath, const QStringList &compilerOptions = QStringList()); - QString filePath() const; + QString filePath() const { return m_filePath; } + QString logFilePath() const { return m_logFile; } signals: void started(); - void finishedWithSuccess(const QString &filePath, const QString &logFilePath); + void finishedWithSuccess(const QString &filePath); void finishedWithFailure(const QString &errorMessage, const QString &errorDetails); protected: @@ -71,7 +72,6 @@ private: QString createLogFile(const QString &filePath) const; QString processCommandlineAndOutput() const; - QString actualLogFile() const; protected: QString m_logFile; diff --git a/src/plugins/clangtools/clangtoolslogfilereader.cpp b/src/plugins/clangtools/clangtoolslogfilereader.cpp index f0885c22fc1..ecf4b8fbec1 100644 --- a/src/plugins/clangtools/clangtoolslogfilereader.cpp +++ b/src/plugins/clangtools/clangtoolslogfilereader.cpp @@ -67,7 +67,7 @@ static bool checkFilePath(const QString &filePath, QString *errorMessage) QList LogFileReader::readSerialized(const QString &filePath, const QString &logFilePath, QString *errorMessage) { - if (!checkFilePath(filePath, errorMessage)) + if (!checkFilePath(logFilePath, errorMessage)) return QList(); ClangSerializedDiagnosticsReader reader; diff --git a/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp b/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp index 45dd3eea407..e2fc4f1c6a5 100644 --- a/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp +++ b/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp @@ -63,7 +63,7 @@ FilePropertiesDialog::~FilePropertiesDialog() void FilePropertiesDialog::refresh() { - Utils::withNTFSPermissions([this] { + Utils::withNtfsPermissions([this] { const QFileInfo fileInfo(m_fileName); QLocale locale; @@ -94,7 +94,7 @@ void FilePropertiesDialog::refresh() void FilePropertiesDialog::setPermission(QFile::Permissions newPermissions, bool set) { - Utils::withNTFSPermissions([this, newPermissions, set] { + Utils::withNtfsPermissions([this, newPermissions, set] { QFile::Permissions permissions = QFile::permissions(m_fileName); if (set) permissions |= newPermissions; diff --git a/src/plugins/coreplugin/variablechooser.cpp b/src/plugins/coreplugin/variablechooser.cpp index 5f675de7a37..186a74d6a38 100644 --- a/src/plugins/coreplugin/variablechooser.cpp +++ b/src/plugins/coreplugin/variablechooser.cpp @@ -203,9 +203,7 @@ public: if (role == Qt::ToolTipRole) { QString description = m_expander->variableDescription(m_variable); - QString value; - if (!m_expander->isPrefixVariable(m_variable)) - value = m_expander->value(m_variable).toHtmlEscaped(); + const QString value = m_expander->value(m_variable).toHtmlEscaped(); if (!value.isEmpty()) description += QLatin1String("

") + VariableChooser::tr("Current Value: %1").arg(value); return description; diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index d2ae4e9f43b..b017cb7e8fc 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -168,7 +168,7 @@ static QList fullIdForSymbol(CPlusPlus::Symbol *symbol) namespace { -class ProcessFile: public std::unary_function > +class ProcessFile { const WorkingCopy workingCopy; const CPlusPlus::Snapshot snapshot; @@ -177,6 +177,10 @@ class ProcessFile: public std::unary_function > QFutureInterface *future; public: + // needed by QtConcurrent + using argument_type = const Utils::FileName &; + using result_type = QList; + ProcessFile(const WorkingCopy &workingCopy, const CPlusPlus::Snapshot snapshot, CPlusPlus::Document::Ptr symbolDocument, @@ -230,7 +234,7 @@ public: } }; -class UpdateUI: public std::binary_function &, QList, void> +class UpdateUI { QFutureInterface *future; @@ -596,7 +600,7 @@ static void searchFinished(SearchResult *search, QFutureWatcher > +class FindMacroUsesInFile { const WorkingCopy workingCopy; const CPlusPlus::Snapshot snapshot; @@ -604,6 +608,10 @@ class FindMacroUsesInFile: public std::unary_function *future; public: + // needed by QtConcurrent + using argument_type = const Utils::FileName &; + using result_type = QList; + FindMacroUsesInFile(const WorkingCopy &workingCopy, const CPlusPlus::Snapshot snapshot, const CPlusPlus::Macro ¯o, diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index a6c773f18b6..6e919e523e9 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4034,7 +4034,7 @@ void GdbEngine::handleDebugInfoLocation(const DebuggerResponse &response) { if (response.resultClass == ResultDone) { const QString debugInfoLocation = runParameters().debugInfoLocation; - if (QFile::exists(debugInfoLocation)) { + if (!debugInfoLocation.isEmpty() && QFile::exists(debugInfoLocation)) { const QString curDebugInfoLocations = response.consoleStreamOutput.split('"').value(1); QString cmd = "set debug-file-directory " + debugInfoLocation; if (!curDebugInfoLocations.isEmpty()) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index 6ac07433a4b..16c2e5f1b28 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -508,7 +508,8 @@ QString PropertyEditorQmlBackend::fileFromUrl(const QUrl &url) bool PropertyEditorQmlBackend::checkIfUrlExists(const QUrl &url) { - return QFileInfo::exists(fileFromUrl(url)); + const QString &file = fileFromUrl(url); + return !file.isEmpty() && QFileInfo::exists(file); } void PropertyEditorQmlBackend::emitSelectionToBeChanged() diff --git a/src/plugins/qmljseditor/qmljsfindreferences.cpp b/src/plugins/qmljseditor/qmljsfindreferences.cpp index 7806d9c385e..af2750de0ce 100644 --- a/src/plugins/qmljseditor/qmljsfindreferences.cpp +++ b/src/plugins/qmljseditor/qmljsfindreferences.cpp @@ -683,7 +683,7 @@ static QString matchingLine(unsigned position, const QString &source) return source.mid(start, end - start); } -class ProcessFile: public std::unary_function > +class ProcessFile { ContextPtr context; typedef FindReferences::Usage Usage; @@ -692,6 +692,10 @@ class ProcessFile: public std::unary_function *future; public: + // needed by QtConcurrent + using argument_type = const QString &; + using result_type = QList; + ProcessFile(const ContextPtr &context, QString name, const ObjectValue *scope, @@ -721,7 +725,7 @@ public: } }; -class SearchFileForType: public std::unary_function > +class SearchFileForType { ContextPtr context; typedef FindReferences::Usage Usage; @@ -730,6 +734,10 @@ class SearchFileForType: public std::unary_function *future; public: + // needed by QtConcurrent + using argument_type = const QString &; + using result_type = QList; + SearchFileForType(const ContextPtr &context, QString name, const ObjectValue *scope, @@ -759,12 +767,17 @@ public: } }; -class UpdateUI: public std::binary_function &, QList, void> +class UpdateUI { typedef FindReferences::Usage Usage; QFutureInterface *future; public: + // needed by QtConcurrent + using first_argument_type = QList &; + using second_argument_type = const QList &; + using result_type = void; + UpdateUI(QFutureInterface *future): future(future) {} void operator()(QList &, const QList &usages) diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index 0a71aca1e37..5e9b3dc0765 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -201,7 +201,7 @@ void ExamplesWelcomePage::openProject(const ExampleItem &item) // If the Qt is a distro Qt on Linux, it will not be writable, hence compilation will fail // Same if it is installed in non-writable location for other reasons - const bool needsCopy = withNTFSPermissions([proFileInfo] { + const bool needsCopy = withNtfsPermissions([proFileInfo] { QFileInfo pathInfo(proFileInfo.path()); return !proFileInfo.isWritable() || !pathInfo.isWritable() /* path of .pro file */ diff --git a/src/plugins/texteditor/behaviorsettingswidget.cpp b/src/plugins/texteditor/behaviorsettingswidget.cpp index 718ea5e6e94..65bb8d5717b 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.cpp +++ b/src/plugins/texteditor/behaviorsettingswidget.cpp @@ -59,7 +59,7 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent) QList mibs = QTextCodec::availableMibs(); Utils::sort(mibs); QList::iterator firstNonNegative = - std::find_if(mibs.begin(), mibs.end(), std::bind2nd(std::greater_equal(), 0)); + std::find_if(mibs.begin(), mibs.end(), [](int n) { return n >=0; }); if (firstNonNegative != mibs.end()) std::rotate(mibs.begin(), firstNonNegative, mibs.end()); foreach (int mib, mibs) { diff --git a/src/plugins/texteditor/generichighlighter/rule.cpp b/src/plugins/texteditor/generichighlighter/rule.cpp index 29be2fe6a39..701c6ac4598 100644 --- a/src/plugins/texteditor/generichighlighter/rule.cpp +++ b/src/plugins/texteditor/generichighlighter/rule.cpp @@ -144,7 +144,9 @@ bool Rule::charPredicateMatchSucceed(const QString &text, ProgressData *progress, bool (QChar::* predicate)() const) const { - return predicateMatchSucceed(text, length, progress, std::mem_fun_ref(predicate)); + return predicateMatchSucceed(text, length, progress, [predicate](const QChar &c) { + return (c.*predicate)(); + }); } bool Rule::charPredicateMatchSucceed(const QString &text, @@ -152,7 +154,9 @@ bool Rule::charPredicateMatchSucceed(const QString &text, ProgressData *progress, bool (*predicate)(const QChar &)) const { - return predicateMatchSucceed(text, length, progress, std::ptr_fun(predicate)); + return predicateMatchSucceed(text, length, progress, [predicate](const QChar &c) { + return predicate(c); + }); } bool Rule::matchSucceed(const QString &text, const int length, ProgressData *progress) diff --git a/src/tools/clangbackend/clangbackendmain.cpp b/src/tools/clangbackend/clangbackendmain.cpp index 28b7f251b6d..338fec79822 100644 --- a/src/tools/clangbackend/clangbackendmain.cpp +++ b/src/tools/clangbackend/clangbackendmain.cpp @@ -82,7 +82,6 @@ int main(int argc, char *argv[]) const QString connection = processArguments(application); - clang_toggleCrashRecovery(true); clang_enableStackTraces(); ClangCodeModelServer clangCodeModelServer; diff --git a/src/tools/clangbackend/source/clangasyncjob.h b/src/tools/clangbackend/source/clangasyncjob.h index 58b6a1f8455..69befdcdac7 100644 --- a/src/tools/clangbackend/source/clangasyncjob.h +++ b/src/tools/clangbackend/source/clangasyncjob.h @@ -58,7 +58,9 @@ public: &QFutureWatcher::finished, onFinished); - const QFuture future = Utils::runAsync(m_runner); + // Use 16MB stack size as clang_annotateTokens() would with an internal thread. + const Utils::StackSizeInBytes stackSize = 1024 * 1024 * 16; + const QFuture future = Utils::runAsync(stackSize, m_runner); m_futureWatcher.setFuture(future); return future; diff --git a/tests/system/shared/clang.py b/tests/system/shared/clang.py index dc07789740a..d1a5660828d 100644 --- a/tests/system/shared/clang.py +++ b/tests/system/shared/clang.py @@ -50,7 +50,7 @@ def startCreator(useClang): if not startCreatorTryingClang(): return False else: - startApplication("qtcreator" + SettingsPath) + startApplication("qtcreator -noload ClangCodeModel" + SettingsPath) finally: overrideStartApplication() return startedWithoutPluginError() diff --git a/tests/system/suite_APTW/tst_APTW01/test.py b/tests/system/suite_APTW/tst_APTW01/test.py index 10b3facf20f..e6fcc937c12 100644 --- a/tests/system/suite_APTW/tst_APTW01/test.py +++ b/tests/system/suite_APTW/tst_APTW01/test.py @@ -27,7 +27,9 @@ source("../../shared/qtcreator.py") # test New Qt Gui Application build and run for release and debug option def main(): - startApplication("qtcreator" + SettingsPath) + # Start Creator with built-in code model, to avoid having + # warnings from the clang code model in "issues" view + startCreator(False) if not startedWithoutPluginError(): return checkedTargets = createProject_Qt_GUI(tempDir(), "SampleApp")