diff --git a/.gitignore b/.gitignore index 067d81b8729..f100f3152c3 100644 --- a/.gitignore +++ b/.gitignore @@ -229,7 +229,6 @@ tmp/ /tests/manual/ssh/sftpfsmodel/sftpfsmodel /tests/manual/ssh/shell/shell /tests/manual/ssh/tunnel/tunnel -/tests/manual/utils/tcpportsgatherer/tst_tcpportsgatherer /tests/tools/qml-ast2dot/qml-ast2dot /tests/valgrind/memcheck/modeldemo /tests/valgrind/memcheck/parsertests diff --git a/README.md b/README.md index 5a07dc05249..551174e0947 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Qt Creator is a cross-platform IDE for development with the Qt framework. The standalone binary packages support the following platforms: -Windows XP SP3 or later -(K)Ubuntu Linux 11.10 (32-bit and 64-bit) or later +Windows 7 or later +(K)Ubuntu Linux 14.04 (64-bit) or later Mac OS X 10.7 or later Building the sources requires Qt 5.5.0 or later. diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp index a87dc4a2f72..58b17e2451e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp @@ -217,7 +217,7 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe if (object == 0) object = new QQuickItem; } else { - object = new QObject; + object = Internal::ObjectNodeInstance::createPrimitive("QtQml/QtObject", 2, 0, nodeInstanceServer->context()); } } diff --git a/share/qtcreator/themes/default.creatortheme b/share/qtcreator/themes/default.creatortheme index 5aa64a4bdc8..5a688c7d99d 100644 --- a/share/qtcreator/themes/default.creatortheme +++ b/share/qtcreator/themes/default.creatortheme @@ -52,7 +52,7 @@ IconsWarningToolBarColor=fff2d76e IconsErrorColor=ffdf4f4f IconsErrorToolBarColor=ffdb6f71 IconsRunColor=ffa4d576 -IconsStopColor=ffdb6f71 +IconsStopColor=ffff8c8c IconsDebugColor=ffdcdcdc IconsInterruptColor=ff8f9dda IconsNavigationArrowsColor=ffebc322 diff --git a/share/qtcreator/themes/defaultflat.creatortheme b/share/qtcreator/themes/defaultflat.creatortheme index a3899aed899..9b208b961c2 100644 --- a/share/qtcreator/themes/defaultflat.creatortheme +++ b/share/qtcreator/themes/defaultflat.creatortheme @@ -42,7 +42,7 @@ DoubleTabWidget2ndTabActiveTextColor=ffffffff DoubleTabWidget2ndTabBackgroundColor=ffff0000 DoubleTabWidget2ndTabInactiveTextColor=ff000000 EditorPlaceholderColor=ffdddddd -FancyToolBarSeparatorColor=43ffffff +FancyToolBarSeparatorColor=toolBarItemDisabled FancyTabBarBackgroundColor=shadowBackground FancyTabWidgetDisabledSelectedTextColor=toolBarItemDisabled FancyTabWidgetDisabledUnselectedTextColor=toolBarItemDisabled diff --git a/src/libs/qmljs/qmljsqrcparser.cpp b/src/libs/qmljs/qmljsqrcparser.cpp index 6b07fc1d135..d312bbe6b31 100644 --- a/src/libs/qmljs/qmljsqrcparser.cpp +++ b/src/libs/qmljs/qmljsqrcparser.cpp @@ -406,8 +406,10 @@ void QrcParserPrivate::collectResourceFilesForSourceFile(const QString &sourceFi QStringList *results, const QLocale *locale) const { - QTC_CHECK(sourceFile.startsWith(QLatin1Char('/'))); - QTC_CHECK(!sourceFile.endsWith(QLatin1Char('/'))); + // TODO: use FileName from fileutils for file pathes + QTC_CHECK(QFileInfo(sourceFile).isFile()); + QTC_CHECK(QFileInfo(sourceFile).isAbsolute()); + QStringList langs = allUiLanguages(locale); SMap::const_iterator file = m_files.find(sourceFile); if (file == m_files.end()) diff --git a/src/libs/utils/runextensions.h b/src/libs/utils/runextensions.h index 1fc9005bbbf..565c98e4010 100644 --- a/src/libs/utils/runextensions.h +++ b/src/libs/utils/runextensions.h @@ -37,6 +37,24 @@ #include +// hasCallOperator & Co must be outside of any namespace +// because of internal compiler error with MSVC2015 Update 2 + +using testCallOperatorYes = char; +using testCallOperatorNo = struct { char foo[2]; }; + +template +static testCallOperatorYes testCallOperator(decltype(&C::operator())); + +template +static testCallOperatorNo testCallOperator(...); + +template +struct hasCallOperator +{ + static const bool value = (sizeof(testCallOperator(0)) == sizeof(testCallOperatorYes)); +}; + namespace Utils { namespace Internal { @@ -53,21 +71,6 @@ namespace Internal { a QFutureInterface& as its first parameter and returns void. */ -template -struct hasCallOperator -{ - using yes = char; - using no = struct { char foo[2]; }; - - template - static yes test(decltype(&C::operator())); - - template - static no test(...); - - static const bool value = (sizeof(test(0)) == sizeof(yes)); -}; - template struct resultType; diff --git a/src/libs/utils/tcpportsgatherer.cpp b/src/libs/utils/tcpportsgatherer.cpp deleted file mode 100644 index afb29c6ca5e..00000000000 --- a/src/libs/utils/tcpportsgatherer.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "tcpportsgatherer.h" -#include "qtcassert.h" - -#include - -#include -#include -#include - -#ifdef Q_OS_WIN -#include -#include -#include -#include -#endif - -#if defined(Q_OS_WIN) && defined(Q_CC_MINGW) - -// Missing declarations for MinGW 32. -#if __GNUC__ == 4 && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 2) -typedef enum { } MIB_TCP_STATE; -#endif - -typedef struct _MIB_TCP6ROW { - MIB_TCP_STATE State; - IN6_ADDR LocalAddr; - DWORD dwLocalScopeId; - DWORD dwLocalPort; - IN6_ADDR RemoteAddr; - DWORD dwRemoteScopeId; - DWORD dwRemotePort; -} MIB_TCP6ROW, *PMIB_TCP6ROW; - -typedef struct _MIB_TCP6TABLE { - DWORD dwNumEntries; - MIB_TCP6ROW table[ANY_SIZE]; -} MIB_TCP6TABLE, *PMIB_TCP6TABLE; - -#endif // defined(Q_OS_WIN) && defined(Q_CC_MINGW) - -namespace Utils { -namespace Internal { - -class TcpPortsGathererPrivate -{ -public: - TcpPortsGathererPrivate() - : protocol(QAbstractSocket::UnknownNetworkLayerProtocol) {} - - QAbstractSocket::NetworkLayerProtocol protocol; - QSet usedPorts; - - void updateWin(); - void updateLinux(); - void updateNetstat(); -}; - -#ifdef Q_OS_WIN -template -QSet usedTcpPorts(ULONG (__stdcall *Func)(Table*, PULONG, BOOL)) -{ - Table *table = static_cast(malloc(sizeof(Table))); - DWORD dwSize = sizeof(Table); - - // get the necessary size into the dwSize variable - DWORD dwRetVal = Func(table, &dwSize, false); - if (dwRetVal == ERROR_INSUFFICIENT_BUFFER) { - free(table); - table = static_cast(malloc(dwSize)); - } - - // get the actual data - QSet result; - dwRetVal = Func(table, &dwSize, false); - if (dwRetVal == NO_ERROR) { - for (quint32 i = 0; i < table->dwNumEntries; i++) { - quint16 port = ntohs(table->table[i].dwLocalPort); - if (!result.contains(port)) - result.insert(port); - } - } else { - qWarning() << "TcpPortsGatherer: GetTcpTable failed with" << dwRetVal; - } - - free(table); - return result; -} -#endif - -void TcpPortsGathererPrivate::updateWin() -{ -#ifdef Q_OS_WIN - QSet ports; - - if (protocol == QAbstractSocket::IPv4Protocol) { - ports.unite(usedTcpPorts(GetTcpTable)); - } else { - //Dynamically load symbol for GetTcp6Table for systems that dont have support for IPV6, - //eg Windows XP - typedef ULONG (__stdcall *GetTcp6TablePtr)(PMIB_TCP6TABLE, PULONG, BOOL); - static GetTcp6TablePtr getTcp6TablePtr = 0; - - if (!getTcp6TablePtr) - getTcp6TablePtr = (GetTcp6TablePtr)QLibrary::resolve(QLatin1String("Iphlpapi.dll"), - "GetTcp6Table"); - - if (getTcp6TablePtr && (protocol == QAbstractSocket::IPv6Protocol)) { - ports.unite(usedTcpPorts(getTcp6TablePtr)); - } else if (protocol == QAbstractSocket::UnknownNetworkLayerProtocol) { - ports.unite(usedTcpPorts(GetTcpTable)); - if (getTcp6TablePtr) - ports.unite(usedTcpPorts(getTcp6TablePtr)); - } - } - - foreach (int port, ports) - usedPorts.insert(port); -#endif - Q_UNUSED(protocol); -} - -void TcpPortsGathererPrivate::updateLinux() -{ - QStringList filePaths; - const QString tcpFile = QLatin1String("/proc/net/tcp"); - const QString tcp6File = QLatin1String("/proc/net/tcp6"); - if (protocol == QAbstractSocket::IPv4Protocol) - filePaths << tcpFile; - else if (protocol == QAbstractSocket::IPv6Protocol) - filePaths << tcp6File; - else - filePaths << tcpFile << tcp6File; - - foreach (const QString &filePath, filePaths) { - QFile file(filePath); - if (!file.open(QFile::ReadOnly | QFile::Text)) { - qWarning() << "TcpPortsGatherer: Cannot open file" - << filePath << ":" << file.errorString(); - continue; - } - - if (file.atEnd()) // read first line describing the output - file.readLine(); - - static QRegExp pattern(QLatin1String("^\\s*" // start of line, whitespace - "\\d+:\\s*" // integer, colon, space - "[0-9A-Fa-f]+:" // hexadecimal number (ip), colon - "([0-9A-Fa-f]+)" // hexadecimal number (port!) - )); - while (!file.atEnd()) { - QByteArray line = file.readLine(); - if (pattern.indexIn(QLatin1String(line)) != -1) { - bool isNumber; - quint16 port = pattern.cap(1).toUShort(&isNumber, 16); - QTC_ASSERT(isNumber, continue); - usedPorts.insert(port); - } else { - qWarning() << "TcpPortsGatherer: File" << filePath << "has unexpected format."; - continue; - } - } - } -} - -// Only works with FreeBSD version of netstat like we have on Mac OS X -void TcpPortsGathererPrivate::updateNetstat() -{ - QStringList netstatArgs; - - netstatArgs.append(QLatin1String("-a")); // show also sockets of server processes - netstatArgs.append(QLatin1String("-n")); // show network addresses as numbers - netstatArgs.append(QLatin1String("-p")); - netstatArgs.append(QLatin1String("tcp")); - if (protocol != QAbstractSocket::UnknownNetworkLayerProtocol) { - netstatArgs.append(QLatin1String("-f")); // limit to address family - if (protocol == QAbstractSocket::IPv4Protocol) - netstatArgs.append(QLatin1String("inet")); - else - netstatArgs.append(QLatin1String("inet6")); - } - - QProcess netstatProcess; - netstatProcess.start(QLatin1String("netstat"), netstatArgs); - if (!netstatProcess.waitForFinished(30000)) { - qWarning() << "TcpPortsGatherer: netstat did not return in time."; - return; - } - - QList output = netstatProcess.readAllStandardOutput().split('\n'); - foreach (const QByteArray &line, output) { - static QRegExp pattern(QLatin1String("^tcp[46]+" // "tcp", followed by "4", "6", "46" - "\\s+\\d+" // whitespace, number (Recv-Q) - "\\s+\\d+" // whitespace, number (Send-Q) - "\\s+(\\S+)")); // whitespace, Local Address - if (pattern.indexIn(QLatin1String(line)) != -1) { - QString localAddress = pattern.cap(1); - - // Examples of local addresses: - // '*.56501' , '*.*' 'fe80::1%lo0.123' - int portDelimiterPos = localAddress.lastIndexOf(QLatin1Char('.')); - if (portDelimiterPos == -1) - continue; - - localAddress = localAddress.mid(portDelimiterPos + 1); - bool isNumber; - quint16 port = localAddress.toUShort(&isNumber); - if (!isNumber) - continue; - - usedPorts.insert(port); - } - } -} - -} // namespace Internal - - -/*! - \class Utils::TcpPortsGatherer - - \brief The TcpPortsGatherer class gathers the list of local TCP ports - already in use. - - Queries the system for the list of local TCP ports already in use. This - information can be used - to select a port for use in a range. -*/ - -TcpPortsGatherer::TcpPortsGatherer() - : d(new Internal::TcpPortsGathererPrivate()) -{ -} - -TcpPortsGatherer::~TcpPortsGatherer() -{ - delete d; -} - -void TcpPortsGatherer::update(QAbstractSocket::NetworkLayerProtocol protocol) -{ - d->protocol = protocol; - d->usedPorts.clear(); - - if (HostOsInfo::isWindowsHost()) - d->updateWin(); - else if (HostOsInfo::isLinuxHost()) - d->updateLinux(); - else - d->updateNetstat(); -} - -QList TcpPortsGatherer::usedPorts() const -{ - return d->usedPorts.values(); -} - -/*! - Selects a port out of \a freePorts that is not yet used. - - Returns the port, or -1 if no free port is available. - */ -int TcpPortsGatherer::getNextFreePort(PortList *freePorts) const -{ - QTC_ASSERT(freePorts, return -1); - while (freePorts->hasMore()) { - const int port = freePorts->getNext(); - if (!d->usedPorts.contains(port)) - return port; - } - return -1; -} - -} // namespace Utils diff --git a/src/libs/utils/tcpportsgatherer.h b/src/libs/utils/tcpportsgatherer.h deleted file mode 100644 index dc56f75281e..00000000000 --- a/src/libs/utils/tcpportsgatherer.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include "portlist.h" - -#include - -namespace Utils { -namespace Internal { class TcpPortsGathererPrivate; } - -class QTCREATOR_UTILS_EXPORT TcpPortsGatherer -{ -public: - TcpPortsGatherer(); - ~TcpPortsGatherer(); - - void update(QAbstractSocket::NetworkLayerProtocol protocol); - - QList usedPorts() const; - int getNextFreePort(PortList *port) const; - -private: - Internal::TcpPortsGathererPrivate *d; -}; - -} // namespace Utils diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri index 476714a8870..a8b79e5e262 100644 --- a/src/libs/utils/utils-lib.pri +++ b/src/libs/utils/utils-lib.pri @@ -70,7 +70,6 @@ SOURCES += $$PWD/environment.cpp \ $$PWD/completingtextedit.cpp \ $$PWD/json.cpp \ $$PWD/portlist.cpp \ - $$PWD/tcpportsgatherer.cpp \ $$PWD/appmainwindow.cpp \ $$PWD/sleep.cpp \ $$PWD/basetreeview.cpp \ @@ -170,7 +169,6 @@ HEADERS += \ $$PWD/json.h \ $$PWD/runextensions.h \ $$PWD/portlist.h \ - $$PWD/tcpportsgatherer.h \ $$PWD/appmainwindow.h \ $$PWD/sleep.h \ $$PWD/basetreeview.h \ diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 85a84b566f2..53125f5fef6 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -200,8 +200,6 @@ QtcLibrary { "stylehelper.h", "synchronousprocess.cpp", "synchronousprocess.h", - "tcpportsgatherer.cpp", - "tcpportsgatherer.h", "templateengine.cpp", "templateengine.h", "textfieldcheckbox.cpp", diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticmodel.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticmodel.cpp index 49b904a812c..39d1d945bfa 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticmodel.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticmodel.cpp @@ -144,7 +144,7 @@ static QString createExplainingStepToolTipString(const ExplainingStep &step) } if (!step.extendedMessage.isEmpty()) { lines << qMakePair( - QCoreApplication::translate("ClangStaticAnalyzer::ExplainingStep", "Extended Message:"), + QCoreApplication::translate("ClangStaticAnalyzer::ExplainingStep", "Extended message:"), step.extendedMessage.toHtmlEscaped()); } diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticview.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticview.cpp index fdd3a7aef59..e0d1b32cff5 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticview.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticview.cpp @@ -44,7 +44,7 @@ namespace Internal { ClangStaticAnalyzerDiagnosticView::ClangStaticAnalyzerDiagnosticView(QWidget *parent) : Debugger::DetailedErrorView(parent) { - m_suppressAction = new QAction(tr("Suppress this diagnostic"), this); + m_suppressAction = new QAction(tr("Suppress This Diagnostic"), this); connect(m_suppressAction, &QAction::triggered, [this](bool) { suppressCurrentDiagnostic(); }); } diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingswidget.ui b/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingswidget.ui index c131bbe0c22..17977514079 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingswidget.ui +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingswidget.ui @@ -19,7 +19,7 @@ - Suppressed Diagnostics: + Suppressed diagnostics: diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerrunner.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzerrunner.cpp index 00e0672d3b4..07ac8b35f80 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerrunner.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerrunner.cpp @@ -39,12 +39,12 @@ static Q_LOGGING_CATEGORY(LOG, "qtc.clangstaticanalyzer.runner") static QString generalProcessError() { - return QObject::tr("An error occurred with the clang static analyzer process."); + return QObject::tr("An error occurred with the Clang Static Analyzer process."); } static QString finishedDueToCrash() { - return QObject::tr("Clang static analyzer crashed."); + return QObject::tr("Clang Static Analyzer crashed."); } static QStringList constructCommandLineArguments(const QString &filePath, @@ -66,7 +66,7 @@ namespace Internal { QString finishedWithBadExitCode(int exitCode) { - return QObject::tr("Clang static analyzer finished with exit code: %1.").arg(exitCode); + return QObject::tr("Clang Static Analyzer finished with exit code: %1.").arg(exitCode); } ClangStaticAnalyzerRunner::ClangStaticAnalyzerRunner(const QString &clangExecutable, diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp index 994b507f700..a56f9a0cb25 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp @@ -120,7 +120,7 @@ ClangStaticAnalyzerTool::ClangStaticAnalyzerTool(QObject *parent) connect(action, &QAction::triggered, m_diagnosticView, &DetailedErrorView::goNext); m_goNext = action; - const QString toolTip = tr("Clang Static Analyzer uses the analyzer from the clang project " + const QString toolTip = tr("Clang Static Analyzer uses the analyzer from the Clang project " "to find bugs."); Debugger::registerPerspective(ClangStaticAnalyzerPerspectiveId, { @@ -311,7 +311,7 @@ void ClangStaticAnalyzerTool::handleStateUpdate() m_goBack->setEnabled(issuesVisible > 1); m_goNext->setEnabled(issuesVisible > 1); - QString message = m_running ? tr("Clang Static Analyzer running.") + QString message = m_running ? tr("Clang Static Analyzer is running.") : tr("Clang Static Analyzer finished."); message += QLatin1Char(' '); if (issuesFound == 0) { diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.cpp index d800af2588d..18e8544b020 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.cpp @@ -91,7 +91,7 @@ bool isClangExecutableUsable(const QString &filePath, QString *errorMessage) if (errorMessage) { *errorMessage = QCoreApplication::translate("ClangStaticAnalyzer", "The chosen file \"%1\" seems to point to an icecc binary not suitable " - "for analyzing.\nPlease set a real clang executable.") + "for analyzing.\nPlease set a real Clang executable.") .arg(filePath); } return false; diff --git a/src/plugins/coreplugin/coreicons.cpp b/src/plugins/coreplugin/coreicons.cpp index 3b1d2793344..827caa16a65 100644 --- a/src/plugins/coreplugin/coreicons.cpp +++ b/src/plugins/coreplugin/coreicons.cpp @@ -52,10 +52,12 @@ const Icon RESET( QLatin1String(":/core/images/reset.png")); const Icon DARK_CLOSE( QLatin1String(":/core/images/darkclose.png")); -const Icon LOCKED( - QLatin1String(":/core/images/locked.png")); -const Icon UNLOCKED( - QLatin1String(":/core/images/unlocked.png")); +const Icon LOCKED_TOOLBAR({ + {QLatin1String(":/core/images/locked.png"), Theme::IconsBaseColor}}); +const Icon LOCKED({ + {QLatin1String(":/core/images/locked.png"), Theme::PanelTextColorDark}}, Icon::Tint); +const Icon UNLOCKED_TOOLBAR({ + {QLatin1String(":/core/images/unlocked.png"), Theme::IconsBaseColor}}); const Icon FIND_CASE_INSENSITIVELY( QLatin1String(":/find/images/casesensitively.png")); const Icon FIND_WHOLE_WORD( diff --git a/src/plugins/coreplugin/coreicons.h b/src/plugins/coreplugin/coreicons.h index 25f16636645..048c356f945 100644 --- a/src/plugins/coreplugin/coreicons.h +++ b/src/plugins/coreplugin/coreicons.h @@ -43,8 +43,9 @@ CORE_EXPORT extern const Utils::Icon CUT; CORE_EXPORT extern const Utils::Icon DIR; CORE_EXPORT extern const Utils::Icon RESET; CORE_EXPORT extern const Utils::Icon DARK_CLOSE; +CORE_EXPORT extern const Utils::Icon LOCKED_TOOLBAR; CORE_EXPORT extern const Utils::Icon LOCKED; -CORE_EXPORT extern const Utils::Icon UNLOCKED; +CORE_EXPORT extern const Utils::Icon UNLOCKED_TOOLBAR; CORE_EXPORT extern const Utils::Icon FIND_CASE_INSENSITIVELY; CORE_EXPORT extern const Utils::Icon FIND_WHOLE_WORD; CORE_EXPORT extern const Utils::Icon FIND_REGEXP; diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp index 9b62f7375e0..e24e74e8750 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.cpp +++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp @@ -48,7 +48,6 @@ class DocumentModelPrivate : public QAbstractItemModel Q_OBJECT public: - DocumentModelPrivate(); ~DocumentModelPrivate(); int columnCount(const QModelIndex &parent = QModelIndex()) const; @@ -70,6 +69,8 @@ public: bool disambiguateDisplayNames(DocumentModel::Entry *entry); + static QIcon lockedIcon(); + private: friend class DocumentModel; void itemChanged(); @@ -101,20 +102,11 @@ private: } }; - const QIcon m_lockedIcon; - const QIcon m_unlockedIcon; - QList m_entries; QMap > m_editors; QHash m_entryByFixedPath; }; -DocumentModelPrivate::DocumentModelPrivate() : - m_lockedIcon(Icons::LOCKED.icon()), - m_unlockedIcon(Icons::UNLOCKED.icon()) -{ -} - DocumentModelPrivate::~DocumentModelPrivate() { qDeleteAll(m_entries); @@ -150,12 +142,7 @@ void DocumentModel::destroy() QIcon DocumentModel::lockedIcon() { - return d->m_lockedIcon; -} - -QIcon DocumentModel::unlockedIcon() -{ - return d->m_unlockedIcon; + return DocumentModelPrivate::lockedIcon(); } QAbstractItemModel *DocumentModel::model() @@ -340,6 +327,12 @@ bool DocumentModelPrivate::disambiguateDisplayNames(DocumentModel::Entry *entry) return true; } +QIcon DocumentModelPrivate::lockedIcon() +{ + const static QIcon icon = Icons::LOCKED.icon(); + return icon; +} + int DocumentModelPrivate::indexOfFilePath(const Utils::FileName &filePath) const { if (filePath.isEmpty()) @@ -535,7 +528,7 @@ QVariant DocumentModelPrivate::data(const QModelIndex &index, int role) const return name; } case Qt::DecorationRole: - return e->document->isFileReadOnly() ? m_lockedIcon : QIcon(); + return e->document->isFileReadOnly() ? lockedIcon() : QIcon(); case Qt::ToolTipRole: return e->fileName().isEmpty() ? e->displayName() : e->fileName().toUserOutput(); default: diff --git a/src/plugins/coreplugin/editormanager/documentmodel.h b/src/plugins/coreplugin/editormanager/documentmodel.h index 5c9dab8ecf2..2dcbe4c698b 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.h +++ b/src/plugins/coreplugin/editormanager/documentmodel.h @@ -47,8 +47,6 @@ public: static void destroy(); static QIcon lockedIcon(); - static QIcon unlockedIcon(); - static QAbstractItemModel *model(); struct CORE_EXPORT Entry { diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 26ad0b5d7c4..c472c8c29c4 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -413,11 +413,13 @@ void EditorToolBar::updateDocumentStatus(IDocument *document) d->m_lockButton->setEnabled(false); d->m_lockButton->setToolTip(QString()); } else if (document->isFileReadOnly()) { - d->m_lockButton->setIcon(DocumentModel::lockedIcon()); + const static QIcon locked = Icons::LOCKED_TOOLBAR.icon(); + d->m_lockButton->setIcon(locked); d->m_lockButton->setEnabled(true); d->m_lockButton->setToolTip(tr("Make Writable")); } else { - d->m_lockButton->setIcon(DocumentModel::unlockedIcon()); + const static QIcon unlocked = Icons::UNLOCKED_TOOLBAR.icon(); + d->m_lockButton->setIcon(unlocked); d->m_lockButton->setEnabled(false); d->m_lockButton->setToolTip(tr("File is writable")); } diff --git a/src/plugins/coreplugin/images/locked.png b/src/plugins/coreplugin/images/locked.png index ad832b5846a..7ce4f1f3599 100644 Binary files a/src/plugins/coreplugin/images/locked.png and b/src/plugins/coreplugin/images/locked.png differ diff --git a/src/plugins/coreplugin/images/locked@2x.png b/src/plugins/coreplugin/images/locked@2x.png index b3f1c54ffe2..d40ae60040f 100644 Binary files a/src/plugins/coreplugin/images/locked@2x.png and b/src/plugins/coreplugin/images/locked@2x.png differ diff --git a/src/plugins/coreplugin/images/unlocked.png b/src/plugins/coreplugin/images/unlocked.png index 3b8a5b660f8..a281db1a8c9 100644 Binary files a/src/plugins/coreplugin/images/unlocked.png and b/src/plugins/coreplugin/images/unlocked.png differ diff --git a/src/plugins/coreplugin/images/unlocked@2x.png b/src/plugins/coreplugin/images/unlocked@2x.png index 2935eddf7d1..4867e1568eb 100644 Binary files a/src/plugins/coreplugin/images/unlocked@2x.png and b/src/plugins/coreplugin/images/unlocked@2x.png differ diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index e25346785db..0c5cd6c39be 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -485,15 +485,16 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption anim->paint(painter, option); } else { bool pressed = option->state & State_Sunken || option->state & State_On; - QColor shadow(0, 0, 0, 30); - painter->setPen(shadow); + painter->setPen(StyleHelper::sidebarShadow()); if (pressed) { const QColor shade = creatorTheme()->color(Theme::FancyToolButtonSelectedColor); painter->fillRect(rect, shade); - const QRectF borderRect = QRectF(rect).adjusted(0.5, 0.5, -0.5, -0.5); - painter->drawLine(borderRect.topLeft() + QPointF(1, 0), borderRect.topRight() - QPointF(1, 0)); - painter->drawLine(borderRect.topLeft(), borderRect.bottomLeft()); - painter->drawLine(borderRect.topRight(), borderRect.bottomRight()); + if (creatorTheme()->widgetStyle() == Theme::StyleDefault) { + const QRectF borderRect = QRectF(rect).adjusted(0.5, 0.5, -0.5, -0.5); + painter->drawLine(borderRect.topLeft() + QPointF(1, 0), borderRect.topRight() - QPointF(1, 0)); + painter->drawLine(borderRect.topLeft(), borderRect.bottomLeft()); + painter->drawLine(borderRect.topRight(), borderRect.bottomRight()); + } } else if (option->state & State_Enabled && option->state & State_MouseOver) { painter->fillRect(rect, creatorTheme()->color(Theme::FancyToolButtonHoverColor)); } else if (widget && widget->property("highlightWidget").toBool()) { diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index 99933d5a692..fe90a73abe3 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -78,6 +78,7 @@ OutputPanePlaceHolder::~OutputPanePlaceHolder() om->setParent(0); om->hide(); } + OutputPanePlaceHolderPrivate::m_current = nullptr; } delete d; } diff --git a/src/plugins/coreplugin/progressmanager/progressbar.cpp b/src/plugins/coreplugin/progressmanager/progressbar.cpp index a1c3fcbd919..13481968939 100644 --- a/src/plugins/coreplugin/progressmanager/progressbar.cpp +++ b/src/plugins/coreplugin/progressmanager/progressbar.cpp @@ -244,11 +244,14 @@ void ProgressBar::paintEvent(QPaintEvent *) // Draw separator int separatorHeight = m_separatorVisible ? SEPARATOR_HEIGHT : 0; if (m_separatorVisible) { + QRectF innerRect = QRectF(this->rect()).adjusted(0.5, 0.5, -0.5, -0.5); p.setPen(StyleHelper::sidebarShadow()); - p.drawLine(0,0, size().width(), 0); + p.drawLine(innerRect.topLeft(), innerRect.topRight()); - p.setPen(StyleHelper::sidebarHighlight()); - p.drawLine(1, 1, size().width(), 1); + if (creatorTheme()->flag(Theme::DrawToolBarHighlights)) { + p.setPen(StyleHelper::sidebarHighlight()); + p.drawLine(innerRect.topLeft() + QPointF(1, 1), innerRect.topRight() + QPointF(0, 1)); + } } if (m_titleVisible) { diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index da9e4a6d862..00a0bdf5770 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -2502,6 +2502,8 @@ void DebuggerPluginPrivate::setInitialState() void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) { + if (m_shuttingDown) + return; QTC_ASSERT(engine, return); QTC_ASSERT(m_watchersView->model(), return); QTC_ASSERT(m_returnView->model(), return); @@ -2647,6 +2649,8 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) void DebuggerPluginPrivate::updateDebugActions() { + if (m_shuttingDown) + return; //if we're currently debugging the actions are controlled by engine if (m_currentEngine->state() != DebuggerNotReady) return; @@ -2775,6 +2779,8 @@ QTreeView *inspectorView() void DebuggerPluginPrivate::showMessage(const QString &msg, int channel, int timeout) { + if (m_shuttingDown) + return; //qDebug() << "PLUGIN OUTPUT: " << channel << msg; QTC_ASSERT(m_logWindow, return); switch (channel) { diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 5b2a8cbecb3..13904ca1204 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -232,8 +232,11 @@ bool DebuggerRunControl::promptToStop(bool *optionalPrompt) const "Terminating the session in the current" " state can leave the target in an inconsistent state." " Would you still like to terminate it?"); - return showPromptToStopDialog(tr("Close Debugging Session"), question, - QString(), QString(), optionalPrompt); + bool result = showPromptToStopDialog(tr("Close Debugging Session"), question, + QString(), QString(), optionalPrompt); + if (result) + disconnect(this); + return result; } RunControl::StopResult DebuggerRunControl::stop() diff --git a/src/plugins/ios/iosprobe.cpp b/src/plugins/ios/iosprobe.cpp index 8abe8b0f03e..72069fb91b1 100644 --- a/src/plugins/ios/iosprobe.cpp +++ b/src/plugins/ios/iosprobe.cpp @@ -137,7 +137,7 @@ void IosProbe::setupDefaultToolchains(const QString &devPath, const QString &xco if (name != QLatin1String("macosx") && name != QLatin1String("iphoneos") && name != QLatin1String("iphonesimulator")) { - qCWarning(probeLog) << indent << QString::fromLatin1("Skipping unknown platform %1").arg(name); + qCDebug(probeLog) << indent << QString::fromLatin1("Skipping unknown platform %1").arg(name); continue; } diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index 65611128b0a..63b4319de0f 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -99,7 +99,7 @@ static const FileTypeDataStorage fileTypeDataStorage[] = { ":/qmakeprojectmanager/images/sources.png", "*.c; *.cc; *.cpp; *.cp; *.cxx; *.c++;" }, { FormType, Theme::ProjectExplorerForm, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Forms"), ":/qtsupport/images/forms.png", "*.ui;" }, - { StateChartType, Theme::ProjectExplorerForm, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "StateCharts"), + { StateChartType, Theme::ProjectExplorerForm, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "State charts"), ":/qtsupport/images/statecharts.png", "*.scxml;" }, { ResourceType, Theme::ProjectExplorerResource, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Resources"), ":/qtsupport/images/qt_qrc.png", "*.qrc;" }, @@ -2107,9 +2107,7 @@ void QmakeProFileNode::applyEvaluate(EvalResult *evalResult) // we are changing what is executed in that case if (result->state == EvalResult::EvalFail || m_project->wasEvaluateCanceled()) { m_validParse = false; - m_project->destroyProFileReader(m_readerExact); - m_project->destroyProFileReader(m_readerCumulative); - m_readerExact = m_readerCumulative = 0; + cleanupProFileReaders(); setValidParseRecursive(false); setParseInProgressRecursive(false); @@ -2305,8 +2303,8 @@ void QmakeProFileNode::cleanupProFileReaders() m_project->destroyProFileReader(m_readerExact); m_project->destroyProFileReader(m_readerCumulative); - m_readerExact = 0; - m_readerCumulative = 0; + m_readerExact = nullptr; + m_readerCumulative = nullptr; } QStringList QmakeProFileNode::fileListForVar(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative, diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 687e8a30ce2..d286ca37205 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -299,6 +299,10 @@ QmakeProject::~QmakeProject() { m_codeModelFuture.cancel(); m_asyncUpdateState = ShuttingDown; + + // Make sure root node (and associated readers) are shut hown before proceeding + setRootProjectNode(nullptr); + projectManager()->unregisterProject(this); delete m_projectFiles; m_cancelEvaluate = true; @@ -392,7 +396,7 @@ void QmakeProject::updateCppCodeModel() typedef CppTools::ProjectPart ProjectPart; typedef CppTools::ProjectFile ProjectFile; - Kit *k = 0; + Kit *k = nullptr; if (Target *target = activeTarget()) k = target->kit(); else @@ -729,7 +733,7 @@ void QmakeProject::decrementPendingEvaluateFutures() m_asyncUpdateFutureInterface->reportFinished(); delete m_asyncUpdateFutureInterface; - m_asyncUpdateFutureInterface = 0; + m_asyncUpdateFutureInterface = nullptr; m_cancelEvaluate = false; // TODO clear the profile cache ? @@ -940,7 +944,7 @@ QtSupport::ProFileReader *QmakeProject::createProFileReader(const QmakeProFileNo } ++m_qmakeGlobalsRefCnt; - QtSupport::ProFileReader *reader = new QtSupport::ProFileReader(m_qmakeGlobals, m_qmakeVfs); + auto reader = new QtSupport::ProFileReader(m_qmakeGlobals, m_qmakeVfs); reader->setOutputDir(qmakeProFileNode->buildDir()); @@ -968,7 +972,7 @@ void QmakeProject::destroyProFileReader(QtSupport::ProFileReader *reader) QtSupport::ProFileCacheManager::instance()->decRefCount(); delete m_qmakeGlobals; - m_qmakeGlobals = 0; + m_qmakeGlobals = nullptr; } } diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 30e64558abb..fd69d95de4a 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -295,10 +295,10 @@ void QmlProfilerTool::updateRunActions() { if (d->m_toolBusy) { d->m_startAction->setEnabled(false); - d->m_startAction->setToolTip(tr("A Qml Profiler analysis is still in progress.")); + d->m_startAction->setToolTip(tr("A QML Profiler analysis is still in progress.")); d->m_stopAction->setEnabled(true); } else { - QString whyNot = tr("Start Qml Profiler analysis."); + QString whyNot = tr("Start QML Profiler analysis."); bool canRun = ProjectExplorerPlugin::canRunStartupProject (ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, &whyNot); d->m_startAction->setToolTip(whyNot); @@ -429,7 +429,7 @@ void QmlProfilerTool::recordingButtonChanged(bool recording) void QmlProfilerTool::setRecording(bool recording) { // update display - d->m_recordButton->setToolTip( recording ? tr("Disable profiling") : tr("Enable profiling")); + d->m_recordButton->setToolTip( recording ? tr("Disable Profiling") : tr("Enable Profiling")); d->m_recordButton->setIcon(QIcon(recording ? QLatin1String(":/qmlprofiler/recordOn.png") : QLatin1String(":/qmlprofiler/recordOff.png"))); diff --git a/src/plugins/texteditor/generichighlighter/manager.cpp b/src/plugins/texteditor/generichighlighter/manager.cpp index 2ab4e58e2b0..6f32e833b9d 100644 --- a/src/plugins/texteditor/generichighlighter/manager.cpp +++ b/src/plugins/texteditor/generichighlighter/manager.cpp @@ -248,35 +248,16 @@ bool Manager::isBuildingDefinition(const QString &id) const return m_isBuildingDefinition.contains(id); } -class ManagerProcessor -{ -public: - ManagerProcessor(); - // TODO: make move-only when we can require MSVC2015 +static const int kMaxProgress = 200; - void operator()(QFutureInterface &future); - - QStringList m_definitionsPaths; - static const int kMaxProgress; -}; - -const int ManagerProcessor::kMaxProgress = 200; - -ManagerProcessor::ManagerProcessor() -{ - const HighlighterSettings &settings = TextEditorSettings::highlighterSettings(); - m_definitionsPaths.append(settings.definitionFilesPath()); - if (settings.useFallbackLocation()) - m_definitionsPaths.append(settings.fallbackDefinitionFilesPath()); -} - -void ManagerProcessor::operator()(QFutureInterface &future) +static void processHighlightingFiles(QFutureInterface &future, + QStringList definitionPaths) { future.setProgressRange(0, kMaxProgress); Manager::RegisterData data; // iterate through paths in order, high priority > low priority - foreach (const QString &path, m_definitionsPaths) { + foreach (const QString &path, definitionPaths) { if (path.isEmpty()) continue; @@ -322,7 +303,13 @@ void Manager::registerHighlightingFiles() if (!m_registeringWatcher.isRunning()) { clear(); - QFuture future = Utils::runAsync(ManagerProcessor()); + QStringList definitionsPaths; + const HighlighterSettings &settings = TextEditorSettings::highlighterSettings(); + definitionsPaths.append(settings.definitionFilesPath()); + if (settings.useFallbackLocation()) + definitionsPaths.append(settings.fallbackDefinitionFilesPath()); + + QFuture future = Utils::runAsync(processHighlightingFiles, definitionsPaths); m_registeringWatcher.setFuture(future); } else { m_hasQueuedRegistration = true; @@ -408,7 +395,7 @@ QList Manager::parseAvailableDefinitionsList(QIODevice *d void Manager::downloadAvailableDefinitionsMetaData() { - QUrl url(QLatin1String("http://www.kate-editor.org/syntax/update-5.17.xml")); + QUrl url(QLatin1String("https://www.kate-editor.org/syntax/update-5.17.xml")); QNetworkRequest request(url); // Currently this takes a couple of seconds on Windows 7: QTBUG-10106. QNetworkReply *reply = Utils::NetworkAccessManager::instance()->get(request); diff --git a/src/plugins/texteditor/generichighlighter/manager.h b/src/plugins/texteditor/generichighlighter/manager.h index c6d9038eadc..5b602d2e039 100644 --- a/src/plugins/texteditor/generichighlighter/manager.h +++ b/src/plugins/texteditor/generichighlighter/manager.h @@ -79,6 +79,12 @@ public: static DefinitionMetaDataPtr parseMetadata(const QFileInfo &fileInfo); + struct RegisterData + { + QHash m_idByName; + QHash m_idByMimeType; + QHash m_definitionsMetaData; + }; private: void registerHighlightingFilesFinished(); void downloadAvailableDefinitionsListFinished(); @@ -99,12 +105,6 @@ private: QHash > m_definitions; QHash m_availableDefinitions; - struct RegisterData - { - QHash m_idByName; - QHash m_idByMimeType; - QHash m_definitionsMetaData; - }; RegisterData m_register; bool m_hasQueuedRegistration; QFutureWatcher m_registeringWatcher; diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg index 21bfa82a241..e325bb9ab5a 100644 --- a/src/tools/icons/qtcreatoricons.svg +++ b/src/tools/icons/qtcreatoricons.svg @@ -1964,71 +1964,54 @@ style="" /> + transform="translate(0,16)"> - - - - + y="552" + x="297" + style="fill:#ffffff;fill-opacity:1" /> - + d="m 304.999,554 c -1.656,0 -2.999,1.343 -2.999,3 l 0,3 1,0 0,-3 c 0,-1.103 0.896,-2 1.999,-2 1.103,0 2.001,0.897 2.001,2 l 0,3 1,0 0,-3 c 0,-1.657 -1.343,-3 -3.001,-3 z" + id="lockbow" /> + + id="src/plugins/coreplugin/images/unlocked" + transform="translate(-16,16)"> - + y="552" + x="329" + style="fill:#ffffff;fill-opacity:1" /> + xlink:href="#lockbow" + id="use6038" + width="100%" + height="100%" /> + -#include -#include -#include - -using namespace Utils; -int main() -{ - qDebug() << "Used TCP Ports (IP4):"; - - TcpPortsGatherer portsGatherer; - portsGatherer.update(QAbstractSocket::IPv4Protocol); - qDebug() << portsGatherer.usedPorts(); - - qDebug() << "Used TCP Ports (IP6):"; - portsGatherer.update(QAbstractSocket::IPv6Protocol); - qDebug() << portsGatherer.usedPorts(); - - qDebug() << "All Used TCP Ports:"; - portsGatherer.update(QAbstractSocket::UnknownNetworkLayerProtocol); - qDebug() << portsGatherer.usedPorts(); - - qDebug() << "Getting a few ports ..."; - PortList portList = PortList::fromString(QLatin1String("10000-10100")); - QStringList ports; - for (int i = 0; i < 10; ++i) { - quint16 port = portsGatherer.getNextFreePort(&portList); - Q_ASSERT(!portsGatherer.usedPorts().contains(port)); - Q_ASSERT(port >= 10000); - Q_ASSERT(port < 10100); - QString portStr = QString::number(port); - Q_ASSERT(!ports.contains(portStr)); - ports.append(QString::number(port)); - } - qDebug() << ports.join(QLatin1String(", ")); - return 0; -} diff --git a/tests/manual/utils/tcpportsgatherer/tcpportsgatherer.pro b/tests/manual/utils/tcpportsgatherer/tcpportsgatherer.pro deleted file mode 100644 index 7531e0526b6..00000000000 --- a/tests/manual/utils/tcpportsgatherer/tcpportsgatherer.pro +++ /dev/null @@ -1,8 +0,0 @@ -QTC_LIB_DEPENDS += utils -include(../../../auto/qttest.pri) - -QT += network -CONFIG += console -CONFIG -= app_bundle - -SOURCES += main.cpp diff --git a/tests/manual/utils/tcpportsgatherer/tcpportsgatherer.qbs b/tests/manual/utils/tcpportsgatherer/tcpportsgatherer.qbs deleted file mode 100644 index d5ac0356941..00000000000 --- a/tests/manual/utils/tcpportsgatherer/tcpportsgatherer.qbs +++ /dev/null @@ -1,24 +0,0 @@ -import qbs 1.0 - -Application { - name: "tcpportsgatherer" - - files: [ - "main.cpp", - "../../../../src/libs/utils/portlist.cpp", - "../../../../src/libs/utils/portlist.h", - "../../../../src/libs/utils/tcpportsgatherer.cpp", - "../../../../src/libs/utils/tcpportsgatherer.h" - ] - - cpp.includePaths: [ "../../../../src/libs" ] - cpp.defines: [ "QTCREATOR_UTILS_STATIC_LIB" ] - - Properties { - condition: qbs.targetOS == "windows" - cpp.dynamicLibraries: [ "iphlpapi.lib", "ws2_32.lib" ] - } - - Depends { name: "cpp" } - Depends { name: "Qt"; submodules: ["widgets"] } -} diff --git a/tests/manual/utils/utils.pro b/tests/manual/utils/utils.pro deleted file mode 100644 index a4899f90bb6..00000000000 --- a/tests/manual/utils/utils.pro +++ /dev/null @@ -1,3 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS = tcpportsgatherer diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index 116826df391..c9d2ee27826 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -33,6 +33,7 @@ import subprocess; import sys import errno; from datetime import datetime,timedelta; +import __builtin__ srcPath = '' SettingsPath = '' @@ -116,6 +117,16 @@ def waitForCleanShutdown(timeOut=10): shutdownDone=True if not shutdownDone and datetime.utcnow() > endtime: break + if platform.system() == 'Linux' and JIRA.isBugStillOpen(15749): + pgrepOutput = getOutputFromCmdline('pgrep -f qtcreator_process_stub') + pids = pgrepOutput.splitlines() + if len(pids): + print("Killing %d qtcreator_process_stub instances" % len(pids)) + for pid in pids: + try: + os.kill(__builtin__.int(pid), 9) + except OSError: # we might kill the parent before the current pid + pass def checkForStillRunningQmlExecutable(possibleNames): for qmlHelper in possibleNames: diff --git a/tests/system/suite_debugger/tst_qml_js_console/test.py b/tests/system/suite_debugger/tst_qml_js_console/test.py index a6adab106d2..28654109f53 100644 --- a/tests/system/suite_debugger/tst_qml_js_console/test.py +++ b/tests/system/suite_debugger/tst_qml_js_console/test.py @@ -110,6 +110,9 @@ def testLoggingFeatures(): clickButton(":*Qt Creator.Clear_QToolButton") def main(): + test.warning("This test must be rewritten (QTCREATORBUG-15831)") # QmlJS Console has changed + return + projName = "simpleQuickUI2.qmlproject" projFolder = os.path.dirname(findFile("testdata", "simpleQuickUI2/%s" % projName)) if not neededFilePresent(os.path.join(projFolder, projName)):