From 622cac50f46ff2940a02527c75b9bed4589f9988 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 9 Feb 2012 09:35:03 +0100 Subject: Move QtConcurrent library into Utils. It causes a conflict with the new QtConcurrent library of Qt 5 and is quite small. Change-Id: Ib97ab6daf8f67a88300cf03f044ba3593a4cd270 Reviewed-by: Eike Ziller --- qtcreator.pri | 1 + src/libs/libs.pro | 1 - src/libs/qtconcurrent/QtConcurrentTools | 34 -- src/libs/qtconcurrent/multitask.h | 199 ----------- src/libs/qtconcurrent/qtconcurrent.pri | 1 - src/libs/qtconcurrent/qtconcurrent.pro | 12 - src/libs/qtconcurrent/qtconcurrent_global.h | 44 --- src/libs/qtconcurrent/runextensions.h | 397 --------------------- src/libs/utils/QtConcurrentTools | 34 ++ src/libs/utils/filesearch.cpp | 2 +- src/libs/utils/multitask.h | 199 +++++++++++ src/libs/utils/runextensions.h | 397 +++++++++++++++++++++ src/libs/utils/utils-lib.pri | 4 +- src/libs/utils/utils.pro | 4 +- .../cmakeprojectmanager/cmakeprojectmanager.cpp | 2 +- src/plugins/coreplugin/coreplugin.pro | 2 +- src/plugins/cpptools/cppchecksymbols.cpp | 2 +- src/plugins/cpptools/cppfindreferences.cpp | 2 +- src/plugins/cpptools/cppmodelmanager.cpp | 2 +- src/plugins/cpptools/cpptoolsplugin.cpp | 2 +- src/plugins/cpptools/symbolsfindfilter.cpp | 2 +- .../genericprojectmanager/selectablefilesmodel.cpp | 2 +- src/plugins/locator/directoryfilter.cpp | 2 +- src/plugins/locator/locator.pro | 1 - src/plugins/locator/locator_dependencies.pri | 1 - src/plugins/locator/locatorplugin.cpp | 2 +- src/plugins/locator/locatorwidget.cpp | 2 +- src/plugins/locator/settingspage.cpp | 2 +- src/plugins/projectexplorer/buildmanager.cpp | 2 +- src/plugins/qmljseditor/qmljsfindreferences.cpp | 2 +- src/plugins/qmljseditor/qmltaskmanager.cpp | 2 +- src/plugins/qmljstools/qmljsmodelmanager.cpp | 2 +- src/plugins/qt4projectmanager/qmakestep.cpp | 2 +- src/plugins/qt4projectmanager/qt4nodes.cpp | 2 +- src/plugins/qt4projectmanager/qt4project.cpp | 2 +- src/plugins/qtsupport/qmldumptool.cpp | 2 +- src/plugins/qtsupport/qtoptionspage.cpp | 2 +- .../texteditor/generichighlighter/manager.cpp | 2 +- src/plugins/updateinfo/updateinfo.pro | 1 - 39 files changed, 658 insertions(+), 718 deletions(-) delete mode 100644 src/libs/qtconcurrent/QtConcurrentTools delete mode 100644 src/libs/qtconcurrent/multitask.h delete mode 100644 src/libs/qtconcurrent/qtconcurrent.pri delete mode 100644 src/libs/qtconcurrent/qtconcurrent.pro delete mode 100644 src/libs/qtconcurrent/qtconcurrent_global.h delete mode 100644 src/libs/qtconcurrent/runextensions.h create mode 100644 src/libs/utils/QtConcurrentTools create mode 100644 src/libs/utils/multitask.h create mode 100644 src/libs/utils/runextensions.h diff --git a/qtcreator.pri b/qtcreator.pri index 23777db090..bc26570959 100644 --- a/qtcreator.pri +++ b/qtcreator.pri @@ -156,6 +156,7 @@ win32-msvc* { } qt:greaterThan(QT_MAJOR_VERSION, 4) { + contains(QT, core): QT += concurrent contains(QT, gui): QT += widgets contains(QT, declarative): QT += quick1 } diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 4ee5295874..f7f3626ae7 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -6,7 +6,6 @@ QT += core gui # because of dependencies of app SUBDIRS = \ 3rdparty \ - qtconcurrent \ utils \ utils/process_stub.pro \ languageutils \ diff --git a/src/libs/qtconcurrent/QtConcurrentTools b/src/libs/qtconcurrent/QtConcurrentTools deleted file mode 100644 index ea612c5b4c..0000000000 --- a/src/libs/qtconcurrent/QtConcurrentTools +++ /dev/null @@ -1,34 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#include "qtconcurrent/multitask.h" -#include "qtconcurrent/runextensions.h" diff --git a/src/libs/qtconcurrent/multitask.h b/src/libs/qtconcurrent/multitask.h deleted file mode 100644 index 31f2703284..0000000000 --- a/src/libs/qtconcurrent/multitask.h +++ /dev/null @@ -1,199 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#ifndef MULTITASK_H -#define MULTITASK_H - -#include "qtconcurrent_global.h" -#include "runextensions.h" - -#include -#include -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -namespace QtConcurrent { - -class QTCONCURRENT_EXPORT MultiTaskBase : public QObject, public QRunnable -{ - Q_OBJECT -protected slots: - virtual void cancelSelf() = 0; - virtual void setFinished() = 0; - virtual void setProgressRange(int min, int max) = 0; - virtual void setProgressValue(int value) = 0; - virtual void setProgressText(QString value) = 0; -}; - -template -class MultiTask : public MultiTaskBase -{ -public: - MultiTask(void (Class::*fn)(QFutureInterface &), const QList &objects) - : fn(fn), - objects(objects) - { - maxProgress = 100*objects.size(); - } - - QFuture future() - { - futureInterface.reportStarted(); - return futureInterface.future(); - } - - void run() - { - QThreadPool::globalInstance()->releaseThread(); - futureInterface.setProgressRange(0, maxProgress); - foreach (Class *object, objects) { - QFutureWatcher *watcher = new QFutureWatcher(); - watchers.insert(object, watcher); - finished.insert(watcher, false); - connect(watcher, SIGNAL(finished()), this, SLOT(setFinished())); - connect(watcher, SIGNAL(progressRangeChanged(int,int)), this, SLOT(setProgressRange(int,int))); - connect(watcher, SIGNAL(progressValueChanged(int)), this, SLOT(setProgressValue(int))); - connect(watcher, SIGNAL(progressTextChanged(QString)), this, SLOT(setProgressText(QString))); - watcher->setFuture(QtConcurrent::run(fn, object)); - } - selfWatcher = new QFutureWatcher(); - connect(selfWatcher, SIGNAL(canceled()), this, SLOT(cancelSelf())); - selfWatcher->setFuture(futureInterface.future()); - loop = new QEventLoop; - loop->exec(); - futureInterface.reportFinished(); - QThreadPool::globalInstance()->reserveThread(); - qDeleteAll(watchers); - delete selfWatcher; - delete loop; - } -protected: - void cancelSelf() - { - foreach (QFutureWatcher *watcher, watchers) - watcher->future().cancel(); - } - - void setFinished() - { - updateProgress(); - QFutureWatcher *watcher = static_cast *>(sender()); - if (finished.contains(watcher)) - finished[watcher] = true; - bool allFinished = true; - foreach (bool isFinished, finished) { - if (!isFinished) { - allFinished = false; - break; - } - } - if (allFinished) - loop->quit(); - } - - void setProgressRange(int min, int max) - { - Q_UNUSED(min) - Q_UNUSED(max) - updateProgress(); - } - - void setProgressValue(int value) - { - Q_UNUSED(value) - updateProgress(); - } - - void setProgressText(QString value) - { - Q_UNUSED(value) - updateProgressText(); - } -private: - void updateProgress() - { - int progressSum = 0; - foreach (QFutureWatcher *watcher, watchers) { - if (watcher->progressMinimum() == watcher->progressMaximum()) { - if (watcher->future().isFinished() && !watcher->future().isCanceled()) - progressSum += 100; - } else { - progressSum += 100*(watcher->progressValue()-watcher->progressMinimum())/(watcher->progressMaximum()-watcher->progressMinimum()); - } - } - futureInterface.setProgressValue(progressSum); - } - - void updateProgressText() - { - QString text; - foreach (QFutureWatcher *watcher, watchers) { - if (!watcher->progressText().isEmpty()) { - text += watcher->progressText(); - text += QLatin1Char('\n'); - } - } - text = text.trimmed(); - futureInterface.setProgressValueAndText(futureInterface.progressValue(), text); - } - - QFutureInterface futureInterface; - void (Class::*fn)(QFutureInterface &); - QList objects; - - QFutureWatcher *selfWatcher; - QMap *> watchers; - QMap *, bool> finished; - QEventLoop *loop; - int maxProgress; -}; - -template -QFuture run(void (Class::*fn)(QFutureInterface &), const QList &objects, int priority = 0) -{ - MultiTask *task = new MultiTask(fn, objects); - QFuture future = task->future(); - QThreadPool::globalInstance()->start(task, priority); - return future; -} - -} // namespace QtConcurrent - -QT_END_NAMESPACE - -#endif // MULTITASK_H diff --git a/src/libs/qtconcurrent/qtconcurrent.pri b/src/libs/qtconcurrent/qtconcurrent.pri deleted file mode 100644 index 141de8ee8e..0000000000 --- a/src/libs/qtconcurrent/qtconcurrent.pri +++ /dev/null @@ -1 +0,0 @@ -LIBS *= -l$$qtLibraryName(QtConcurrent) diff --git a/src/libs/qtconcurrent/qtconcurrent.pro b/src/libs/qtconcurrent/qtconcurrent.pro deleted file mode 100644 index f6a84499cc..0000000000 --- a/src/libs/qtconcurrent/qtconcurrent.pro +++ /dev/null @@ -1,12 +0,0 @@ -TEMPLATE = lib -TARGET = QtConcurrent -DEFINES += BUILD_QTCONCURRENT - -include(../../qtcreatorlibrary.pri) - -greaterThan(QT_MAJOR_VERSION, 4): QT += concurrent - -HEADERS += \ - qtconcurrent_global.h \ - multitask.h \ - runextensions.h diff --git a/src/libs/qtconcurrent/qtconcurrent_global.h b/src/libs/qtconcurrent/qtconcurrent_global.h deleted file mode 100644 index 8e0462d633..0000000000 --- a/src/libs/qtconcurrent/qtconcurrent_global.h +++ /dev/null @@ -1,44 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#ifndef QTCONCURRENT_GLOBAL_H -#define QTCONCURRENT_GLOBAL_H - -#include - -#if defined(BUILD_QTCONCURRENT) -# define QTCONCURRENT_EXPORT Q_DECL_EXPORT -#else -# define QTCONCURRENT_EXPORT Q_DECL_IMPORT -#endif - -#endif // QTCONCURRENT_GLOBAL_H diff --git a/src/libs/qtconcurrent/runextensions.h b/src/libs/qtconcurrent/runextensions.h deleted file mode 100644 index 2c8492133c..0000000000 --- a/src/libs/qtconcurrent/runextensions.h +++ /dev/null @@ -1,397 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** -** GNU Lesser General Public License Usage -** -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** Other Usage -** -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -**************************************************************************/ - -#ifndef QTCONCURRENT_RUNEX_H -#define QTCONCURRENT_RUNEX_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace QtConcurrent { - -template -class StoredInterfaceFunctionCall0 : public QRunnable -{ -public: - StoredInterfaceFunctionCall0(void (fn)(QFutureInterface &)) - : fn(fn) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - fn(futureInterface); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - -}; -template -class StoredInterfaceMemberFunctionCall0 : public QRunnable -{ -public: - StoredInterfaceMemberFunctionCall0(void (Class::*fn)(QFutureInterface &), Class *object) - : fn(fn), object(object) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - (object->*fn)(futureInterface); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Class *object; - -}; - -template -class StoredInterfaceFunctionCall1 : public QRunnable -{ -public: - StoredInterfaceFunctionCall1(void (fn)(QFutureInterface &, Arg1), Arg1 arg1) - : fn(fn), arg1(arg1) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - fn(futureInterface, arg1); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Arg1 arg1; -}; -template -class StoredInterfaceMemberFunctionCall1 : public QRunnable -{ -public: - StoredInterfaceMemberFunctionCall1(void (Class::*fn)(QFutureInterface &, Arg1), Class *object, Arg1 arg1) - : fn(fn), object(object), arg1(arg1) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - (object->*fn)(futureInterface, arg1); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Class *object; - Arg1 arg1; -}; - -template -class StoredInterfaceFunctionCall2 : public QRunnable -{ -public: - StoredInterfaceFunctionCall2(void (fn)(QFutureInterface &, Arg1, Arg2), Arg1 arg1, Arg2 arg2) - : fn(fn), arg1(arg1), arg2(arg2) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - fn(futureInterface, arg1, arg2); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Arg1 arg1; Arg2 arg2; -}; -template -class StoredInterfaceMemberFunctionCall2 : public QRunnable -{ -public: - StoredInterfaceMemberFunctionCall2(void (Class::*fn)(QFutureInterface &, Arg1, Arg2), Class *object, Arg1 arg1, Arg2 arg2) - : fn(fn), object(object), arg1(arg1), arg2(arg2) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - (object->*fn)(futureInterface, arg1, arg2); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Class *object; - Arg1 arg1; Arg2 arg2; -}; - -template -class StoredInterfaceFunctionCall3 : public QRunnable -{ -public: - StoredInterfaceFunctionCall3(void (fn)(QFutureInterface &, Arg1, Arg2, Arg3), Arg1 arg1, Arg2 arg2, Arg3 arg3) - : fn(fn), arg1(arg1), arg2(arg2), arg3(arg3) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - fn(futureInterface, arg1, arg2, arg3); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; -template -class StoredInterfaceMemberFunctionCall3 : public QRunnable -{ -public: - StoredInterfaceMemberFunctionCall3(void (Class::*fn)(QFutureInterface &, Arg1, Arg2, Arg3), Class *object, Arg1 arg1, Arg2 arg2, Arg3 arg3) - : fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - (object->*fn)(futureInterface, arg1, arg2, arg3); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; -}; - -template -class StoredInterfaceFunctionCall4 : public QRunnable -{ -public: - StoredInterfaceFunctionCall4(void (fn)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4), Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) - : fn(fn), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - fn(futureInterface, arg1, arg2, arg3, arg4); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; -template -class StoredInterfaceMemberFunctionCall4 : public QRunnable -{ -public: - StoredInterfaceMemberFunctionCall4(void (Class::*fn)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4), Class *object, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) - : fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - (object->*fn)(futureInterface, arg1, arg2, arg3, arg4); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; -}; - -template -class StoredInterfaceFunctionCall5 : public QRunnable -{ -public: - StoredInterfaceFunctionCall5(void (fn)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4, Arg5), Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) - : fn(fn), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - fn(futureInterface, arg1, arg2, arg3, arg4, arg5); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; -template -class StoredInterfaceMemberFunctionCall5 : public QRunnable -{ -public: - StoredInterfaceMemberFunctionCall5(void (Class::*fn)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4, Arg5), Class *object, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) - : fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5) { } - - QFuture start() - { - futureInterface.reportStarted(); - QFuture future = futureInterface.future(); - QThreadPool::globalInstance()->start(this); - return future; - } - - void run() - { - (object->*fn)(futureInterface, arg1, arg2, arg3, arg4, arg5); - futureInterface.reportFinished(); - } -private: - QFutureInterface futureInterface; - FunctionPointer fn; - Class *object; - Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; -}; - -template -QFuture run(void (*functionPointer)(QFutureInterface &)) -{ - return (new StoredInterfaceFunctionCall0 &)>(functionPointer))->start(); -} -template -QFuture run(void (*functionPointer)(QFutureInterface &, Arg1), Arg1 arg1) -{ - return (new StoredInterfaceFunctionCall1 &, Arg1), Arg1>(functionPointer, arg1))->start(); -} -template -QFuture run(void (*functionPointer)(QFutureInterface &, Arg1, Arg2), Arg1 arg1, Arg2 arg2) -{ - return (new StoredInterfaceFunctionCall2 &, Arg1, Arg2), Arg1, Arg2>(functionPointer, arg1, arg2))->start(); -} -template -QFuture run(void (*functionPointer)(QFutureInterface &, Arg1, Arg2, Arg3), Arg1 arg1, Arg2 arg2, Arg3 arg3) -{ - return (new StoredInterfaceFunctionCall3 &, Arg1, Arg2, Arg3), Arg1, Arg2, Arg3>(functionPointer, arg1, arg2, arg3))->start(); -} -template -QFuture run(void (*functionPointer)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4), Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) -{ - return (new StoredInterfaceFunctionCall4 &, Arg1, Arg2, Arg3, Arg4), Arg1, Arg2, Arg3, Arg4>(functionPointer, arg1, arg2, arg3, arg4))->start(); -} -template -QFuture run(void (*functionPointer)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4, Arg5), Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) -{ - return (new StoredInterfaceFunctionCall5 &, Arg1, Arg2, Arg3, Arg4, Arg5), Arg1, Arg2, Arg3, Arg4, Arg5>(functionPointer, arg1, arg2, arg3, arg4, arg5))->start(); -} - -template -QFuture run(void (Class::*fn)(QFutureInterface &), Class *object) -{ - return (new StoredInterfaceMemberFunctionCall0 &), Class>(fn, object))->start(); -} - -} // namespace QtConcurrent - -QT_END_NAMESPACE - -#endif // QTCONCURRENT_RUNEX_H diff --git a/src/libs/utils/QtConcurrentTools b/src/libs/utils/QtConcurrentTools new file mode 100644 index 0000000000..e5129e8c5c --- /dev/null +++ b/src/libs/utils/QtConcurrentTools @@ -0,0 +1,34 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#include "multitask.h" +#include "runextensions.h" diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 88a931d3e4..7387f51c9c 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include "runextensions.h" using namespace Utils; diff --git a/src/libs/utils/multitask.h b/src/libs/utils/multitask.h new file mode 100644 index 0000000000..71c09a6453 --- /dev/null +++ b/src/libs/utils/multitask.h @@ -0,0 +1,199 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#ifndef MULTITASK_H +#define MULTITASK_H + +#include "utils_global.h" +#include "runextensions.h" + +#include +#include +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +namespace QtConcurrent { + +class QTCREATOR_UTILS_EXPORT MultiTaskBase : public QObject, public QRunnable +{ + Q_OBJECT +protected slots: + virtual void cancelSelf() = 0; + virtual void setFinished() = 0; + virtual void setProgressRange(int min, int max) = 0; + virtual void setProgressValue(int value) = 0; + virtual void setProgressText(QString value) = 0; +}; + +template +class MultiTask : public MultiTaskBase +{ +public: + MultiTask(void (Class::*fn)(QFutureInterface &), const QList &objects) + : fn(fn), + objects(objects) + { + maxProgress = 100*objects.size(); + } + + QFuture future() + { + futureInterface.reportStarted(); + return futureInterface.future(); + } + + void run() + { + QThreadPool::globalInstance()->releaseThread(); + futureInterface.setProgressRange(0, maxProgress); + foreach (Class *object, objects) { + QFutureWatcher *watcher = new QFutureWatcher(); + watchers.insert(object, watcher); + finished.insert(watcher, false); + connect(watcher, SIGNAL(finished()), this, SLOT(setFinished())); + connect(watcher, SIGNAL(progressRangeChanged(int,int)), this, SLOT(setProgressRange(int,int))); + connect(watcher, SIGNAL(progressValueChanged(int)), this, SLOT(setProgressValue(int))); + connect(watcher, SIGNAL(progressTextChanged(QString)), this, SLOT(setProgressText(QString))); + watcher->setFuture(QtConcurrent::run(fn, object)); + } + selfWatcher = new QFutureWatcher(); + connect(selfWatcher, SIGNAL(canceled()), this, SLOT(cancelSelf())); + selfWatcher->setFuture(futureInterface.future()); + loop = new QEventLoop; + loop->exec(); + futureInterface.reportFinished(); + QThreadPool::globalInstance()->reserveThread(); + qDeleteAll(watchers); + delete selfWatcher; + delete loop; + } +protected: + void cancelSelf() + { + foreach (QFutureWatcher *watcher, watchers) + watcher->future().cancel(); + } + + void setFinished() + { + updateProgress(); + QFutureWatcher *watcher = static_cast *>(sender()); + if (finished.contains(watcher)) + finished[watcher] = true; + bool allFinished = true; + foreach (bool isFinished, finished) { + if (!isFinished) { + allFinished = false; + break; + } + } + if (allFinished) + loop->quit(); + } + + void setProgressRange(int min, int max) + { + Q_UNUSED(min) + Q_UNUSED(max) + updateProgress(); + } + + void setProgressValue(int value) + { + Q_UNUSED(value) + updateProgress(); + } + + void setProgressText(QString value) + { + Q_UNUSED(value) + updateProgressText(); + } +private: + void updateProgress() + { + int progressSum = 0; + foreach (QFutureWatcher *watcher, watchers) { + if (watcher->progressMinimum() == watcher->progressMaximum()) { + if (watcher->future().isFinished() && !watcher->future().isCanceled()) + progressSum += 100; + } else { + progressSum += 100*(watcher->progressValue()-watcher->progressMinimum())/(watcher->progressMaximum()-watcher->progressMinimum()); + } + } + futureInterface.setProgressValue(progressSum); + } + + void updateProgressText() + { + QString text; + foreach (QFutureWatcher *watcher, watchers) { + if (!watcher->progressText().isEmpty()) { + text += watcher->progressText(); + text += QLatin1Char('\n'); + } + } + text = text.trimmed(); + futureInterface.setProgressValueAndText(futureInterface.progressValue(), text); + } + + QFutureInterface futureInterface; + void (Class::*fn)(QFutureInterface &); + QList objects; + + QFutureWatcher *selfWatcher; + QMap *> watchers; + QMap *, bool> finished; + QEventLoop *loop; + int maxProgress; +}; + +template +QFuture run(void (Class::*fn)(QFutureInterface &), const QList &objects, int priority = 0) +{ + MultiTask *task = new MultiTask(fn, objects); + QFuture future = task->future(); + QThreadPool::globalInstance()->start(task, priority); + return future; +} + +} // namespace QtConcurrent + +QT_END_NAMESPACE + +#endif // MULTITASK_H diff --git a/src/libs/utils/runextensions.h b/src/libs/utils/runextensions.h new file mode 100644 index 0000000000..2c8492133c --- /dev/null +++ b/src/libs/utils/runextensions.h @@ -0,0 +1,397 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#ifndef QTCONCURRENT_RUNEX_H +#define QTCONCURRENT_RUNEX_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace QtConcurrent { + +template +class StoredInterfaceFunctionCall0 : public QRunnable +{ +public: + StoredInterfaceFunctionCall0(void (fn)(QFutureInterface &)) + : fn(fn) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + fn(futureInterface); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + +}; +template +class StoredInterfaceMemberFunctionCall0 : public QRunnable +{ +public: + StoredInterfaceMemberFunctionCall0(void (Class::*fn)(QFutureInterface &), Class *object) + : fn(fn), object(object) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + (object->*fn)(futureInterface); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Class *object; + +}; + +template +class StoredInterfaceFunctionCall1 : public QRunnable +{ +public: + StoredInterfaceFunctionCall1(void (fn)(QFutureInterface &, Arg1), Arg1 arg1) + : fn(fn), arg1(arg1) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + fn(futureInterface, arg1); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Arg1 arg1; +}; +template +class StoredInterfaceMemberFunctionCall1 : public QRunnable +{ +public: + StoredInterfaceMemberFunctionCall1(void (Class::*fn)(QFutureInterface &, Arg1), Class *object, Arg1 arg1) + : fn(fn), object(object), arg1(arg1) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + (object->*fn)(futureInterface, arg1); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Class *object; + Arg1 arg1; +}; + +template +class StoredInterfaceFunctionCall2 : public QRunnable +{ +public: + StoredInterfaceFunctionCall2(void (fn)(QFutureInterface &, Arg1, Arg2), Arg1 arg1, Arg2 arg2) + : fn(fn), arg1(arg1), arg2(arg2) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + fn(futureInterface, arg1, arg2); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Arg1 arg1; Arg2 arg2; +}; +template +class StoredInterfaceMemberFunctionCall2 : public QRunnable +{ +public: + StoredInterfaceMemberFunctionCall2(void (Class::*fn)(QFutureInterface &, Arg1, Arg2), Class *object, Arg1 arg1, Arg2 arg2) + : fn(fn), object(object), arg1(arg1), arg2(arg2) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + (object->*fn)(futureInterface, arg1, arg2); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Class *object; + Arg1 arg1; Arg2 arg2; +}; + +template +class StoredInterfaceFunctionCall3 : public QRunnable +{ +public: + StoredInterfaceFunctionCall3(void (fn)(QFutureInterface &, Arg1, Arg2, Arg3), Arg1 arg1, Arg2 arg2, Arg3 arg3) + : fn(fn), arg1(arg1), arg2(arg2), arg3(arg3) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + fn(futureInterface, arg1, arg2, arg3); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; +template +class StoredInterfaceMemberFunctionCall3 : public QRunnable +{ +public: + StoredInterfaceMemberFunctionCall3(void (Class::*fn)(QFutureInterface &, Arg1, Arg2, Arg3), Class *object, Arg1 arg1, Arg2 arg2, Arg3 arg3) + : fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + (object->*fn)(futureInterface, arg1, arg2, arg3); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; +}; + +template +class StoredInterfaceFunctionCall4 : public QRunnable +{ +public: + StoredInterfaceFunctionCall4(void (fn)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4), Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) + : fn(fn), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + fn(futureInterface, arg1, arg2, arg3, arg4); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; +template +class StoredInterfaceMemberFunctionCall4 : public QRunnable +{ +public: + StoredInterfaceMemberFunctionCall4(void (Class::*fn)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4), Class *object, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) + : fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + (object->*fn)(futureInterface, arg1, arg2, arg3, arg4); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; +}; + +template +class StoredInterfaceFunctionCall5 : public QRunnable +{ +public: + StoredInterfaceFunctionCall5(void (fn)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4, Arg5), Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) + : fn(fn), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + fn(futureInterface, arg1, arg2, arg3, arg4, arg5); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; +template +class StoredInterfaceMemberFunctionCall5 : public QRunnable +{ +public: + StoredInterfaceMemberFunctionCall5(void (Class::*fn)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4, Arg5), Class *object, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) + : fn(fn), object(object), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5) { } + + QFuture start() + { + futureInterface.reportStarted(); + QFuture future = futureInterface.future(); + QThreadPool::globalInstance()->start(this); + return future; + } + + void run() + { + (object->*fn)(futureInterface, arg1, arg2, arg3, arg4, arg5); + futureInterface.reportFinished(); + } +private: + QFutureInterface futureInterface; + FunctionPointer fn; + Class *object; + Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5; +}; + +template +QFuture run(void (*functionPointer)(QFutureInterface &)) +{ + return (new StoredInterfaceFunctionCall0 &)>(functionPointer))->start(); +} +template +QFuture run(void (*functionPointer)(QFutureInterface &, Arg1), Arg1 arg1) +{ + return (new StoredInterfaceFunctionCall1 &, Arg1), Arg1>(functionPointer, arg1))->start(); +} +template +QFuture run(void (*functionPointer)(QFutureInterface &, Arg1, Arg2), Arg1 arg1, Arg2 arg2) +{ + return (new StoredInterfaceFunctionCall2 &, Arg1, Arg2), Arg1, Arg2>(functionPointer, arg1, arg2))->start(); +} +template +QFuture run(void (*functionPointer)(QFutureInterface &, Arg1, Arg2, Arg3), Arg1 arg1, Arg2 arg2, Arg3 arg3) +{ + return (new StoredInterfaceFunctionCall3 &, Arg1, Arg2, Arg3), Arg1, Arg2, Arg3>(functionPointer, arg1, arg2, arg3))->start(); +} +template +QFuture run(void (*functionPointer)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4), Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) +{ + return (new StoredInterfaceFunctionCall4 &, Arg1, Arg2, Arg3, Arg4), Arg1, Arg2, Arg3, Arg4>(functionPointer, arg1, arg2, arg3, arg4))->start(); +} +template +QFuture run(void (*functionPointer)(QFutureInterface &, Arg1, Arg2, Arg3, Arg4, Arg5), Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) +{ + return (new StoredInterfaceFunctionCall5 &, Arg1, Arg2, Arg3, Arg4, Arg5), Arg1, Arg2, Arg3, Arg4, Arg5>(functionPointer, arg1, arg2, arg3, arg4, arg5))->start(); +} + +template +QFuture run(void (Class::*fn)(QFutureInterface &), Class *object) +{ + return (new StoredInterfaceMemberFunctionCall0 &), Class>(fn, object))->start(); +} + +} // namespace QtConcurrent + +QT_END_NAMESPACE + +#endif // QTCONCURRENT_RUNEX_H diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri index 638f99d001..a422fff4fd 100644 --- a/src/libs/utils/utils-lib.pri +++ b/src/libs/utils/utils-lib.pri @@ -203,7 +203,9 @@ HEADERS += \ $$PWD/networkaccessmanager.h \ $$PWD/persistentsettings.h \ $$PWD/completingtextedit.h \ - $$PWD/json.h + $$PWD/json.h \ + $$PWD/multitask.h \ + $$PWD/runextensions.h FORMS += $$PWD/filewizardpage.ui \ $$PWD/projectintropage.ui \ diff --git a/src/libs/utils/utils.pro b/src/libs/utils/utils.pro index 2d8ef2be45..0a1888c113 100644 --- a/src/libs/utils/utils.pro +++ b/src/libs/utils/utils.pro @@ -8,9 +8,7 @@ include(utils_dependencies.pri) include(utils-lib.pri) -greaterThan(QT_MAJOR_VERSION, 4) { - QT += concurrent -} else { +lessThan(QT_MAJOR_VERSION, 5) { # Needed for QtCore/private/qwineventnotifier_p.h win32:include(../../private_headers.pri) } diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index e3ee122c6d..7a4d51022d 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index af115d56a0..fe78c4b558 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -4,7 +4,7 @@ DEFINES += CORE_LIBRARY QT += network \ script \ sql -greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport concurrent +greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport CONFIG += help include(../../qtcreatorplugin.pri) diff --git a/src/plugins/cpptools/cppchecksymbols.cpp b/src/plugins/cpptools/cppchecksymbols.cpp index d1bdb3c281..84e99548a1 100644 --- a/src/plugins/cpptools/cppchecksymbols.cpp +++ b/src/plugins/cpptools/cppchecksymbols.cpp @@ -49,7 +49,7 @@ #include #include -#include +#include using namespace CPlusPlus; using namespace CppTools; diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index f97dd9f4e2..9071239626 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -66,7 +66,7 @@ #include #include #include -#include +#include #include diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 7e82347594..3277f2c459 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -45,7 +45,7 @@ #include #ifndef ICHECK_BUILD # include -# include +# include # include # include # include diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 0fb8cd453f..ca441f5026 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -61,7 +61,7 @@ #include #include -#include +#include #include #include diff --git a/src/plugins/cpptools/symbolsfindfilter.cpp b/src/plugins/cpptools/symbolsfindfilter.cpp index aaa84bf727..b1fc1a5567 100644 --- a/src/plugins/cpptools/symbolsfindfilter.cpp +++ b/src/plugins/cpptools/symbolsfindfilter.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/plugins/genericprojectmanager/selectablefilesmodel.cpp b/src/plugins/genericprojectmanager/selectablefilesmodel.cpp index d18e5ca805..61320d81b3 100644 --- a/src/plugins/genericprojectmanager/selectablefilesmodel.cpp +++ b/src/plugins/genericprojectmanager/selectablefilesmodel.cpp @@ -34,7 +34,7 @@ #include -#include +#include #include #include #include diff --git a/src/plugins/locator/directoryfilter.cpp b/src/plugins/locator/directoryfilter.cpp index 43da2545d0..aab9d439e2 100644 --- a/src/plugins/locator/directoryfilter.cpp +++ b/src/plugins/locator/directoryfilter.cpp @@ -38,7 +38,7 @@ #include #include -#include +#include #include using namespace Locator; diff --git a/src/plugins/locator/locator.pro b/src/plugins/locator/locator.pro index e1e3ed5b05..fab92816fc 100644 --- a/src/plugins/locator/locator.pro +++ b/src/plugins/locator/locator.pro @@ -2,7 +2,6 @@ TEMPLATE = lib TARGET = Locator DEFINES += LOCATOR_LIBRARY include(../../qtcreatorplugin.pri) -greaterThan(QT_MAJOR_VERSION, 4): QT += concurrent include(locator_dependencies.pri) HEADERS += locatorplugin.h \ commandlocator.h \ diff --git a/src/plugins/locator/locator_dependencies.pri b/src/plugins/locator/locator_dependencies.pri index 96d71e68c8..a64caedc10 100644 --- a/src/plugins/locator/locator_dependencies.pri +++ b/src/plugins/locator/locator_dependencies.pri @@ -1,2 +1 @@ -include(../../libs/qtconcurrent/qtconcurrent.pri) include(../../plugins/coreplugin/coreplugin.pri) diff --git a/src/plugins/locator/locatorplugin.cpp b/src/plugins/locator/locatorplugin.cpp index d82e0c7bfa..9a0fc297a0 100644 --- a/src/plugins/locator/locatorplugin.cpp +++ b/src/plugins/locator/locatorplugin.cpp @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/plugins/locator/locatorwidget.cpp b/src/plugins/locator/locatorwidget.cpp index 179b9a40be..9289066d87 100644 --- a/src/plugins/locator/locatorwidget.cpp +++ b/src/plugins/locator/locatorwidget.cpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/plugins/locator/settingspage.cpp b/src/plugins/locator/settingspage.cpp index c1f9c2fbd9..48ce67f9c2 100644 --- a/src/plugins/locator/settingspage.cpp +++ b/src/plugins/locator/settingspage.cpp @@ -38,7 +38,7 @@ #include "directoryfilter.h" #include -#include +#include #include #include diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index d466219939..083b02f58d 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -58,7 +58,7 @@ #include #include -#include +#include #include #include diff --git a/src/plugins/qmljseditor/qmljsfindreferences.cpp b/src/plugins/qmljseditor/qmljsfindreferences.cpp index ac93acabf9..49a024a1a5 100644 --- a/src/plugins/qmljseditor/qmljsfindreferences.cpp +++ b/src/plugins/qmljseditor/qmljsfindreferences.cpp @@ -62,7 +62,7 @@ #include #include #include -#include +#include #include diff --git a/src/plugins/qmljseditor/qmltaskmanager.cpp b/src/plugins/qmljseditor/qmltaskmanager.cpp index a6a6dfb44c..1bfb716c1f 100644 --- a/src/plugins/qmljseditor/qmltaskmanager.cpp +++ b/src/plugins/qmljseditor/qmltaskmanager.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include using namespace QmlJS; diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index 6c4367bbe3..04f2a0d2cf 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index 7752c91a53..1f48c2ac87 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -59,7 +59,7 @@ #include #include -#include +#include #include #include diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 677f6d5b63..e20653d798 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -74,7 +74,7 @@ #include #include #include -#include +#include // Static cached data in struct Qt4NodeStaticData providing information and icons // for file types and the project. Do some magic via qAddPostRoutine() diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index 5ecfd73a09..298a44bb35 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -64,7 +64,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/plugins/qtsupport/qmldumptool.cpp b/src/plugins/qtsupport/qmldumptool.cpp index fbbbc4ae6c..41b1c4e8fe 100644 --- a/src/plugins/qtsupport/qmldumptool.cpp +++ b/src/plugins/qtsupport/qmldumptool.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 590ddee2cf..620b484484 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/plugins/texteditor/generichighlighter/manager.cpp b/src/plugins/texteditor/generichighlighter/manager.cpp index 9221c22f70..920461807d 100644 --- a/src/plugins/texteditor/generichighlighter/manager.cpp +++ b/src/plugins/texteditor/generichighlighter/manager.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/plugins/updateinfo/updateinfo.pro b/src/plugins/updateinfo/updateinfo.pro index 25f686dfcb..fb3a2b3118 100644 --- a/src/plugins/updateinfo/updateinfo.pro +++ b/src/plugins/updateinfo/updateinfo.pro @@ -1,7 +1,6 @@ TARGET = UpdateInfo TEMPLATE = lib QT += network xml -greaterThan(QT_MAJOR_VERSION, 4): QT += concurrent HEADERS += updateinfoplugin.h \ updateinfobutton.h -- cgit v1.2.1