diff --git a/src/libs/qmljs/qmljsimportdependencies.cpp b/src/libs/qmljs/qmljsimportdependencies.cpp index 198a2dbd433..27a0595e341 100644 --- a/src/libs/qmljs/qmljsimportdependencies.cpp +++ b/src/libs/qmljs/qmljsimportdependencies.cpp @@ -32,7 +32,6 @@ #include "qmljsqrcparser.h" #include -#include #include @@ -616,7 +615,7 @@ CoreImport ImportDependencies::coreImport(const QString &importId) const void ImportDependencies::iterateOnCandidateImports( const ImportKey &key, const ViewerContext &vContext, - Utils::function + std::function const &iterF) const { switch (key.type) { @@ -817,7 +816,7 @@ void ImportDependencies::removeExport(const QString &importId, const ImportKey & void ImportDependencies::iterateOnCoreImports( const ViewerContext &vContext, - Utils::function const &iterF) const + std::function const &iterF) const { QMapIterator i(m_coreImports); while (i.hasNext()) { @@ -829,9 +828,9 @@ void ImportDependencies::iterateOnCoreImports( void ImportDependencies::iterateOnLibraryImports( const ViewerContext &vContext, - Utils::function const &iterF) const + std::function const &iterF) const { typedef QMap::const_iterator iter_t; ImportKey firstLib; @@ -865,9 +864,9 @@ void ImportDependencies::iterateOnLibraryImports( void ImportDependencies::iterateOnSubImports( const ImportKey &baseKey, const ViewerContext &vContext, - Utils::function const &iterF) const + std::function const &iterF) const { typedef QMap::const_iterator iter_t; iter_t i = m_importCache.lowerBound(baseKey); diff --git a/src/libs/qmljs/qmljsimportdependencies.h b/src/libs/qmljs/qmljsimportdependencies.h index c77b42dfd05..0ca0dbcf34a 100644 --- a/src/libs/qmljs/qmljsimportdependencies.h +++ b/src/libs/qmljs/qmljsimportdependencies.h @@ -34,7 +34,6 @@ #include #include -#include #include #include @@ -44,6 +43,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE class QCryptographicHash; QT_END_NAMESPACE @@ -192,7 +193,7 @@ public: CoreImport coreImport(const QString &importId) const; void iterateOnCandidateImports(const ImportKey &key, const ViewerContext &vContext, - Utils::function const &iterF) const; ImportElements candidateImports(const ImportKey &key, const ViewerContext &vContext) const; @@ -209,13 +210,13 @@ public: const QString &requiredPath); void iterateOnCoreImports(const ViewerContext &vContext, - Utils::function const &iterF) const; + std::function const &iterF) const; void iterateOnLibraryImports(const ViewerContext &vContext, - Utils::function const &iterF) const; void iterateOnSubImports(const ImportKey &baseKey, const ViewerContext &vContext, - Utils::function const &iterF) const; diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 98015f81715..6a9068807e0 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -36,7 +36,6 @@ #include "qmljstypedescriptionreader.h" #include -#include #include #include @@ -815,7 +814,7 @@ void ModelManagerInterface::parseLoop(QSet &scannedPaths, ModelManagerInterface *modelManager, Language::Enum mainLanguage, bool emitDocChangedOnDisk, - Utils::function reportProgress) + std::function reportProgress) { for (int i = 0; i < files.size(); ++i) { if (!reportProgress(qreal(i) / files.size())) diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h index 6e53c21746f..5b3f771cf9a 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.h +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.h @@ -229,7 +229,7 @@ protected: static void parseLoop(QSet &scannedPaths, QSet &newLibraries, WorkingCopy workingCopyInternal, QStringList files, ModelManagerInterface *modelManager, QmlJS::Language::Enum mainLanguage, bool emitDocChangedOnDisk, - Utils::function reportProgress); + std::function reportProgress); static void parse(QFutureInterface &future, WorkingCopy workingCopyInternal, QStringList files, diff --git a/src/libs/utils/function.cpp b/src/libs/utils/function.cpp deleted file mode 100644 index 037cd8824c5..00000000000 --- a/src/libs/utils/function.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "function.h" - -namespace { -// just compilation tests - -void test(); - -void functionUser(Utils::function generator, Utils::function consumer) -{ - consumer(generator()); -} - -struct GenFunctor -{ - int operator()() { return 29; } -}; - -struct ConsumerFunctor -{ - void operator()(int) {} -}; - -int generatorF() -{ - return 42; -} - -void consumerF(int i) -{ - if (i < 0) - test(); -} - -void test() -{ - functionUser(GenFunctor(), ConsumerFunctor()); - functionUser(&generatorF, &consumerF); -} - -} // end namespace diff --git a/src/libs/utils/function.h b/src/libs/utils/function.h deleted file mode 100644 index 0edc9b6029e..00000000000 --- a/src/libs/utils/function.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef QTC_FUNCTION_H -#define QTC_FUNCTION_H - -#include -#if !(__cplusplus > 199711L || __GXX_EXPERIMENTAL_CXX0X__ || _MSC_VER >= 1600 || defined( _LIBCPP_VERSION )) || \ - (defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)) -#define USE_TR1 -#endif - -#ifdef USE_TR1 -# ifdef __GNUC__ -# include -# endif -namespace Utils { using std::tr1::function; } -#else -namespace Utils { using std::function; } -#endif - -#endif // QTC_FUNCTION_H diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri index 5237d7ec48b..ca6da2708b2 100644 --- a/src/libs/utils/utils-lib.pri +++ b/src/libs/utils/utils-lib.pri @@ -82,7 +82,6 @@ SOURCES += $$PWD/environment.cpp \ $$PWD/tooltip/tips.cpp \ $$PWD/tooltip/tipcontents.cpp \ $$PWD/unixutils.cpp \ - $$PWD/function.cpp \ $$PWD/ansiescapecodehandler.cpp \ $$PWD/execmenu.cpp \ $$PWD/completinglineedit.cpp \ @@ -173,7 +172,6 @@ HEADERS += \ $$PWD/tooltip/effects.h \ $$PWD/unixutils.h \ $$PWD/qtcoverride.h \ - $$PWD/function.h \ $$PWD/ansiescapecodehandler.h \ $$PWD/execmenu.h \ $$PWD/completinglineedit.h \ diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 1bcc17aaa58..6a17f6bcc93 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -89,8 +89,6 @@ QtcLibrary { "filewizardpage.ui", "flowlayout.cpp", "flowlayout.h", - "function.cpp", - "function.h", "historycompleter.cpp", "historycompleter.h", "hostosinfo.h", diff --git a/src/plugins/cpptools/cppsourceprocessor.h b/src/plugins/cpptools/cppsourceprocessor.h index b5db3b7f493..2b8aed6acb2 100644 --- a/src/plugins/cpptools/cppsourceprocessor.h +++ b/src/plugins/cpptools/cppsourceprocessor.h @@ -5,7 +5,6 @@ #include #include -#include #include #include @@ -13,6 +12,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE class QTextCodec; QT_END_NAMESPACE diff --git a/src/plugins/cpptools/indexitem.h b/src/plugins/cpptools/indexitem.h index 40b9782e8c0..78f15aa9602 100644 --- a/src/plugins/cpptools/indexitem.h +++ b/src/plugins/cpptools/indexitem.h @@ -32,8 +32,6 @@ #include "cpptools_global.h" -#include - #include #include #include diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index dce5e4b811f..da51a627acf 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -49,7 +49,6 @@ #include #include #include -#include #include #include